Additional Info
Type
Package ID
JJWyatt:BBCodeBarForSignature
First Created
June 26, 2008, 04:06:19 PM
Last Updated
October 11, 2008, 04:52:12 PM

Signature Area BBCode Buttons v2.0

Adds Signature Area BBCode Buttons
Compatible With 1.1.5, 1.1.6
Latest version v2.0
Downloads 2,437
Reviews 0
Rating 0/5
Subscribers 5
License (View License)
Author(s)
Screenshots


Signature Area BBCode Buttons v1.5
Taken over by JJ Wyatt



Introduction
Adds a row of buttons of some of the most commonly used bbcode above the edit/add signature box in users profile area.

For SMF 1.1.x versions ONLY

Features
o Adds the following BBCode buttons img, url, b, i, u, email, list, pre, center, left, right and more.

Installation
Simply install the package to install on the SMF Default Core / Babylon / Classic Themes AND any other theme which does NOT have a custom Profile.template.php
This mod contains no language strings. It uses ones from smf.

Manual Edit
Themes with a custom Profile.template.php will require the following manual edit.

FIND

echo '
</td>
<td>
<textarea class="editor" onkeyup="calcCharLeft();" name="signature" rows="5" cols="50">', $context['member']['signature'], '</textarea><br />';


REPLACE

echo '
</td>
<td>
<script language="JavaScript" type="text/javascript">
function bbc_highlight(something, mode)
{
something.style.backgroundImage = "url(" + smf_images_url + (mode ? "/bbc/bbc_hoverbg.gif)" : "/bbc/bbc_bg.gif)");
}
</script>';
// load the post variables
loadLanguage('Post');
// The below array makes it dead easy to add images to this page. Add it to the array and everything else is done for you!
$context['bbc_tags'] = array();
$context['bbc_tags'][] = array(
'bold' => array('code' => 'b', 'before' => '[b]', 'after' => '[/b]', 'description' => $txt[253]),
'italicize' => array('code' => 'i', 'before' => '[i]', 'after' => '[/i]', 'description' => $txt[254]),
'underline' => array('code' => 'u', 'before' => '[u]', 'after' => '[/u]', 'description' => $txt[255]),
'strike' => array('code' => 's', 'before' => '[s]', 'after' => '[/s]', 'description' => $txt[441]),
array(),
'pre' => array('code' => 'pre', 'before' => '[pre]', 'after' => '[/pre]', 'description' => $txt[444]),
'left' => array('code' => 'left', 'before' => '[left]', 'after' => '[/left]', 'description' => $txt[445]),
'center' => array('code' => 'center', 'before' => '[center]', 'after' => '[/center]', 'description' => $txt[256]),
'right' => array('code' => 'right', 'before' => '[right]', 'after' => '[/right]', 'description' => $txt[446]),
'img' => array('code' => 'img', 'before' => '[img]', 'after' => '[/img]', 'description' => $txt[435]),
'url' => array('code' => 'url', 'before' => '[url]', 'after' => '[/url]', 'description' => $txt[257]),
'email' => array('code' => 'email', 'before' => '[email]', 'after' => '[/email]', 'description' => $txt[258]),
'size' => array('code' => 'size', 'before' => '[size=10pt]', 'after' => '[/size]', 'description' => $txt[532]),
'face' => array('code' => 'font', 'before' => '[font=Verdana]', 'after' => '[/font]', 'description' => $txt[533]),
'list' => array('code' => 'list', 'before' => '[list]\n[li]', 'after' => '[/li]\n[li][/li]\n[/list]', 'description' => $txt[261]),
'quote' => array('code' => 'quote', 'before' => '[quote]', 'after' => '[/quote]', 'description' => $txt[260]),
'move' => array('code' => 'move', 'before' => '[move]', 'after' => '[/move]', 'description' => $txt[439]),
);
// Here loop through the array, printing the images/rows/separators!
foreach ($context['bbc_tags'][0] as $image => $tag)
{
// Is there a "before" part for this bbc button? If not, it can't be a button!!
if (isset($tag['before']))
{
// Is this tag disabled?
if (!empty($context['disabled_tags'][$tag['code']]))
continue;

// If there's no after, we're just replacing the entire selection in the post box.
if (!isset($tag['after']))
echo '<a href="javascript:void(0);" onclick="replaceText(\'', $tag['before'], '\', document.forms.creator.signature); return false;">';
// On the other hand, if there is one we are surrounding the selection ;).
else
echo '<a href="javascript:void(0);" onclick="surroundText(\'', $tag['before'], '\', \'', $tag['after'], '\', document.forms.creator.signature); return false;">';

// Okay... we have the link. Now for the image and the closing </a>!
echo '<img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="', $settings['images_url'], '/bbc/', $image, '.gif" align="bottom" width="23" height="22" alt="', $tag['description'], '" title="', $tag['description'], '" style="background-image: url(', $settings['images_url'], '/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>';
}
}
echo ' <br/><textarea class="editor" onkeyup="calcCharLeft();" name="signature" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" rows="5" cols="50">', $context['member']['signature'], '</textarea><br />';


Support
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)

Changelog
1.5 - 30th November 2007
o Re-packaged mod
o Improved the readme.

2.0 - 26th June 2008
o Taken over by GamerShare.
o Added new bb codes and removed some unneeded ones.
Manual installation info
You have to register or login to be able to leave a review
There are currently no reviews on this customization
Advertisement: