Title: Control Panel Signature BBCode v1.0

Author: John Briggs

Description:
This modification will add BB Code buttons to your member control panel for more ease when using BB Code in signatures.

Copyright:  2009 John Briggs. All rights reserved.

Compatability: XMB 1.9.8 SP3

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: memcp.php
=================
==========
Find Code:
==========

loadtemplates(

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

loadtemplates(
'functions_bbcodeinsert',
'functions_bbcode',

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

if (X_GUEST) {
    redirect('misc.php?action=login', 0);
    exit();
}

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

// Control Panel Signature BBCode Mod Begin
/**
* bbcodeinsert() - return $bbcode populated with bbcode JS functions
*
* Returns $bbcode populated with bbcode JS functions if the feature is on
*
* @return   the required bbcode or a blank string if $bbinsert setting is not "on"
*/
function bbcodeinsert() {
    global $imgdir, $bbinsert, $altbg1, $altbg2, $lang, $SETTINGS, $spelling_lang;

    $bbcode = '';
    if ($bbinsert == 'on') {
        eval('$bbcode = "'.template('functions_bbcodeinsert').'";');
    }
    return $bbcode;
}
// Control Panel Signature BBCode Mod End

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

if ($action == 'profile') {

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

    // Control Panel Signature BBCode Mod Begin
    $bbcodeinsert = bbcodeinsert();
    eval('$bbcodescript = "'.template('functions_bbcode').'";');
    // Control Panel Signature BBCode Mod End

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

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[textsig]<br /><span class="smalltxt">$lang[texthtmlis] $htmlis<br />$lang[textbbcodeis] $bbcodeis</span></td>
<td bgcolor="$altbg2"><textarea rows="5" cols="45" name="newsig">$member[sig]</textarea></td>
</tr>

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

$bbcodeinsert
<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textsig]<br /><span class="smalltxt">$lang[texthtmlis] $htmlis<br />$lang[textbbcodeis] $bbcodeis</span></td>
<td bgcolor="$THEME[altbg2]"><textarea rows="6" cols="55" name="newsig" id="message" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">$member[sig]</textarea></td>
</tr>

=======================================================================================================================================