Title: Real Name Display v2.0

Author: John Briggs

Updated by: WormHole @ XMB Garage

Added Member List Display by: WormHole @ XMB Garage

Description:
This modification will provide an additional field where members can show their real name in profiles.
This modification will provide an additional field where members can show their real name in the member list.
This modification will provide an additional field where members can show their real name in threads/profiles with an on/off option.

Copyright:  2006 John Briggs. All rights reserved.

Compatability: XMB 1.9.8 SP3

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

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

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

=======================================================================================================================================
=======
Step 1:
=======
==============================
Go To Admin Panel --> Insert Raw SQL
==============================

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

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

loadtemplates(

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

loadtemplates(
'member_profile_realname',

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

            $useoldu2u = formYesNo('useoldu2u');

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

            // Real Name Display Mod Begin
            $showname = formYesNo('showname');
            // Real Name Display Mod End

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

                $sig = postedVar('sig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

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

                // Real Name Display Mod Begin
                $realname = postedVar($realname, '', '', 'javascript', TRUE, TRUE, TRUE);
                // Real Name Display Mod End

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

) VALUES ('$username'

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

, realname, showname) VALUES ('$username'

=========================================
Find Code At End Of Above Query Statement (2 Times):
=========================================

)");

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

, '$realname', '$showname')");

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

                if (X_MEMBER && $memberinfo['email'] != '' && $memberinfo['showemail'] == 'yes') {
                    $email = $memberinfo['email'];
                } else {
                    $email = '';
                }

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

                // Real Name Display Mod Begin
                // create realname block
                $nameblock = '';
                if ($memberinfo['realname'] != '' && $memberinfo['showname'] == 'yes') {
                    $memberinfo['realname'] = censor($memberinfo['realname']);
                    eval('$nameblock = "'.template('member_profile_realname').'";');
                }
                // Real Name Display Mod End

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

        $checked = '';
        if ($member['showemail'] == 'yes') {
            $checked = $cheHTML;
        }

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

        // Real Name Display Mod Begin
        $shownamechecked = '';
        if ($member['showname'] == 'yes') {
            $shownamechecked = $cheHTML;
        }
        // Real Name Display Mod End

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

        $useoldu2u = formYesNo('useoldu2u');

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

        // Real Name Display Mod Begin
        $showname = formYesNo('showname');
        // Real Name Display Mod End

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

        $sig = isset($_POST['newsig']) ? checkInput($_POST['newsig'], '', $SETTINGS['sightml'], '', false) : '';

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

        // Real Name Display Mod Begin
        $newrealname = formVar('newrealname');
        $realname = $newrealname ? checkInput($newrealname, 'no', 'yes', 'javascript', false) : '';
        // Real Name Display Mod End

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

        $sig = addslashes($sig);

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

        // Real Name Display Mod Begin
        $realname = addslashes($realname);
        // Real Name Display Mod End

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

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

========================================
Find Code In-Line At End Of Above Query Statement:
========================================

 WHERE username='$xmbuser'");

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

, realname='$realname', showname='$showname' WHERE username='$xmbuser'");

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

    $checked = '';
    if ($member['showemail'] == 'yes') {
        $checked = $cheHTML;
    }

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

    // Real Name Display Mod Begin
    $shownamechecked = '';
    if ($member['showname'] == 'yes') {
        $shownamechecked = $cheHTML;
    }
    // Real Name Display Mod End

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

    $useoldu2u = formYesNo('useoldu2u');

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

    // Real Name Display Mod Begin
    $showname = formYesNo('showname');
    // Real Name Display Mod End

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

    $sig = isset($_POST['newsig']) ? checkInput($_POST['newsig'], '', $SETTINGS['sightml'], '', false) : '';

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

    // Real Name Display Mod Begin
    $newrealname = formVar('newrealname');
    $realname = $newrealname ? checkInput($newrealname, 'no', 'yes', 'javascript', false) : '';
    // Real Name Display Mod End

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

    $sig = addslashes($sig);

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

    // Real Name Display Mod Begin
    $realname = addslashes($realname);
    // Real Name Display Mod End

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

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

========================================
Find Code In-Line At End Of Above Query Statement:
========================================

 WHERE username='$user'");

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

, realname='$realname', showname='$showname' WHERE uid='".$member['uid']."'");

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

                if (X_MEMBER && $member['email'] != '' && $member['showemail'] == 'yes') {
                    eval('$email = "'.template('misc_mlist_row_email').'";');
                } else {
                    $email = '';
                }

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

                // Real Name Display Mod Begin
                $realname = '';
                if ($member['showname'] == 'yes') {
                    if ($member['realname'] != '') {
                        $member['realname'] = censor($member['realname']);
                        $member['realname'] = stripslashes($member['realname']);
                        $realname = $member['realname'];
                    }
                }
                // Real Name Display Mod End

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

            if ($post['location'] != '') {
                $post['location'] = censor($post['location']);
                $location = '<br />'.$lang['textlocation'].' '.$post['location'];
            } else {
                $location = '';
            }

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

            // Real Name Display Mod Begin
            $realname = '';
            if (!empty($post['realname']) && $self['showname'] == 'yes') {
                if ($post['realname'] != '') {
                    $post['realname'] = censor($post['realname']);
                    $post['realname'] = stripslashes($post['realname']);
                    $realname = '<br /><strong>'.$lang['aka'].'</strong> '.$post['realname'];
                }
            }
            // Real Name Display Mod End

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

            $location = '';
            $mood = '';

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

            // Real Name Display Mod Begin
            $realname = '';
            // Real Name Display Mod End

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

// Real Name Display Mod Begin
$lang['realname'] = "Real Name:";
$lang['showname'] = "Show real name in threads, profiles &amp; member list?";
$lang['aka'] = "a.k.a.:";
// Real Name Display Mod End

=======================================================================================================================================
=======
Step 8:
=======
==========================
Go To Admin Panel --> Templates
==========================
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

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

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

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

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

<input type="checkbox" name="newshowemail" value="yes" $checked /> $lang[textshowemail]<br />

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

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

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

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

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

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

=======================================================================================================================================
========
Step 10:
========
==========================
Go To Admin Panel --> Templates
==========================
=======================
Edit Template: memcp_profile
=======================

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

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

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

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

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

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

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

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

=======================================================================================================================================
========
Step 11:
========
==========================
Go To Admin Panel --> Templates
==========================
===================================
Edit Templates: misc_mlist and misc_mlist_admin
===================================
=================
Find Code (2 Times):
=================

colspan="7"

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

colspan="8"

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


<td width="10%">$lang[textemail]:</td>

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

<td width="10%">$lang[realname]</td>

=======================================================================================================================================
========
Step 12:
========

==========================
Go To Admin Panel--> Templates
==========================
=======================
Edit Template: misc_mlist_row
=======================
================================================================================================
Replace All Code With:
(Be careful as there may be other hacks involved. You will also need to pay attention the $altbg tags and be sure to adjust them accordingly.)
================================================================================================

<tr>
<td bgcolor="$altbg1" class="tablerow"><a href="member.php?action=viewpro&amp;member=$memurl">$member[username]</a>$genderimg</td>
<td bgcolor="$altbg2" class="ctrtablerow">$member[status]</td>
<td bgcolor="$THEME[altbg1]" class="ctrtablerow">$realname</td>
<td bgcolor="$altbg2" class="ctrtablerow">$email</td>
<td bgcolor="$altbg1" class="ctrtablerow">$site</td>
<td bgcolor="$altbg2" class="tablerow">$member[location]</td>
<td bgcolor="$altbg1" class="ctrtablerow">$member[regdate]</td>
<td bgcolor="$altbg2" class="ctrtablerow">$member[postnum]</td>
</tr>

=======================================================================================================================================
========
Step 13:
========
==========================
Go To Admin Panel--> Templates
==========================
===========================================================
Edit Templates: misc_mlist_multipage, misc_mlist_results_none, misc_mlist_separator
===========================================================
==========
Find Code:
==========

colspan="7"
(This number may be different if other hacks have been installed that changed this number)
(If you have the Karma hack installed then you will need to edit the two fields in the Karma Settings instead)

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

colspan="8"

=======================================================================================================================================
========
Step 14:
========
==========================
Go To Admin Panel --> Templates
==========================
========================
Edit Template: viewthread_post
========================
==========
Find Code:
==========

<strong>$post[author]</strong></font>

==============
Add Code After:
==============

$realname

=======================================================================================================================================
========
Step 15:
========
==========================
Go To Admin Panel --> Templates
==========================
=======================
Edit Template: member_profile
=======================

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

<tr class="tablerow">
<td bgcolor="$altbg1">$lang[textregistered]</td>
<td bgcolor="$altbg2">$memberinfo[regdate] ($ppd $lang[textmesperday])</td>
</tr>

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

$nameblock

=======================================================================================================================================
========
Step 16:
========
==========================
Go To Admin Panel --> Templates
==========================
====================================
Create New Template: member_profile_realname
====================================
===========================
Add Code & Click Submit Changes:
===========================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[realname]</td>
<td bgcolor="$THEME[altbg2]">$memberinfo[realname]</td>
</tr>

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