Modification Name: Admin Control Panel Redirects v1.0

Description:
This modification will make the admin panel redirect back to the section you are editing.
This modification is based on the earlier version by Jonathon.

Compatibility: XMB 1.9.8 SP3

Tested On: XMB 1.9.8 SP3

Code Developed By: Adam Clarke (adam@scriptdesign.co.uk - http://www.scriptdesign.co.uk)

Note: Backup all affected files, templates & database's.

Affected Files: cp.php, cp2.php

Affected Templates: None

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

============================================================================================================================
=======
Step 1:
=======
==============
Edit File: cp.php
==============
==========
Find Code:
==========

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['textsettingsupdate'].'</td></tr>';

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

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['textsettingsupdate'].'</td></tr>';
        redirect("cp.php?action=settings", 1.5, X_REDIRECT_JS);

=======================
Find Code (On 2 Occasions):
=======================

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['textforumupdate'].'</td></tr>';

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

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['textforumupdate'].'</td></tr>';
        redirect("cp.php?action=forum", 1.5, X_REDIRECT_JS);

==========
Find Code:
==========

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['textmodupdate'].'</td></tr>';

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

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['textmodupdate'].'</td></tr>';
        redirect("cp.php?action=mods", 1.5, X_REDIRECT_JS);

==========
Find Code:
==========

        echo '<tr bgcolor="'.$altbg2.'"><td class="ctrtablerow">'.$self['status'].'</td></tr>';

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

        echo '<tr bgcolor="'.$altbg2.'"><td class="ctrtablerow">'.$self['status'].'</td></tr>';
        redirect("cp.php?action=ipban", 1.5, X_REDIRECT_JS);

==========
Find Code:
==========

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['textmembersupdate'].'</td></tr>';

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

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['textmembersupdate'].'</td></tr>';
        redirect("cp.php?action=members", 1.5, X_REDIRECT_JS);

============================================================================================================================
=======
Step 2:
=======
===============
Edit File: cp2.php
===============
==========
Find Code:
==========

        echo "<tr bgcolor=\"$altbg2\" class=\"tablerow\"><td align=\"center\">$lang[textattachmentsupdate]</td></tr>";

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

        echo "<tr bgcolor=\"$altbg2\" class=\"tablerow\"><td align=\"center\">$lang[textattachmentsupdate]</td></tr>";
        redirect("cp2.php?action=attachments", 1.5, X_REDIRECT_JS);

==========
Find Code:
==========

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['censorupdate'].'</td></tr>';

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

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['censorupdate'].'</td></tr>';
        redirect("cp2.php?action=censor", 1.5, X_REDIRECT_JS);

==========
Find Code:
==========

        echo "<tr bgcolor=\"$altbg2\" class=\"tablerow\"><td align=\"center\">$lang[forumpruned]</td></tr>";

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

        echo "<tr bgcolor=\"$altbg2\" class=\"tablerow\"><td align=\"center\">$lang[forumpruned]</td></tr>";
        redirect("cp2.php?action=prune", 1.5, X_REDIRECT_JS);

==========
Find Code:
==========

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['rankingsupdate'].'</td></tr>';

================
Replace Code With:
================
        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['rankingsupdate'].'</td></tr>';
        redirect("cp2.php?action=ranks", 1.5, X_REDIRECT_JS);

==========
Find Code:
==========

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['restrictedupdate'].'</td></tr>';
        redirect('cp2.php?action=restrictions', 2);

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

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['restrictedupdate'].'</td></tr>';
        redirect("cp2.php?action=restrictions", 1.5, X_REDIRECT_JS);

==========
Find Code:
==========
        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['smilieupdate'].'</td></tr>';

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

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['smilieupdate'].'</td></tr>';
        redirect("cp2.php?action=smilies", 1.5, X_REDIRECT_JS);

==========
Find Code:
==========

            echo $lang['textthemeimportfail'];
        } else {
            echo $lang['textthemeimportsuccess'];
        }

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

            echo $lang['textthemeimportfail'];
            redirect("cp2.php?action=themes", 1.5, X_REDIRECT_JS);
        } else {
            echo $lang['textthemeimportsuccess'];
            redirect("cp2.php?action=themes", 1.5, X_REDIRECT_JS);
        }

=======================
Find Code (On 3 Occasions):
=======================

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['themeupdate'].'</td></tr>';

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

        echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['themeupdate'].'</td></tr>';
        redirect("cp2.php?action=themes", 1.5, X_REDIRECT_JS);

============================================================================================================================
Enjoy!