============================================================================================================================
Modification Title: Hide Unused Profile Fields

Version: 1.0

Author: John Briggs

Description:
This modification will hide any default blank fields from the members profiles that are not filled in.

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 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 Profile Fields Mod Begin
            // create site block
            $siteblock = '';
            if ($memberinfo['site'] != 'http://') {
                $site = $memberinfo['site'];
                eval('$siteblock = "'.template('member_profile_site').'";');
            }
            // Hide Unused Profile Fields Mod End

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

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

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

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

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

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

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

            // Hide Unused 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 Profile Fields Mod End

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

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

=================
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['icq'] = censor($memberinfo['icq']);
            $memberinfo['yahoo'] = censor($memberinfo['yahoo']);
            $memberinfo['msn'] = censor($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'] = '&nbsp;';
            }

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

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

            // Hide Unused 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 Profile Fields Mod End

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

            // Hide Unused Profile Fields Mod Begin
            // create webcam block
            $webcamblock = '';
            if ($memberinfo['webcam'] != 'http://') {
                $webcam = $memberinfo['webcam'];
                eval('$webcamblock = "'.template('member_profile_webcam').'";');
            }

            // create email block
            $emailblock = '';
            if (X_MEMBER && $memberinfo['email'] != '' && $memberinfo['showemail'] == 'yes') {
                $email = $memberinfo['email'];
                eval('$emailblock = "'.template('member_profile_email').'";');
            }

            // create aim block
            $aimblock = '';
            if ($memberinfo['aim'] != '') {
                $memberinfo['aim'] = censor($memberinfo['aim']);
                eval('$aimblock = "'.template('member_profile_aim').'";');
            }

            // 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']);
                eval('$yahooblock = "'.template('member_profile_yahoo').'";');
            }

            // create msn block
            $msnblock = '';
            if ($memberinfo['msn'] != '') {
                $memberinfo['msn'] = censor($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 biography 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 Profile Fields Mod End

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

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

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

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

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

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

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

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[texticq]</td>
<td bgcolor="$altbg2"><a href="http://web.icq.com/whitepages/about_me/1,,,00.html?Uin=$memberinfo[icq]" target="_blank">$memberinfo[icq]</a></td>
</tr>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

$siteblock

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

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

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

$webcamblock

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

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

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

$aimblock

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

<tr>
<td bgcolor="$altbg1" class="tablerow">$lang[texticq]</td>
<td bgcolor="$altbg2" class="tablerow"><a href="http://web.icq.com/whitepages/about_me/1,,,00.html?Uin=$memberinfo[icq]" target="_blank">$memberinfo[icq]</a></td>
</tr>

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

$icqblock

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

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

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

$yahooblock

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

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

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

$msnblock

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

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

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

$locationblock

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

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

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

$bdayblock

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

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

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

$bioblock

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

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

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

$moodblock

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