============================================================================================================================
Modification Title: Real Name

Version: 2.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:  2010 John Briggs. All Rights Reserved.

Compatability: XMB 1.9.5 SP1

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

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

        // Real Name Mod Begin
        $showname = (isset($showname) && strtolower($showname) == 'yes') ? 'yes' : 'no';
        // Real Name Mod End

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

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

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

        // Real Name Mod Begin
        $realname = isset($realname) ? checkInput($realname, '', '', 'javascript', false) : '';
        // Real Name Mod End

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

        $sig           = addslashes($sig);

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

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

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

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

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

) VALUES ('', '$username',

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

, realname, showname) VALUES ('', '$username',

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

)");

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

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

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

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

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

            // Real Name 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 Mod End

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

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

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

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

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

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

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

        // Real Name Mod Begin
        $showname = (isset($showname) && strtolower($showname) == 'yes') ? 'yes' : 'no';
        // Real Name Mod End

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

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

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

        // Real Name Mod Begin
        $realname = isset($realname) ? checkInput($realname, '', '', 'javascript', false) : '';
        // Real Name Mod End

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

        $sig            = addslashes($sig);

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

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

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

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

========================================
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 Below:
===============

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

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

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

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

    // Real Name Mod Begin
    $showname = (isset($showname) && strtolower($showname) == 'yes') ? 'yes' : 'no';
    // Real Name Mod End

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

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

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

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

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

    $sig            = addslashes($sig);

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

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

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

$db->query("UPDATE $table_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 Below:
===============

                // Real Name 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 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 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['realname'].'</strong> '.$post['realname'];
                }
            }
            // Real Name Mod End

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

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

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

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

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

// Real Name Mod Begin
$lang['realname'] = "Real Name:";
$lang['showname'] = "Show Real Name in Threads, Profiles &amp; Member List?";
// Real Name Mod End

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

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

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

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[realname]</td>
<td bgcolor="$altbg2"><input type="text" name="realname" 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 Administration Panel --> Templates
===============================
=====================
Edit Template: member_reg
=====================
==========
Find Code:
==========

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

============================================================================================================================
========
Step 11:
========
===============================
Go To Administration Panel --> Templates
===============================
===================================
Edit Templates: misc_mlist and misc_mlist_admin
===================================
==========
Find Code:
==========

<td width="10%" class="header" align="center">$lang[textemail]:</td>

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

<td width="10%" class="header" align="center">$lang[realname]</td>

============================================================================================================================
========
Step 12:
========
===============================
Go To Administration Panel --> Templates
===============================
=======================
Edit Template: misc_mlist_row
=======================
================
Replace Code With:
(Be careful as this may be different due to other modifications)
================

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

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

colspan="8"

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

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

colspan="9"

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

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

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

$realname

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

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

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

$nameblock

============================================================================================================================
========
Step 16:
========
===============================
Go To Administration Panel --> Templates
===============================
====================================
Create New Template: member_profile_realname
====================================
========================
Add Code and Submit Changes:
========================

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

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