=======================================================================================================================================
Title: Admin Panel Links System

Version: 1.0

Author: John Briggs

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

Copyright:  2011 John Briggs. All Rights Reserved.

Compatability: XMB 1.9.5 Final SP1

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 v3. 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 click Submit Changes.
==============================================
=======================================================================================================================================
=======
Step 2:
=======
==========================
Edit File: include/admin.user.inc.php
==========================
============================================================================================
Note: If you have modifications 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 $tablewidth, $bordercolor, $borderwidth, $tablespace, $altbg1, $altbg2;
    global $lang, $cattext;

    ?>
    <table cellspacing="0" cellpadding="0" border="0" width="<?php echo $tablewidth?>" align="center">
    <tr>
    <td bgcolor="<?php echo $bordercolor?>">
    <table border="0" cellspacing="<?php echo $borderwidth?>" cellpadding="<?php echo $tablespace?>" width="100%">
    <tr class="category">
    <td colspan="30" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['textcp']?></font></strong></td>
    </tr>

    <tr bgcolor="<?php echo $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 $bordercolor?>">
    <table border="0" cellspacing="<?php echo $borderwidth?>" cellpadding="<?php echo $tablespace?>" width="100%">

    <tr class="category">
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['general']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['textforums']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['textmembers']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['look_feel']?></font></strong></td>
    </tr>

    <tr>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $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 $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 $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 $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 $cattext?>"><?php echo $lang['logs']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['tools']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['mysql_tools']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['backup_tools']?></font></strong></td>
    </tr>

    <tr>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $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>
    </td>

    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $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=updatemoods"><?php echo $lang['textfixmoods']?></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 />
    </td>

    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $altbg2?>">
    &raquo;&nbsp;<a href="tools.php?action=analyzetables"><?php echo $lang['analyze']?></a><br />
    &raquo;&nbsp;<a href="tools.php?action=whosonlinedump"><?php echo $lang['cpwodump']?></a><br />
    &raquo;&nbsp;<a href="cp.php?action=upgrade"><?php echo $lang['raw_mysql']?></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 />
    </td>

    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $altbg2?>">
    &raquo;&nbsp;<a href="javascript:confirmAction('<?php echo $lang['disclaimer'];?>', 'cp2.php?action=dbdump');"><?php echo $lang['db_backup']?></a><br />
    &raquo;&nbsp;<a href="javascript:confirmAction('<?php echo $lang['disclaimer'];?>', 'dump_attachments.php?action=dump_attachments');"><?php echo $lang['dump_attachments']?></a><br />
    &raquo;&nbsp;<a href="javascript:confirmAction('<?php echo $lang['disclaimer'];?>', 'dump_attachments.php?action=restore_attachments');"><?php echo $lang['restore_attachments']?></a><br />
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <br />
<?php
}

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

function displayAdminPanel() {
    global $tablewidth, $bordercolor, $borderwidth, $tablespace, $altbg1, $altbg2, $lang, $cattext;
    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 $table_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 $tablewidth?>" align="center">
    <tr>
    <td bgcolor="<?php echo $bordercolor?>">
    <table border="0" cellspacing="<?php echo $borderwidth?>" cellpadding="<?php echo $tablespace?>" width="100%">
    <tr class="category">
    <td colspan="30" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['textcp']?></font></strong></td>
    </tr>
    <tr bgcolor="<?php echo $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 $bordercolor?>">
    <table border="0" cellspacing="<?php echo $borderwidth?>" cellpadding="<?php echo $tablespace?>" width="100%">
    <tr class="category">
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['general']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['textforums']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['textmembers']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['look_feel']?></font></strong></td>
    </tr>
    <tr>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $altbg2?>">
    <?php echo $generallinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $altbg2?>">
    <?php echo $forumlinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $altbg2?>">
    <?php echo $memberslinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $altbg2?>">
    <?php echo $lookfeellinks?>
    </td>
    </tr>
    <tr class="category">
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['logs']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['tools']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['mysql_tools']?></font></strong></td>
    <td valign="top" width="20%" align="center"><strong><font color="<?php echo $cattext?>"><?php echo $lang['textfaqextra']?></font></strong></td>
    </tr>
    <tr>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $altbg2?>">
    <?php echo $logslinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $altbg2?>">
    <?php echo $toolslinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $altbg2?>">
    <?php echo $dblinks?>
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $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 Very Bottom 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'] = "Extras";
$lang['cplinkmanager'] = "Admin Panel Links System";
// Admin Panel Links System Mod End

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

,'buddys'

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

,'buddys','cplinks'

=======================================================================================================================================
=======
Step 5:
=======
===============
Edit File: misc.php
===============
==========
Find Code:
==========

    } elseif (false !== strpos($url, "/index.php")) {
        $location = $lang['onlineindex'];

===============
Add Code Below:
===============

    // Admin Panel Links System Mod Begin
    } elseif (false !== strpos($url, '/cp_adminlinks.php')) {
        $location = $lang['onlinecp'];
        if (!X_ADMIN) {
            $url = 'index.php';
        }
    // Admin Panel Links System Mod End

=======================================================================================================================================
=======
Step 7:
=======
===================================================
Upload provided file named 'cp_adminlinks.php' to your board directory.
===================================================
=======================================================================================================================================
=======
Step 8:
=======
==================================================================
Now upload all effected and edited files regarding this modification to there respective locations.
==================================================================
Enjoy!