Hack Name: Mood Icon Quick Change v1.1

Author: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

Updated for 1.9.8 SP3 by: WormHole @ XMB Garage

Description:
This modification will allow you to change your mood icon from your member control panel rather than editing your profile.

Supported Version: XMB 1.9.8 SP3

Notes:

YOU MUST HAVE MOOD ICONS INSTALLED BEFORE INSTALLING THIS HACK!!

This modification is released under the GPL. You should have recieved a copy of it with this software package.

Please backup your files before installing this modification. Neither XMBGarage nor the author can be held responsible if your board stops functioning properly due to you installing this modification.

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

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

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

======
Find:
======

loadtemplates(

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

loadtemplates(
'memcp_home_moodicon',

======
Find:
======

    $moodicons = '';
    if ($member['moodicon'] != '') {
        $moodicons = '<img src="'.ROOT.'images/moodicons/'.$member['moodicon'].'" alt="'.$lang['moodiconalt'].'" title="'.$lang['moodiconalt'].'" border="0" />';
    }
    
=============
Replace With:
=============

    // Mood Icons Mod Begin
    if ($member['moodicon'] != '') {
        $micon = "./images/moodicons/$member[moodicon]";
    } else {
        $micon = "./images/pixel.gif";
    }
    $miquery = $db->query("SELECT * FROM ".X_PREFIX."smilies WHERE type='moodicon'");
    $mibox   = array();
    $mibox[] = "<select name=\"newmoodicon\" onChange=\"document.miform.moodicon.src = this[this.selectedIndex].value\">";
    $mibox[] = "<option value=\"images/pixel.gif\">None...</option>";
    while($icon = $db->fetch_array($miquery)) {
        if ($member[moodicon] == $icon[url]) {
            $mibox[] = "<option value=\"./images/moodicons/$icon[url]\" selected=\"selected\">$icon[url]</option>";
        } else {
            $mibox[] = "<option value=\"./images/moodicons/$icon[url]\">$icon[url]</option>";
        }
    }
    $mibox[] = "</select>";
    $mibox   = implode("\n", $mibox);
    eval('$moodicons = "'.template("memcp_home_moodicon").'";');
    // Mood Icons Mod End
    
======
Find:
======

if ($action == 'profile') {

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

if ($action == 'updatemoodicon') {
    $newmoodicon = basename($newmoodicon);
    $db->query("UPDATE ".X_PREFIX."members SET moodicon='$newmoodicon' WHERE username='$xmbuser'");
    eval('echo "'.template('header').'";');
    echo '<center><span class="mediumtxt">'.$lang['miqc3'].'</span></center>';
    eval('echo "'.template('footer').'";');
    redirect('memcp.php', 2, X_REDIRECT_JS);
    exit;
}

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

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

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

=======================
Add To End Of File Above ?>:
=======================

// Mood Icon Quickchange Mod Begin
$lang['moodiconsupdate'] = 'Mood Icons Updated';
$lang['miqc1'] = "None...";
$lang['miqc2'] = "Update";
$lang['miqc3'] = "You have successfully changed your mood icon!";
// Mood Icon Quickchange Mod End


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

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

================================
Go to Administration Panel -> Templates
================================

==================================
Create Template: memcp_home_moodicon
==================================

=========================
Add Code and Submit Changes:
=========================

<form action="memcp.php?action=updatemoodicon" name="miform" method="POST">
$mibox&nbsp;<img src="$micon" name="moodicon" border="0" />&nbsp;<input type="submit" name="submit" value="$lang[miqc2]" />
</form>

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

Upload edited files and Enjoy!