Title: Hide Unused Member Profile Fields v1.0

Author: John Briggs

Description:
This modification will hide any blank fields from the member profile that are not filled in.
This does not take into account any modifications that have been added unless they have already been code as such.

Copyright:  2009 John Briggs. All rights reserved.

Compatability: XMB 1.9.8 SP3

Updated by: WormHole @ XMB Garage

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. A copy is provided with this software package.

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

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

loadtemplates(

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

loadtemplates(
'member_profile_site',
'member_profile_aim',
'member_profile_icq',
'member_profile_yahoo',
'member_profile_msn',
'member_profile_location',
'member_profile_bday',
'member_profile_bio',
'member_profile_mood',
'member_profile_webcam',

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

                if ($memberinfo['site'] != 'http://') {
                    $site = $memberinfo['site'];
                } else {
                    $site = '';
                }

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

                // Hide Unused Member Profile Fields Mod Begin
                // create site block
                $siteblock = '';
                if ($memberinfo['site'] != 'http://') {
                    $site = $memberinfo['site'];
                    eval('$siteblock = "'.template('member_profile_site').'";');
                }
                // Hide Unused Member Profile Fields Mod End

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

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

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

                // Hide Unused Member Profile Fields Mod Begin
                // create email block
                $emailblock = '';
                if (X_MEMBER && $memberinfo['email'] != '' && $memberinfo['showemail'] == 'yes') {
                    $email = $memberinfo['email'];
                    eval('$emailblock = "'.template('member_profile_email').'";');
                }
                // Hide Unused Member Profile Fields Mod End

===================
Find Code & Delete:
===================

                $emailblock = '';
                if ($memberinfo['showemail'] == 'yes') {
                    eval('$emailblock = "'.template('member_profile_email').'";');
                }

===================
Find Code & Delete:
===================

                $memberinfo['bio'] = stripslashes(censor($memberinfo['bio']));
                $memberinfo['bio'] = nl2br($memberinfo['bio']);

===================
Find Code & Delete:
===================

                $memberinfo['location'] = censor($memberinfo['location']);
                $memberinfo['aim'] = censor($memberinfo['aim']);
                $memberinfo['aimrecode'] = recodeOut($memberinfo['aim']);
                $memberinfo['icq'] = ($memberinfo['icq'] > 0) ? $memberinfo['icq'] : '';
                $memberinfo['yahoo'] = censor($memberinfo['yahoo']);
                $memberinfo['yahoorecode'] = recodeOut($memberinfo['yahoo']);
                $memberinfo['msn'] = censor($memberinfo['msn']);
                $memberinfo['msnrecode'] = recodeOut($memberinfo['msn']);

===================
Find Code & Delete:
===================

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

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

                // Hide Unused Member Profile Fields Mod Begin
                // create email block
                $emailblock = '';
                if (X_MEMBER && $memberinfo['email'] != '' && $memberinfo['showemail'] == 'yes') {
                    $email = $memberinfo['email'];
                    eval('$emailblock = "'.template('member_profile_email').'";');
                }
                // Hide Unused Member Profile Fields Mod End

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

                // Hide Unused Member Profile Fields Mod Begin
                // create email block
                $emailblock = '';
                if (X_MEMBER && $memberinfo['email'] != '' && $memberinfo['showemail'] == 'yes') {
                    $email = $memberinfo['email'];
                    eval('$emailblock = "'.template('member_profile_email').'";');
                }

                // create icq block
                $icqblock = '';
                if ($memberinfo['icq'] != '0') {
                    $memberinfo['icq'] = censor($memberinfo['icq']);
                    eval('$icqblock = "'.template('member_profile_icq').'";');
                }

                // create yahoo block
                $yahooblock = '';
                if ($memberinfo['yahoo'] != '') {
                    $memberinfo['yahoo'] = censor($memberinfo['yahoo']);
                    $memberinfo['yahoorecode'] = recodeOut($memberinfo['yahoo']);
                    eval('$yahooblock = "'.template('member_profile_yahoo').'";');
                }

                // create msn block
                $msnblock = '';
                if ($memberinfo['msn'] != '') {
                    $memberinfo['msn'] = censor($memberinfo['msn']);
                    $memberinfo['msnrecode'] = recodeOut($memberinfo['msn']);
                    eval('$msnblock = "'.template('member_profile_msn').'";');
                }

                // create location block
                $locationblock = '';
                if ($memberinfo['location'] != '') {
                    $memberinfo['location'] = censor($memberinfo['location']);
                    eval('$locationblock = "'.template('member_profile_location').'";');
                }

                // create birthday block
                $bdayblock = '';
                if ($memberinfo['bday'] != '0000-00-00') {
                    eval('$bdayblock = "'.template('member_profile_bday').'";');
                }

                // create bio block
                $bioblock = '';
                if ($memberinfo['bio'] != '') {
                    $memberinfo['bio'] = stripslashes(censor($memberinfo['bio']));
                    $memberinfo['bio'] = nl2br($memberinfo['bio']);
                    eval('$bioblock = "'.template('member_profile_bio').'";');
                }

                // create mood block
                $moodblock = '';
                if ($memberinfo['mood'] != '') {
                    $memberinfo['mood'] = censor($memberinfo['mood']);
                    $memberinfo['mood'] = postify($memberinfo['mood'], 'no', 'no', 'yes', 'no', 'yes', 'no', true, 'yes');
                    eval('$moodblock = "'.template('member_profile_mood').'";');
                }
                // Hide Unused Member Profile Fields Mod End

=======================================================================================================================================
=======
Step 2:
=======
===============================
Go To Administration Panel -> Templates
===============================
================================
Create New Template: member_profile_site
================================
=========================
Add Code And Submit Changes:
=========================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textsite]</td>
<td bgcolor="$THEME[altbg2]"><a href="$site" target="_blank">$site</a></td>
</tr>

=======================================================================================================================================
=======
Step 3:
=======
===============================
Go To Administration Panel -> Templates
===============================
================================
Create New Template: member_profile_aim
================================
=========================
Add Code And Submit Changes:
=========================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[textaim]</td>
<td bgcolor="$THEME[altbg2]"><a href="aim:goim?screenname={$memberinfo['aimrecode']}&amp;message=Hi+{$memberinfo['aimrecode']}.+Are+you+there+I+got+your+aim+name+from+a+mess age+board.">{$memberinfo['aim']}</a></td>
</tr>

=======================================================================================================================================
=======
Step 4:
=======
===============================
Go To Administration Panel -> Templates
===============================
================================
Create New Template: member_profile_icq
================================
==============================
Add Code Below And Submit Changes:
==============================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[texticq]</td>
<td bgcolor="$THEME[altbg2]"><a href="http://people.icq.com/people/about_me.php?uin=$memberinfo[icq]" target="_blank">$memberinfo[icq]</a></td>
</tr>

=======================================================================================================================================
=======
Step 5:
=======
===============================
Go To Administration Panel -> Templates
===============================
==================================
Create New Template: member_profile_yahoo
==================================
==============================
Add Code Below And Submit Changes:
==============================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[textyahoo]</td>
<td bgcolor="$THEME[altbg2]"><a href="http://profiles.yahoo.com/{$memberinfo['yahoorecode']}" target="_blank">{$memberinfo['yahoo']}</a></td>
</tr>

=======================================================================================================================================
=======
Step 6:
=======
===============================
Go To Administration Panel -> Templates
===============================
=================================
Create New Template: member_profile_msn
=================================
==============================
Add Code Below And Submit Changes:
==============================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[textmsn]</td>
<td bgcolor="$THEME[altbg2]"><a href="http://members.msn.com/{$memberinfo['msnrecode']}"target="_blank">{$memberinfo['msn']}</a></td>
</tr>

=======================================================================================================================================
=======
Step 7:
=======
===============================
Go To Administration Panel -> Templates
===============================
===================================
Create New Template: member_profile_location
===================================
==============================
Add Code Below And Submit Changes:
==============================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[textlocation]</td>
<td bgcolor="$THEME[altbg2]">$memberinfo[location]</td>
</tr>

=======================================================================================================================================
=======
Step 8:
=======
===============================
Go To Administration Panel -> Templates
===============================
=================================
Create New Template: member_profile_bday
=================================
==============================
Add Code Below And Submit Changes:
==============================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[textbday]</td>
<td bgcolor="$THEME[altbg2]">$memberinfo[bday]</td>
</tr>

=======================================================================================================================================
========
Step 9:
========
===============================
Go To Administration Panel -> Templates
===============================
================================
Create New Template: member_profile_bio
================================
==============================
Add Code Below And Submit Changes:
==============================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" valign="top">$lang[textbio]</td>
<td bgcolor="$THEME[altbg2]">$memberinfo[bio]</td>
</tr>

=======================================================================================================================================
========
Step 10:
========
===============================
Go To Administration Panel -> Templates
===============================
==================================
Create New Template: member_profile_mood
==================================
==============================
Add Code Below And Submit Changes:
==============================

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

=======================================================================================================================================
========
Step 11:
========
===============================
Go To Administration Panel -> Templates
===============================
============================
Edit Template: member_profile_email
============================
===================
Replace All Code With:
===================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[textemail]</td>
<td bgcolor="$THEME[altbg2]"><a href="mailto:$email">$email</a></td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[textsite]</td>
<td bgcolor="$altbg2"><a href="$site" target="_blank">$site</a></td>
</tr>

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

$siteblock

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

<tr class="tablerow">
<td bgcolor="$altbg1">$lang[textaim]</td>
<td bgcolor="$altbg2"><a href="aim:goim?screenname={$memberinfo['aimrecode']}&amp;message=Hi+{$memberinfo['aimrecode']}.+Are+you+there+I+got+your+aim+name+from+a+mess age+board.">{$memberinfo['aim']}</a></td>
</tr>

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

$aimblock

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

<tr class="tablerow">
<td bgcolor="$altbg1">$lang[texticq]</td>
<td bgcolor="$altbg2"><a href="http://people.icq.com/people/about_me.php?uin=$memberinfo[icq]" target="_blank">$memberinfo[icq]</a></td>
</tr>

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

$icqblock

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

<tr class="tablerow">
<td bgcolor="$altbg1">$lang[textyahoo]</td>
<td bgcolor="$altbg2"><a href="http://profiles.yahoo.com/{$memberinfo['yahoorecode']}" target="_blank">{$memberinfo['yahoo']}</a></td>
</tr>

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

$yahooblock

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

<tr class="tablerow">
<td bgcolor="$altbg1">$lang[textmsn]</td>
<td bgcolor="$altbg2"><a href="http://members.msn.com/{$memberinfo['msnrecode']}"target="_blank">{$memberinfo['msn']}</a></td>
</tr>

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

$msnblock

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

<tr class="tablerow">
<td bgcolor="$altbg1">$lang[textlocation]</td>
<td bgcolor="$altbg2">$memberinfo[location]</td>
</tr>

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

$locationblock

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

<tr class="tablerow">
<td bgcolor="$altbg1">$lang[textbday]</td>
<td bgcolor="$altbg2">$memberinfo[bday]</td>
</tr>

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

$bdayblock

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

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

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

$bioblock

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

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

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

$moodblock

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