Title: Default Themes Tool v1.0

Author: John Briggs

Updated for 1.9.8 by: WormHole @ XMB Garage

Description:
This mod will provide a new tool in admin panel to set all member themes to the default theme set in admin settings.

Copyright:  2006 John Briggs. All rights reserved.

Compatability: XMB 1.9.8 Final SP2

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

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

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

=======================================================================================================================================
=======
Step 1:
=======

=====================================
Edit File: include/admin.inc.php
=====================================

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

    &raquo;&nbsp;<a href="tools.php?action=u2udump"><?php echo $lang['u2udump']?></a><br />

===============
Add Code Above:
===============

    <!-- Default Themes Tool Mod Begin -->
    &raquo;&nbsp;<a href="tools.php?action=defaulttheme"><?php echo $lang['defaultthemetool']?></a><br />
    <!-- Default Themes Tool Mod End -->

=======================================================================================================================================
=======
Step 2:
=======

====================
Edit File: tools.php
====================

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

    case 'fixorphanedattachments':
        if (noSubmit('orphattachsubmit')) {
            echo '<form action="tools.php?action=fixorphanedattachments" method="post">';
            echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>';
            echo '<input type="submit" name="orphattachsubmit" value="'.$lang['o_attach_submit'].'" /></td></tr>';
            echo '</form>';
        } else {
            $i = 0;
            $q = $db->query("SELECT aid, pid FROM ".X_PREFIX."attachments");
            while($a = $db->fetch_array($q)) {
                $result = $db->query("SELECT pid FROM ".X_PREFIX."posts WHERE pid='$a[pid]'");
                if ($db->num_rows($result) == 0) {
                    $db->free_result($result);
                    $db->query("DELETE FROM ".X_PREFIX."attachments WHERE aid='$a[aid]'");
                    $i++;
                }
            }
            $db->free_result($q);

            echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>';
            echo $i.$lang['o_attachments_found'].'</td></tr>';
        }
        break;

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

    case 'defaulttheme':
        if (!isset($_POST['yessubmit'])) {
            echo "<tr bgcolor=\"$THEME[altbg2]\" class=\"ctrtablerow\"><td>".$lang['defaulttheme_confirm']."<br /><form action=\"tools.php?action=defaulttheme\" method=\"post\"><input type=\"submit\" name=\"yessubmit\" value=\"".$lang['textyes']."\" /> - <input type=\"submit\" name=\"yessubmit\" value=\"".$lang['textno']."\" /></form></td></tr>";
        } elseif ($lang['textyes'] == $_POST['yessubmit']) {
            $db->query("UPDATE ".X_PREFIX."members SET theme=0");
            nav($lang['tools']);
            echo "<tr bgcolor=\"$THEME[altbg2]\" class=\"ctrtablerow\"><td>$lang[tool_completed] - $lang[tool_defaulttheme]</td></tr></table></table>";
            redirect('tools.php', 2);
            end_time();
            eval('echo ("'.template('footer').'");');
            exit;
        } else {
            redirect('cp.php', 0);
        }
        break;

=======================================================================================================================================
=======
Step 4:
=======

================================
Edit File: lang/English.lang.php
================================

================================
Add Code At Very Bottom of File:
================================

// Default Themes Tool Mod Begin
$lang['defaulttheme_confirm'] = "Are you sure you want to set all themes to default?";
$lang['tool_defaulttheme'] = "All Themes Set To Default Successfully.";
$lang['defaultthemetool'] = "Reset Themes";
// Default Themes Tool Mod End

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