Title: Member Control Panel Quick Theme Selection v1.0

Author: John Briggs

Description:
This modification will provide a drop down selection in your control panel to select available themes on your forum.

Copyright:  2006 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 mod.

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

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

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

====================
Edit File: memcp.php
====================

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

loadtemplates(

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

loadtemplates(
'memcp_home_themes',

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

if ($action == 'profile') {

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

$newtheme = (isset($newtheme) && is_numeric($newtheme)) ? (int) $newtheme : 0;
if ($action == 'quicktheme') {
    $db->query("UPDATE $table_members SET theme='$newtheme' WHERE username='$xmbuser'");
    redirect('memcp.php', 0);
}

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

    $query = $db->query("SELECT * FROM ".X_PREFIX."members WHERE username='$xmbuser'");

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

    $listquickthemes = array();
    $query = $db->query("SELECT themeid, name FROM ".X_PREFIX."themes ORDER BY name ASC");
    $quickthemes = '';
    while ($qt = $db->fetch_array($query)) {
        if ($self['theme'] == $qt['themeid']) {
            $listquickthemes[] = '<option value="'.$qt['themeid'].'" selected="selected">'.stripslashes($qt['name']).'</option>';
        } else {
            $listquickthemes[] = '<option value="'.$qt['themeid'].'">'.stripslashes($qt['name']).'</option>';
        }
    }
    $listquickthemes[] = '</select>';
    $listquickthemes = implode("\n", $listquickthemes);
    $db->free_result($query);
    eval('$quickthemes .= "'.template('memcp_home_themes').'";');

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

============================================
Go To Admin Panel -> Templates -> memcp_home
============================================

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

$THEME[name]

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

$quickthemes

=======================================================================================================================================
=======
Step 3:
=======

===========================================================================
Go To Admin Panel -> Templates -> Create Template Name -> memcp_home_themes
===========================================================================

================================
Add Code & Click Submit Changes:
================================

<form method="get" action="memcp.php?action=quicktheme">
<select name="action" id="action" onchange="if(this.options[this.selectedIndex].value != '') { window.location=('memcp.php?action=quicktheme&amp;newtheme='+this.options[this.selectedIndex].value) }">
$listquickthemes
</select>
</form>

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