============================================================================================================================
Modification Name: Member Profile BB Code and HTML

Version: 1.6

Last modified: 04/13/2010

Description:
This modification will enable members to use Smilies, BB Code and HTML in their member profile.
This modification has an option in the admin panel to enable/disable Smilies in profiles.
This modification has an option in the admin panel to enable/disable BB Code in profiles.
This modification has an option in the admin panel to enable/disable BB Image Code in profiles.
This modification has an option in the admin panel to enable/disable HTML in profiles.

Compatibility: XMB 1.9.5 SP1

Code Developed By: Adam Clarke (http://www.scriptdesign.co.uk & http://www.adam-clarke.co.uk)

History: V1.0 (06/08/2005 @ 02:05) - Initial Release.
             V1.1 (06/08/2005 @ 02:20) - Added code for the mood in member control panel home view.
             V1.2 (06/08/2005 @ 02:30) - Added code for the mood in posts.
             V1.3 (06/08/2005 @ 02:45) - Repaired code for the mood in posts and added instructions for custom fields.
             V1.4 (06/08/2005 @ 23:10) - Added option to enable/disable BB Image Code.
             V1.5 (07/08/2005 @ 01:10) - Repaired BB Image Code section of update query.
             V1.6 (30/04/2006 @ 05:32) - Updated for XMB v1.9.5 by WormHole

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

Note: Backup all affected files, templates & databases.

Affected Files (5): cp.php, memcp.php, member.php, viewthread.php, English.lang.php

Affected Templates (0): NONE

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:
=======
===================================
Go To Adminstration Panel --> Insert Raw SQL
===================================

Upload provided file named "SQL.txt" and click Submit Changes.

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

        $sightmlon = $sightmloff = '';
        if ($SETTINGS['sightml'] == "on") {
            $sightmlon = $selHTML;
        } else {
            $sightmloff = $selHTML;
        }

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

        // Member Profile BB Code and HTML Mod Begin
        $profilesmilieson = $profilesmiliesoff = '';
        switch ($SETTINGS['profilesmilies']) {
            case 'on':
                $profilesmilieson = $selHTML;
                break;
            default:
                $profilesmiliesoff = $selHTML;
                break;
        }

        $profilebbcodeon = $profilebbcodeoff = '';
        switch ($SETTINGS['profilebbcode']) {
            case 'on':
                $profilebbcodeon = $selHTML;
                break;
            default:
                $profilebbcodeoff = $selHTML;
                break;
        }

        $profileimgcodeon = $profileimgcodeoff = '';
        switch ($SETTINGS['profileimgcode']) {
            case 'on':
                $profileimgcodeon = $selHTML;
                break;
            default:
                $profileimgcodeoff = $selHTML;
                break;
        }

        $profilehtmlon = $profilehtmloff = '';
        switch ($SETTINGS['profilehtml']) {
            case 'on':
                $profilehtmlon = $selHTML;
                break;
            default:
                $profilehtmloff = $selHTML;
                break;
        }
        // Member Profile BB Code and HTML Mod End

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

        printsetting1($lang['sightml'], 'sightmlnew', $sightmlon, $sightmloff);

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

        // Member Profile BB Code and HTML Mod Begin
        printsetting1($lang['profilesmilies'], 'profilesmiliesnew', $profilesmilieson, $profilesmiliesoff);
        printsetting1($lang['profilebbcode'], 'profilebbcodenew', $profilebbcodeon, $profilebbcodeoff);
        printsetting1($lang['profileimgcode'], 'profileimgcodenew', $profileimgcodeon, $profileimgcodeoff);
        printsetting1($lang['profilehtml'], 'profilehtmlnew', $profilehtmlon, $profilehtmloff);
        // Member Profile BB Code and HTML Mod End

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

        $resetSigNew = ($resetSigNew == 'on') ? 'on' : 'off';

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

        // Member Profile BB Code and HTML Mod Begin
        $profilesmiliesnew = ($profilesmiliesnew == 'on') ? 'on' : 'off';
        $profilebbcodenew = ($profilebbcodenew == 'on') ? 'on' : 'off';
        $profileimgcodenew = ($profileimgcodenew == 'on') ? 'on' : 'off';
        $profilehtmlnew = ($profilehtmlnew == 'on') ? 'on' : 'off';
        // Member Profile BB Code and HTML Mod End

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

$db->query("UPDATE $table_settings SET

==============================
Add To End Of Statement BEFORE  ");
==============================

, profilesmilies='$profilesmiliesnew', profilebbcode='$profilebbcodenew', profileimgcode='$profileimgcodenew', profilehtml='$profilehtmlnew'

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

        $member['mood'] = censor($member['mood']);
        $member['mood'] = postify($member['mood'], 'no', 'no', 'yes', 'no', 'yes', 'no', true, 'yes');

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

        // Member Profile BB Code and HTML Mod Begin
        $member['mood'] = stripslashes(postify($member['mood'], 'no', 'no', $SETTINGS['profilesmilies'], $SETTINGS['profilehtml'], $SETTINGS['profilebbcode'], $SETTINGS['profileimgcode'], true, 'yes'));
        // Member Profile BB Code and HTML Mod End

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

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

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

            // Member Profile BB Code and HTML Mod Begin
            $memberinfo['bio'] = stripslashes(postify($memberinfo['bio'], 'no', 'no', $SETTINGS['profilesmilies'], $SETTINGS['profilehtml'], $SETTINGS['profilebbcode'], $SETTINGS['profileimgcode'], true, 'yes'));
            // Member Profile BB Code and HTML Mod End

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

                $memberinfo['mood'] = censor($memberinfo['mood']);
                $memberinfo['mood'] = postify($memberinfo['mood'], 'no', 'no', 'yes', 'no', 'yes', 'no', true, 'yes');

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

                // Member Profile BB Code and HTML Mod Begin
                $memberinfo['mood'] = stripslashes(postify($memberinfo['mood'], 'no', 'no', $SETTINGS['profilesmilies'], $SETTINGS['profilehtml'], $SETTINGS['profilebbcode'], $SETTINGS['profileimgcode'], true, 'yes'));
                // Member Profile BB Code and HTML Mod End

===========
Find Code: (If you have additional custom fields) (Replacing **** with the custom field name on both occasions) (You can ignore this step if you have the Hide Member Profile Fields installed)
===========

            $memberinfo['****'] = censor($memberinfo['****']);

(find  $memberinfo['msn'] = censor($memberinfo['msn']); to locate where the custom fields would be installed)
example custom field: $memberinfo['favband'] = censor($memberinfo['favband']);

================
Replace Code With: (If you have additional custom fields) (Replacing **** with the custom field name on both occasions) (You can ignore this step if you have the Hide Member Profile Fields installed)
================

            $memberinfo['****'] = stripslashes(postify($memberinfo['****'], 'no', 'no', $SETTINGS['profilesmilies'], $SETTINGS['profilehtml'], $SETTINGS['profilebbcode'], $SETTINGS['profileimgcode'], true, 'yes'));

(example for custom field: $memberinfo['favband'] = stripslashes(postify($memberinfo['favband'], 'no', 'no', $SETTINGS['profilesmilies'], $SETTINGS['profilehtml'], $SETTINGS['profilebbcode'], $SETTINGS['profileimgcode'], true, 'yes')); )

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

                $post['mood'] = censor($post['mood']);
                $mood = '<strong>'.$lang['mood'].'</strong> '.postify($post['mood'], 'no', 'no', 'yes', 'no', 'yes', 'no', true, 'yes');

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

                // Member Profile BB Code and HTML Mod Begin
                $mood = '<strong>'.$lang['mood'].'</strong> '.stripslashes(postify($post['mood'], 'no', 'no', $SETTINGS['profilesmilies'], $SETTINGS['profilehtml'], $SETTINGS['profilebbcode'], $SETTINGS['profileimgcode'], true, 'yes'));
                // Member Profile BB Code and HTML Mod End

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

// Member Profile BB Code and HTML Mod Begin
$lang['profilesmilies'] = 'Smilies in Member Profiles:';
$lang['profilebbcode'] = 'BB Code in Member Profiles:';
$lang['profileimgcode'] = 'BB Image Code in Member Profiles:';
$lang['profilehtml'] = 'HTML in Member Profiles:';
// Member Profile BB Code and HTML Mod End

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