============================================================================================================================
Modification Name: Mood Icon Quick Changer

Version: 1.0

Author: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

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

Updated for 1.9.5 by: WormHole @ XMB Garage

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

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

Author Notes:
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.
You downloaded this modification from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.
============================================================================================================================
=======
Step 1:
=======
==============
Edit memcp.php:
==============
==========
Find Code:
==========

loadtemplates(

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

loadtemplates(
'memcp_home_moodicon',

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

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

    // Mood Icons Mod Begin
    if ($member['moodicon'] != '') {
        $micon = "./images/moodicons/$member[moodicon]";
    } else {
        $micon = "./images/pixel.gif";
    }
    $miquery = $db->query("SELECT * FROM $table_smilies WHERE type='moodicon' ORDER BY url ASC");
    $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 Code:
==========

if ($action == 'profile') {

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

// Mood Icon Quick Changer Mod Begin
if ($action == 'updatemoodicon') {
    $newmoodicon = basename($newmoodicon);
    $db->query("UPDATE $table_members SET moodicon='$newmoodicon' WHERE username='$xmbuser'");
    redirect("memcp.php", 1, X_REDIRECT_JS);
    exit;
}
// Mood Icon Quick Changer Mod End

============================================================================================================================
=======
Step 2:
=======
=======================
Edit File: lang/English.lang.php
=======================
========================
Add To End Of File Above  ?>
========================

// Mood Icon Quick Changer Mod Begin
$lang['moodiconsupdate'] = 'Mood Icons Updated';
$lang['miqc1'] = "None...";
$lang['miqc2'] = "Update";
// Mood Icon Quick Changer Mod End

============================================================================================================================
=======
Step 3:
=======
===============================
Go To Administration Panel --> Templates
===============================
===================================
Create New 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="newmoodicon" border="0" /><br />
<input type="submit" name="submit" value="$lang[miqc2]" />
</form>

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