Title: View Avatars In Threads Option v1.0

Author: John Briggs

Description:
This modification will provide an option in the member control panel for members to choose to view avatars in threads or not.

Copyright:  2009 John Briggs. All rights reserved.

Compatability: XMB 1.9.11

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

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

=======================================================================================================================================
=======
Step 1:
=======
==============================
Go To Admin Panel -> Insert Raw SQL
==============================
===============================================
Copy & Paste Code Below & Click The "Submit Changes" Button
===============================================

ALTER TABLE `$table_members` ADD `viewavatars` set('yes','no') NOT NULL default 'yes';

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

    $invchecked = '';
    if ($member['invisible'] == 1) {
        $invchecked = $cheHTML;
    }

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

    // View Avatars In Threads Option Mod Begin
    $viewavchecked = '';
    if ($member['viewavatars'] == 'yes') {
        $viewavchecked = $cheHTML;
    }
    // View Avatars In Threads Option Mod End

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

    $newsletter = formYesNo('newnewsletter');

===============
Add Code Below:
===============
    // View Avatars In Threads Option Mod Begin
    $viewavatars = formYesNo('viewavatars');
    // View Avatars In Threads Option Mod End

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

    $db->query("UPDATE ".X_PREFIX."members SET status='$status',

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

 WHERE username='$user'");

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

, viewavatars='$viewavatars' WHERE username='$user'");

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

        $invchecked = '';
        if ($member['invisible'] == 1) {
            $invchecked = $cheHTML;
        }

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

        // View Avatars In Threads Option Mod Begin
        $viewavchecked = '';
        if ($member['viewavatars'] == 'yes') {
            $viewavchecked = $cheHTML;
        }
        // View Avatars In Threads Option Mod End

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

        $newsletter = formYesNo('newnewsletter');

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

        // View Avatars In Threads Option Mod Begin
        $viewavatars = formYesNo('viewavatars');
        // View Avatars In Threads Option Mod End

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

        $db->query("UPDATE ".X_PREFIX."members SET $pwtxt

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

 WHERE username='$xmbuser'");

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

, viewavatars='$viewavatars' WHERE username='$xmbuser'");

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

            $useoldu2u = formYesNo('useoldu2u');

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

            // View Avatars In Threads Option Mod Begin
            $viewavatars = formYesNo('viewavatars');
            // View Avatars In Threads Option Mod End

=================
Find Code (2 Times):
=================

$db->query("INSERT INTO ".X_PREFIX."members (username

=====================================
Find Code In-Line In Above Statements (2 Times):
=====================================

) VALUES ('$username',

=======================
Replace Code With (2 Times):
=======================

, viewavatars) VALUES ('$username',

===================================
Find Code At End Of Above Query Statements:
===================================

)");

=======================
Replace Code With (2 Times):
=======================

, '$viewavatars')");

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

            $avatar = '';
            if ($SETTINGS['avastatus'] == 'on' || $SETTINGS['avastatus'] == 'list') {
                if ($post['avatar'] != '' && $allowavatars != "no") {
                    $avatar = '<img src="'.$post['avatar'].'" alt="'.$lang['altavatar'].'" border="0" />';
                }
            }

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

            // View Avatars In Threads Option Mod Begin
            $avatar = '';
            if ($SETTINGS['avastatus'] == 'on' || $SETTINGS['avastatus'] == 'list') {
                if (isset($self['viewavatars']) && $self['viewavatars'] == 'yes') {
                // View Avatars In Threads Option Mod End
                    if ($post['avatar'] != '' && $allowavatars != "no") {
                        $avatar = '<img src="'.$post['avatar'].'" alt="'.$lang['altavatar'].'" border="0" />';
                    }
                }
            }
            // View Avatars In Threads Option Mod End

=======================================================================================================================================
=======
Step 6:
=======
==============================================
Go To Admin Panel -> Translations & Download Language File:
==============================================
===============
Edit Language File:
===============
============================
Add Code To End Of File Above ?>
============================

// View Avatars In Threads Option Mod Begin
$lang['viewavatars'] = "View avatars in threads?";
// View Avatars In Threads Option Mod End

============================================
Go To Admin Panel -> Translations & Upload Language File:
============================================
=======================================================================================================================================
=======
Step 7:
=======
=========================
Go To Admin Panel -> Templates
=========================
===========================
Edit Template: admintool_editprofile
===========================

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

<input type="checkbox" name="emailonu2u" value="yes" $eouchecked /> $lang[textemailonu2u]<br />

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

<input type="checkbox" name="viewavatars" value="yes" $viewavchecked /> $lang[viewavatars]<br />

=======================================================================================================================================
=======
Step 8:
=======
=========================
Go To Admin Panel -> Templates
=========================
=====================
Edit Template: member_reg
=====================

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

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[textemailonu2u]</td>
<td bgcolor="$altbg2"><input type="checkbox" name="emailonu2u" value="yes" /></td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[viewavatars]</td>
<td bgcolor="$THEME[altbg2]"><input type="checkbox" name="viewavatars" value="yes" checked="checked" /></td>
</tr>

=======================================================================================================================================
=======
Step 9:
=======
=========================
Go To Admin Panel -> Templates
=========================
=======================
Edit Template: memcp_profile
=======================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[textemailonu2u]</td>
<td bgcolor="$altbg2"><input type="checkbox" name="emailonu2u" value="yes" $eouchecked /></td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[viewavatars]</td>
<td bgcolor="$THEME[altbg2]"><input type="checkbox" name="viewavatars" value="yes" $viewavchecked /></td>
</tr>

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