=======================================================================================================================================
Title: Admin Panel Links System v1.0

Author: John Briggs

Description:
This modification will provide scalable control of adding links to the admin control panel as well as manage them, delete them and more.

Copyright:  2009 John Briggs. All rights reserved.

Compatability: XMB 1.9.8 SP3

Install Note: Before adding this modification to your forum you should back up all files related to this modification.

License Note: This modification is released under the GPL License. A copy is provided with this software package.

Author Note:
You downloaded this modification from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.

=======================================================================================================================================
=======
Step 1:
=======
====================================
Go To Administration Panel --> Insert Raw SQL
====================================

Upload provided file named "SQL.txt" and submit.

=======================================================================================================================================
=======
Step 2:
=======
=======================
Edit File: include/admin.inc.php
=======================
=======================================================================================
Note: If you have mods installed that effect this portion of code then no worries. You can re-add the links with the new system.
=======================================================================================
==========
Find Code:
==========

function displayAdminPanel() {
    global $lang, $THEME;

    ?>
    <table cellspacing="0" cellpadding="0" border="0" width="<?php echo $THEME['tablewidth']?>" align="center">
    <tr>
    <td bgcolor="<?php echo $THEME['bordercolor']?>">
    <table border="0" cellspacing="<?php echo $THEME['borderwidth']?>" cellpadding="<?php echo $THEME['tablespace']?>" width="100%">
    <tr class="category">
    <td colspan="30" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['textcp']?></font></strong></td>
    </tr>
    <tr bgcolor="<?php echo $THEME['altbg1']?>" class="tablerow">
    <td colspan="30" align="center">
    <br />
    <table cellspacing="0" cellpadding="0" border="0" width="98%" align="center">
    <tr>
    <td bgcolor="<?php echo $THEME['bordercolor']?>">
    <table border="0" cellspacing="<?php echo $THEME['borderwidth']?>" cellpadding="<?php echo $THEME['tablespace']?>" width="100%">
    <tr class="category">
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['general']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['textforums']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['textmembers']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['look_feel']?></font></strong></td>
    </tr>
    <tr>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    &raquo;&nbsp;<a href="cp2.php?action=attachments"><?php echo $lang['textattachman']?></a><br />
    &raquo;&nbsp;<a href="cp2.php?action=censor"><?php echo $lang['textcensors']?></a><br />
    &raquo;&nbsp;<a href="cp2.php?action=newsletter"><?php echo $lang['textnewsletter']?></a><br />
    &raquo;&nbsp;<a href="cp.php?action=search"><?php echo $lang['cpsearch']?></a><br />
    &raquo;&nbsp;<a href="cp.php?action=settings"><?php echo $lang['textsettings']?></a><br />
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    &raquo;&nbsp;<a href="cp.php?action=forum"><?php echo $lang['textforums']?></a><br />
    &raquo;&nbsp;<a href="cp.php?action=mods"><?php echo $lang['textmods']?></a><br />
    &raquo;&nbsp;<a href="cp2.php?action=prune"><?php echo $lang['textprune']?></a><br />
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    &raquo;&nbsp;<a href="cp.php?action=ipban"><?php echo $lang['textipban']?></a><br />
    &raquo;&nbsp;<a href="cp.php?action=members"><?php echo $lang['textmembers']?></a><br />
    &raquo;&nbsp;<a href="cp2.php?action=ranks"><?php echo $lang['textuserranks']?></a><br />
    &raquo;&nbsp;<a href="cp2.php?action=restrictions"><?php echo $lang['cprestricted']?></a><br />
    &raquo;&nbsp;<a href="cp.php?action=rename"><?php echo $lang['admin_rename_txt']?></a><br />
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    &raquo;&nbsp;<a href="cp2.php?action=smilies"><?php echo $lang['smilies']?></a><br />
    &raquo;&nbsp;<a href="cp2.php?action=templates"><?php echo $lang['templates']?></a><br />
    &raquo;&nbsp;<a href="cp2.php?action=themes"><?php echo $lang['themes']?></a><br />
    </td>
    </tr>
    <tr class="category">
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['logs']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['tools']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['mysql_tools']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['textfaqextra']?></font></strong></td>
    </tr>
    <tr>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    &raquo;&nbsp;<a href="cp2.php?action=modlog"><?php echo $lang['textmodlogs']?></a><br />
    &raquo;&nbsp;<a href="cp2.php?action=cplog"><?php echo $lang['textcplogs']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=logsdump"><?php echo $lang['textlogsdump']?></a><br />
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    &raquo;&nbsp;<a href="tools.php?action=fixftotals"><?php echo $lang['textfixposts']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=fixlastposts"><?php echo $lang['textfixlastposts']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=fixmposts"><?php echo $lang['textfixmemposts']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=fixttotals"><?php echo $lang['textfixthread']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=fixorphanedthreads"><?php echo $lang['textfixothreads']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=fixorphanedattachments"><?php echo $lang['textfixoattachments']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=updatemoods"><?php echo $lang['textfixmoods']?></a><br />
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    &raquo;&nbsp;<a href="cp.php?action=upgrade"><?php echo $lang['raw_mysql']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=analyzetables"><?php echo $lang['analyze']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=checktables"><?php echo $lang['textcheck']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=optimizetables"><?php echo $lang['optimize']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=repairtables"><?php echo $lang['repair']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=u2udump"><?php echo $lang['u2udump']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=whosonlinedump"><?php echo $lang['cpwodump']?></a><br />
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <br />
    <?php
}

================
Replace Code With:
================

function displayAdminPanel() {
    global $lang, $THEME;
    global $db, $table_cplinks, $generallinks, $forumlinks, $memberslinks, $lookfeellinks;
    global $logslinks, $toolslinks, $dblinks, $extralinks;

    $generallinks = $forumlinks = $memberslinks = $lookfeellinks = '';
    $logslinks = $toolslinks = $dblinks = $extralinks = '';
    $qcplinks = $db->query("SELECT * FROM ".X_PREFIX."cplinks ORDER BY displayorder ASC");
    while ($cplinkstuff = $db->fetch_array($qcplinks)) {
        $cplinkstuff['url'] = stripslashes($cplinkstuff['url']);
        $cplinkstuff['name'] = stripslashes($cplinkstuff['name']);
        if ($cplinkstuff['grouporder'] == 'group1' && $cplinkstuff['status'] == 'on') {
            $generallinks .= '&raquo;&nbsp;<a href="'.$cplinkstuff['url'].'">'.$cplinkstuff['name'].'</a><br />';
        } elseif ($cplinkstuff['grouporder'] == 'group2' && $cplinkstuff['status'] == 'on') {
            $forumlinks .= '&raquo;&nbsp;<a href="'.$cplinkstuff['url'].'">'.$cplinkstuff['name'].'</a><br />';
        } elseif ($cplinkstuff['grouporder'] == 'group3' && $cplinkstuff['status'] == 'on') {
            $memberslinks .= '&raquo;&nbsp;<a href="'.$cplinkstuff['url'].'">'.$cplinkstuff['name'].'</a><br />';
        } elseif ($cplinkstuff['grouporder'] == 'group4' && $cplinkstuff['status'] == 'on') {
            $lookfeellinks .= '&raquo;&nbsp;<a href="'.$cplinkstuff['url'].'">'.$cplinkstuff['name'].'</a><br />';
        } elseif ($cplinkstuff['grouporder'] == 'group5' && $cplinkstuff['status'] == 'on') {
            $logslinks .= '&raquo;&nbsp;<a href="'.$cplinkstuff['url'].'">'.$cplinkstuff['name'].'</a><br />';
        } elseif ($cplinkstuff['grouporder'] == 'group6' && $cplinkstuff['status'] == 'on') {
            $toolslinks .= '&raquo;&nbsp;<a href="'.$cplinkstuff['url'].'">'.$cplinkstuff['name'].'</a><br />';
        } elseif ($cplinkstuff['grouporder'] == 'group7' && $cplinkstuff['status'] == 'on') {
            $dblinks .= '&raquo;&nbsp;<a href="'.$cplinkstuff['url'].'">'.$cplinkstuff['name'].'</a><br />';
        } elseif ($cplinkstuff['grouporder'] == 'group8' && $cplinkstuff['status'] == 'on') {
            $extralinks .= '&raquo;&nbsp;<a href="'.$cplinkstuff['url'].'">'.$cplinkstuff['name'].'</a><br />';
        } else {
            $extralinks .= '&raquo;&nbsp;<a href="'.$cplinkstuff['url'].'">'.$cplinkstuff['name'].'</a><br />';
        }
    }
    $db->free_result($qcplinks);
    ?>
    <table cellspacing="0" cellpadding="0" border="0" width="<?php echo $THEME['tablewidth']?>" align="center">
    <tr>
    <td bgcolor="<?php echo $THEME['bordercolor']?>">
    <table border="0" cellspacing="<?php echo $THEME['borderwidth']?>" cellpadding="<?php echo $THEME['tablespace']?>" width="100%">
    <tr class="category">
    <td colspan="30" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['textcp']?></font></strong></td>
    </tr>
    <tr bgcolor="<?php echo $THEME['altbg1']?>" class="tablerow">
    <td colspan="30" align="center">
    <br />
    <table cellspacing="0" cellpadding="0" border="0" width="98%" align="center">
    <tr>
    <td bgcolor="<?php echo $THEME['bordercolor']?>">
    <table border="0" cellspacing="<?php echo $THEME['borderwidth']?>" cellpadding="<?php echo $THEME['tablespace']?>" width="100%">
    <tr class="category">
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['general']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['textforums']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['textmembers']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['look_feel']?></font></strong></td>
    </tr>
    <tr>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    <?php echo $generallinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    <?php echo $forumlinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    <?php echo $memberslinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    <?php echo $lookfeellinks?>
    </td>
    </tr>
    <tr class="category">
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['logs']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['tools']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['mysql_tools']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $THEME['cattext']?>"><?php echo $lang['textfaqextra']?></font></strong></td>
    </tr>
    <tr>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    <?php echo $logslinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    <?php echo $toolslinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    <?php echo $dblinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">
    &raquo;&nbsp;<a href="cp_adminlinks.php"><?php echo $lang['cplinkmanager']?></a><br />
    <?php echo $extralinks?>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <br />
    <?php
}

=======================================================================================================================================
=======
Step 3:
=======
=======================
Edit File: lang/English.lang.php
=======================
============================
Add Code To End Of File Above ?>
============================

// Admin Panel Links System Mod Begin
$lang['cplinkdisplayorder'] = "Order:";
$lang['cplinkname'] = "Name:";
$lang['cplinkurl'] = "Url:";
$lang['cplinkgrouporder'] = "Group:";
$lang['cplinkstatus'] = "Status:";
$lang['cplinkcreate'] = "Create Link:";
$lang['cplinknone'] = "There are no admin links to display.";
$lang['cplinkupdate'] = "Admin panel links updated successfully.";
$lang['cplinkgroup1'] = "General";
$lang['cplinkgroup2'] = "Forums";
$lang['cplinkgroup3'] = "Members";
$lang['cplinkgroup4'] = "Look &amp; Feel";
$lang['cplinkgroup5'] = "Logs";
$lang['cplinkgroup6'] = "Tools";
$lang['cplinkgroup7'] = "Database Tools";
$lang['cplinkgroup8'] = "Extra";
$lang['cplinkmanager'] = "Admin Panel Links System";
// Admin Panel Links System Mod End

=======================================================================================================================================
=======
Step 4:
=======
=====================
Edit File: header.php
=====================
==========
Find Code:
==========

    'captchaimages',

================
Replace Code With:
================

    'captchaimages',
    'cplinks',

=======================================================================================================================================
=======
Step 5:
=======
=======================
Edit File: include/online.inc.php
=======================
==========
Find Code:
==========

    } else if (false !== strpos($url, '/cp.php') || false !== strpos($url, '/cp2.php')

================
Replace Code With:
================

    } else if (false !== strpos($url, "/cp.php") || false !== strpos($url, "/cp2.php") || false !== strpos($url, '/cp_adminlinks.php')

=======================================================================================================================================
=======
Step 6:
=======

Upload provided file named "cp_adminlinks.php" to your board directiory.

=======================================================================================================================================
=======
Step 7:
=======

Now upload all effected and edited files regarding this modification to there respective locations.

=======================================================================================================================================