Title: View Avatars In Threads Option v1.0

Author: John Briggs

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

Copyright:  2006 John Briggs. All rights reserved.

Compatability: XMB 1.9.5 Final

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

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

Author Note:
You downloaded this hack from XMBMods.com, the #1 source for XMB related downloads.
Please visit http://www.xmbmods.com/ for support.

=======================================================================================================================================
=======
Step 1:
=======

===========================================
Go To Administration Panel-->Insert Raw SQL
===========================================

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

=======================================================================================================================================
=======
Step 2:
=======

==========================
Edit File: editprofile.php
==========================

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

    $eouchecked = '';
    if ( $member['emailonu2u'] == 'yes' )
    {
        $eouchecked = $cheHTML;
    }

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

    $viewavatarschecked = '';
    if ($member['viewavatars'] == 'yes') {
        $viewavatarschecked = $cheHTML;
    }

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

    $useoldu2u     = ( isset($useoldu2u) && $useoldu2u == 'yes' ) ? 'yes' : 'no';

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

    $viewavatars = (isset($viewavatars) && $viewavatars == 'yes') ? 'yes' : 'no';

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

    $db->query("UPDATE $table_members SET email='$email',

====================================
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 = "checked=\"checked\"";
        }

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

        $viewavatarschecked = '';
        if ($member['viewavatars'] == 'yes') {
            $viewavatarschecked = 'checked="checked"';
        }

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

        $useoldu2u      = ( isset($useoldu2u) && $useoldu2u == "yes" ) ? "yes" : "no";

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

        $viewavatars   = (isset($viewavatars) && $viewavatars == 'yes') ? 'yes' : 'no';

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

        $db->query("UPDATE $table_members SET $pwtxt email='$email',

====================================
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     = (isset($useoldu2u) && $useoldu2u == 'yes') ? 'yes' : 'no';

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

        $viewavatars = (isset($viewavatars) && $viewavatars == 'yes') ? 'yes' : 'no';

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

        $db->query("INSERT INTO $table_members (uid,

=====================================
Find Code In-Line In Above Statement:
=====================================

) VALUES ('', '$username',

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

, viewavatars) VALUES ('', '$username',

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

)");

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

, '$viewavatars')");

=======================================================================================================================================
=======
Step 5:
=======

=========================
Edit File: viewthread.php
=========================

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

            if ($SETTINGS['avastatus'] == 'on' || $SETTINGS['avastatus'] == 'list') {
                if ($post['avatar'] != '' && $allowavatars != "no") {
                    if (false !== ($pos = strpos($post['avatar'], ',')) && substr($post['avatar'], $pos-4, 4) == '.swf') {
                        $flashavatar = explode(",",$post['avatar']);
                        $avatar = '<object type="application/x-shockwave-flash" data="'.$flashavatar[0].'" width="'.$flashavatar[1].'" height="'.$flashavatar[2].'"><param name="movie" value="'.$flashavatar[0].'" AllowScriptAccess="never" /></object>';
                    } else {
                        $avatar = '<img src="'.$post['avatar'].'" alt="'.$lang['altavatar'].'"/>';
                    }
                }
            }

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

            if (isset($self['viewavatars']) && $self['viewavatars'] == 'yes') {
                if ($SETTINGS['avastatus'] == 'on' || $SETTINGS['avastatus'] == 'list') {
                    if ($post['avatar'] != '' && $allowavatars != 'no') {
                        if (false !== ($pos = strpos($post['avatar'], ',')) && substr($post['avatar'], $pos-4, 4) == '.swf') {
                            $flashavatar = explode(',', $post['avatar']);
                            $avatar = '<object type="application/x-shockwave-flash" data="'.$flashavatar[0].'" width="'.$flashavatar[1].'" height="'.$flashavatar[2].'"><param name="movie" value="'.$flashavatar[0].'" AllowScriptAccess="never" /></object>';
                        } else {
                            $avatar = '<img src="'.$post['avatar'].'" alt="'.$lang['altavatar'].'" border="0" />';
                        }
                    }
                }
            }

=======================================================================================================================================
=======
Step 6:
=======

================================
Edit File: lang/English.lang.php
================================

================================
Add Code At Very Bottom Of File:
================================

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

=======================================================================================================================================
=======
Step 7:
=======

=======================================================
Go to admin panel -> templates -> 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" $viewavatarschecked /> $lang[viewavatars]<br />

=======================================================================================================================================
=======
Step 8:
=======

============================================
Go to admin panel -> templates -> member_reg
============================================

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

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

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

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

=======================================================================================================================================
=======
Step 9:
=======

===============================================
Go to admin panel -> templates -> memcp_profile
===============================================

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

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

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

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

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