Title: Default Themes Tool v1.0

Author: John Briggs

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.5 Final

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 XMBMods.com, the #1 source for XMB related downloads.
Please visit http://www.xmbmods.com/ for support.

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

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

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

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

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

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

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

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

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

    case 'fixorphanedattachments':
        /*
            function generously donated by vanderaj
        */
        if (!isset($orphattachsubmit)) {
            echo '<tr bgcolor="' . $altbg2 . '" class="ctrtablerow"><td>';
            echo '<form action="tools.php?action=fixorphanedattachments" method="post">';
            echo '<input type="submit" name="orphattachsubmit" value="'.$lang['o_attach_submit'].'" />';
            echo '</form>';
        } else {
            // discover the total number of attachments
            $i = 0;
            $q = $db->query("SELECT aid, pid FROM $table_attachments");
            while ($a = $db->fetch_array($q)) {
                $result = $db->query("SELECT pid FROM $table_posts WHERE pid='$a[pid]'");
                if ( $db->num_rows($result) == 0) {
                    // take action against this row as it has no parent post to attach to.
                    $db->query("DELETE FROM $table_attachments WHERE aid='$a[aid]'");
                    $i++;
                }
            }

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

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

    case 'defaulttheme':
        if (!isset($_POST['yessubmit'])) {
            echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"></form></td></tr><td>'.$lang['defaulttheme_confirm'].'<br /><form action="tools.php?action=defaulttheme" method="post"><input class="submit" type="submit" name="yessubmit" value="'.$lang['textyes'].'" /> - <input class="submit" type="submit" name="yessubmit" value="'.$lang['textno'].'" />';
        } elseif ($lang['textyes'] == $_POST['yessubmit']) {
            $db->query("UPDATE $table_members SET theme=0");
            nav($lang['tools']);
            echo '<tr bgcolor="'.$altbg2.'" class="ctrtablerow"><td>'.$lang['tool_completed'].' - '.$lang['tool_defaulttheme'].'</td></tr></table></table>';
            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:
================================

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

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