============================================================================================================================
Modification Title: Mood Status On-Off v1.0

Author: Jonathon of JDMnet.org

Updated by: NHale623

Last Updated: March 31, 2010

Description: This modificaiton will allow the Admin to turn on/off - the "mood" for members.

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. A copy is provided with this software package.
============================================================================================================================
=======
Step 1:
=======
====================================
Go To Administration Panel --> Insert Raw SQL
====================================

Upload provided file named "SQL.txt" & click "Submit Changes" button.

============================================================================================================================
=======
Step 2:
=======
==============
Edit File: cp.php
==============
==========
Find Code:
==========

        $tickerstatuson = $tickerstatusoff = '';
        if ($SETTINGS['tickerstatus'] == "on") {
            $tickerstatuson = $selHTML;
        } else {
            $tickerstatusoff = $selHTML;
        }

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

        // Mood Status On-Off Mod Begin
        $enablemoodon = $enablemoodoff = '';
        if ($SETTINGS['moodsetting'] == 'on') {
            $enablemoodon = $selHTML;
        } else {
            $enablemoodoff = $selHTML;
        }
        // Mood Status On-Off Mod End

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

        printsetting1($lang['attachimginpost'], "attachimgpostnew", $attachimgposton, $attachimgpostoff);

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

        // Mood Status On-Off Mod Begin
        printsetting1($lang['enablemoodstatus'], "enablemoodstatusnew", $enablemoodon, $enablemoodoff);
        // Mood Status On-Off Mod End

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

        $resetSigNew = ($resetSigNew == 'on') ? 'on' : 'off';

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

        // Mood Status On-Off Mod Begin
        $enablemoodstatusnew = ($enablemoodstatusnew == 'on') ? 'on' : 'off';
        // Mood Status On-Off Mod End

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

$db->query("UPDATE $table_settings SET

=============================
Find Code At End Of Above Statement
=============================

");

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

, moodsetting='$enablemoodstatusnew'");

============================================================================================================================
=======
Step 3:
=======
===================
Edit File: editprofile.php
===================
==========
Find Code:
==========

loadtemplates(

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

loadtemplates('memcp_profile_moodcolor',

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

    if ($SETTINGS['avastatus'] == 'on') {

===============
Add Code Above:
===============
    
    // Mood Status On-Off Mod Begin
    $moodcolor = '';
    if ($moodsetting == 'on') {
        eval('$moodcolor = "'.template('memcp_profile_moodcolor').'";');
    }
    // Mood Status On-Off Mod End

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

    $mood           = isset($newmood) ? checkInput($newmood, 'no', 'no', 'javascript', false) : '';

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

    // Mood Status On-Off Mod Begin
    if ($moodsetting == 'on') {
        $mood = isset($newmood) ? checkInput($newmood, 'no', 'no', 'javascript', false) : '';
    } else {
        $mood = $member['mood'];
    }
    // Mood Status On-Off Mod End

============================================================================================================================
=======
Step 4:
=======
=================
Edit File: member.php
=================
==========
Find Code:
==========

loadtemplates(

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

'member_profile_moodcolor',
'member_reg_moodcolor',

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

            eval('echo stripslashes("'.template('member_reg').'");');

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

            // Mood Status On-Off Mod Begin
            $moodcolor = '';
            if ($moodsetting == 'on') {
                eval('$moodcolor = "'.template('member_reg_moodcolor').'";');
            }
            // Mood Status On-Off Mod End

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

        $mood          = isset($mood) ? checkInput($mood, '', '', 'javascript', false) : '';

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

        // Mood Status On-Off Mod Begin
        if ($moodsetting == 'on') {
            $mood = isset($mood) ? checkInput($mood, '', '', 'javascript', false) : '';
        } else {
            $mood = '';
        }
        // Mood Status On-Off Mod End

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

            if ($memberinfo['mood'] != '') {
                $memberinfo['mood'] = censor($memberinfo['mood']);
                $memberinfo['mood'] = postify($memberinfo['mood'], 'no', 'no', 'yes', 'no', 'yes', 'no', true, 'yes');
            } else {
                $memberinfo['mood'] = '';
            }

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

            // Mood Status On-Off Mod Begin
            $moodcolor = '';
            if ($moodsetting == 'on') {
                eval('$moodcolor = "'.template('member_profile_moodcolor').'";');
            }
            // Mood Status On-Off Mod End

============================================================================================================================
=======
Step 5:
=======
=================
Edit File: memcp.php
=================
==========
Find Code:
==========

loadtemplates(

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

'memcp_moodcolor',

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

        if (strlen(trim($dateformatnew)) == 0) {

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

        // Mood Status On-Off Mod Begin
        $moodcolor = '';
        if ($moodsetting == 'on') {
            eval('$moodcolor = "'.template('memcp_moodcolor').'";');
        }
        // Mood Status On-Off Mod End

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

        $mood           = isset($newmood) ? checkInput($newmood, 'no', 'no', 'javascript', false) : '';

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

        // Mood Status On-Off Mod Begin
        if ( $moodsetting == 'on' ) {
            $mood = isset($newmood) ? checkInput($newmood, '', '', 'javascript', false) : '';
        } else {
            $mood = $member['mood'];
        }
        // Mood Status On-Off Mod End

============================================================================================================================
=======
Step 6:
=======
===================
Edit File: viewthread.php
===================
==========
Find Code:
==========

            if ($post['mood'] != '') {
                $post['mood'] = censor($post['mood']);
                $mood = '<strong>'.$lang['mood'].'</strong> '.postify($post['mood'], 'no', 'no', 'yes', 'no', 'yes', 'no', true, 'yes');
            } else {
                $mood = '';
            }

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

            // Mood Status On-Off Mod Begin
            if ($post['mood'] != '' && $moodsetting == 'on') {
                $post['mood'] = censor($post['mood']);
                $mood = '<strong>'.$lang['mood'].'</strong> '.postify($post['mood'], 'no', 'no', 'yes', 'no', 'yes', 'no', true, 'yes');
            } else {
                $mood = '';
            }
            // Mood Status On-Off Mod End

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

// Mood Status On-Off Mod Begin
$lang['enablemoodstatus'] = "Enable Mood for Members:";
// Mood Status On-Off Mod End

============================================================================================================================
=======
Step 8:
=======
=
===============================
Go To Administration Panel --> Templates
===============================
=====================================
Create New Template: memcp_profile_moodcolor
=====================================
============================
Add Code and Click Submit Changes
============================

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[userprofilemood]</td>
<td bgcolor="$altbg2"><input type="text" name="newmood" size="25" value="$member[mood]" /></td>
</tr>

============================================================================================================================
=======
Step 9:
=======
===============================
Go To Administration Panel --> Templates
===============================
=====================================
Create New Template: member_profile_moodcolor
=====================================
============================
Add Code and Click Submit Changes
============================

<tr class="tablerow">
<td bgcolor="$altbg1" valign="top">$lang[userprofilemood]</td>
<td bgcolor="$altbg2">$memberinfo[mood]</td>
</tr>

============================================================================================================================
========
Step 10:
========
===============================
Go To Administration Panel --> Templates
===============================
========================================
Create New Template Name: member_reg_moodcolor
========================================
============================
Add Code and Click Submit Changes
============================

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[memcpmood]</td>
<td bgcolor="$altbg2"><input type="text" name="newmood" size="25" value="" /></td>
</tr>

============================================================================================================================
========
Step 11:
========
===============================
Go To Administration Panel --> Templates
===============================
==================================
Create Template Name -> memcp_moodcolor
==================================
============================
Add Code and Click Submit Changes
============================

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[memcpmood]</td>
<td bgcolor="$altbg2"><input type="text" name="newmood" size="25" value="$member[mood]" /></td>
</tr>

============================================================================================================================
========
Step 12:
========
===============================
Go To Administration Panel --> Templates
===============================
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[userprofilemood]</td>
<td bgcolor="$altbg2" class="tablerow"><input type="text" name="newmood" size="25" value="$member[mood]" /></td>
</tr>

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

$moodcolor

============================================================================================================================
========
Step 13:
========
===============================
Go To Administration Panel --> Templates
===============================
=====================
Edit Template: member_reg
=====================
==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[memcpmood]</td>
<td bgcolor="$altbg2" class="tablerow"><input type="text" name="mood" size="25" value="" value="" /></td>
</tr>

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

$moodcolor

============================================================================================================================
========
Step 14:
========
===============================
Go To Administration Panel --> Templates
===============================
=======================
Edit Template: member_profile
=======================
==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" valign="top" class="tablerow">$lang[userprofilemood]</td>
<td bgcolor="$altbg2" class="tablerow">$memberinfo[mood]</td>
</tr>

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

$moodcolor

============================================================================================================================
========
Step 15:
========
===============================
Go To Administration Panel --> Templates
===============================
=======================
Edit Template: memcp_profile
=======================
==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[memcpmood]</td>
<td bgcolor="$altbg2" class="tablerow"><input type="text" name="newmood" size="25" value="$member[mood]" /></td>
</tr>

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

$moodcolor

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