Name: Member Profile BB Code and HTML

Version: 1.6

Last modified: 21/03/2009 @ 13:45 (GMT)

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 v1.9.8 SP3

Tested On: XMB 1.9.8 SP3

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

MOD 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
             V1.6 (21/03/2009 @ 13:45) - Updated for XMB v1.9.8 SP3 by WormHole

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

Note: Backup all affected files, templates & database's.

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

Affected Templates (0): NONE




====================================================================================================
STEP 1: Insert Raw SQL

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




====================================================================================================
STEP 2: Edit File 'cp.php'

Find Code:
----------------------------------------------------------------------------------------------------

        $sightmlon = $sightmloff = '';
        settingHTML('sightml', $sightmlon, $sightmloff);

----------------------------------------------------------------------------------------------------

Add Code Below:
----------------------------------------------------------------------------------------------------

        // Member Profile BB Code and HTML Mod Begin
        $profilesmilieson = $profilesmiliesoff = '';
        settingHTML('profilesmilies', $profilesmilieson, $profilesmiliesoff);

        $profilebbcodeon = $profilebbcodeoff = '';
        settingHTML('profilebbcode', $profilebbcodeon, $profilebbcodeoff);

        $profileimgcodeon = $profileimgcodeoff = '';
        settingHTML('profileimgcode', $profileimgcodeon, $profilebbcodeoff);

        $profilehtmlon = $profilehtmloff = '';
        settingHTML('profilehtml', $profilehtmlon, $profilehtmloff);
        // 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:
----------------------------------------------------------------------------------------------------

        $smileyinsertnew = formOnOff('smileyinsertnew');

----------------------------------------------------------------------------------------------------

Add Code Below:
----------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------


Find Code:
----------------------------------------------------------------------------------------------------

        $db->query("UPDATE ".X_PREFIX."settings SET

----------------------------------------------------------------------------------------------------

Replace Code With:
----------------------------------------------------------------------------------------------------

        $db->query("UPDATE ".X_PREFIX."settings SET
            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['mood'] = stripslashes(postify($member['mood'], 'no', 'no', $SETTINGS['profilesmilies'], $SETTINGS['profilehtml'], $SETTINGS['profilebbcode'], $SETTINGS['profileimgcode'], true, 'yes'));

----------------------------------------------------------------------------------------------------
====================================================================================================




====================================================================================================
STEP 4: Edit File 'member.php'

Find Code:
----------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------

Replace Code With:
----------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------


Find Code:
----------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------

Replace Code With:
----------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------


Find Code: (If you have additional custom fields) (Replacing **** with the custom field name on both occassions)
----------------------------------------------------------------------------------------------------

                $memberinfo['****'] = censor($memberinfo['****']);
                $memberinfo['msn'] = censor($memberinfo['msn']);
                $memberinfo['msnrecode'] = recodeOut($memberinfo['msn']);

(find:

                $memberinfo['msn'] = censor($memberinfo['msn']);
                $memberinfo['msnrecode'] = recodeOut($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 occassions)
----------------------------------------------------------------------------------------------------

            $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:
----------------------------------------------------------------------------------------------------

                $mood = '<strong>'.$lang['mood'].'</strong> '.stripslashes(postify($post['mood'], 'no', 'no', $SETTINGS['profilesmilies'], $SETTINGS['profilehtml'], $SETTINGS['profilebbcode'], $SETTINGS['profileimgcode'], true, 'yes'));

----------------------------------------------------------------------------------------------------
====================================================================================================




====================================================================================================
STEP 6: Edit File 'lang/English.lang.php'

Add To End Of File:
----------------------------------------------------------------------------------------------------

// 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!