Hack Name: Mood Changer On Index v1.0

Author: parky

Updated for 1.9.8 SP3 by: WormHole @ XMB Garage

Description: This modification allows you to change your mood via the index page of your forum without going to the control panel / options to edit your mood.

Compatibility: XMB 1.9.8 SP3

Installation Note: Before adding this modification to your forum you should back up all files related to this modification.

License Note: This modification is released under the GPL License. You should have received a copy with this software package.

Author Note:
For security purposes, Please Check: http://www.xmbgarage.com for the latest version of this modification.
Downloading this modification from other sites could cause malicious code to enter into your XMB Forum software.
As such, XMB Garage.com will not offer support for modifications not offered in our available hacks list.
==============================================================================================================
=======
Step 1.
=======
============
Edit: index.php
============

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

eval('echo "'.template('header').'";');

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

// Mood Changer Mod Begin
if (X_MEMBER) {
    if (isset($moodchangersubmit)) {
        $mood = addslashes($moodchange);
        $db->query("UPDATE ".X_PREFIX."members SET mood = '$mood' WHERE username = '$xmbuser'"); 
        $moodchanger = "<tr class=\"tablerow\" bgcolor=\"$THEME[altbg1]\"><td align=\"center\" colspan=\"3\">$lang[moodchanged] </td></tr>"; 
    } else { 
        $moodchanger = "<script language='JavaScript'> 
        function clearForm() { 
            if (document.moodChangeForm.moodchange.value=='$self[mood]') { 
                document.moodChangeForm.moodchange.value=''; 
            } 
        } 
        </script>"; 
        $mood['mood'] = stripslashes($mood['mood']); 
        $moodchanger .= "<form name=\"moodChangeForm\" method=\"post\" action=\"index.php\"><tr class=\"tablerow\" bgcolor=\"$THEME[altbg1]\"><td align=\"center\" colspan=\"3\">$lang[newmood] <input type=\"text\" name=\"moodchange\" class=\"moodchangercss\" size=\"30\" maxlength=\"30\" value=\"$self[mood]\" onFocus='clearForm();' /> <input type=\"submit\" class=\"moodchangercss\" name=\"moodchangersubmit\" value=\"Submit\" /></td></tr></form>";
    }
}
// Mood Changer Mod End

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

// Mood Changer Mod Begin
$lang['moodchanged'] = "Thank you! Your Mood has been updated.";
$lang['newmood'] = "$xmbuser\'\s current Mood for Today is:";
$lang['changemood'] = "Update My Mood";
// Mood Changer Mod End

==============================================================================================================
=======
Step 3.
=======
=============================
Edit: index_welcome_member template
=============================
======
Find:
======

<td width="33%"><a href="#" onclick="Popup('buddy.php', 'Window', 450, 400);"><strong>$lang[launchbuddylist]</strong></a></td>
</tr>

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

$moodchanger

==============================================================================================================
=======
Step 4.
=======
==============
Edit: css template
==============
======
Find:
======

/*]]>*/
</style>

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

.moodchangercss { 
font-family: Verdana, arial, helvetica, sans-serif; 
font-size: 10px; 
font-weight: normal; 
background-color: $altbg1; 
color: $tabletext; 
}

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