============================================================================================================================
Modification Name: Mood Changer On Index

Version: 1.0

Author: parky

Updated for 1.9.5 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.

Supported Version: XMB 1.9.5 SP1

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 v3. A copy is provided 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 at our web site.
============================================================================================================================
=======
Step 1.
=======
==============
Edit: index.php
==============
==========
Find Code:
==========

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

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

// Mood Changer On Index Mod Begin
if (X_MEMBER) {
    if (isset($moodchangersubmit)) {
        $mood = addslashes($moodchange);
        $db->query("UPDATE $table_members SET mood = '$mood' WHERE username = '$xmbuser'"); 
        $moodchanger = "<tr class=\"tablerow\" bgcolor=\"$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=\"$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 On Index Mod End

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

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

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

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

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

$moodchanger

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

/*]]>*/
</style>

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

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

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