Signature Area BBCode Buttons

Started by Free Town, June 27, 2008, 09:11:27 AM

Previous topic - Next topic

Free Town

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.

danfaz


b33z

sweet mod! thanks! just one thing, i want more!..buttons that is.. i use a lot more bbcode buttons on my site and would like to know how use them with this mod...make sense? hehe....

thanks again! nice mod!

Rocks-HD

#3
this package work very well in my SMF 2.0 Beta 3.1 Public

Thanks!

AlenNS


ddarrell

Thanks, works fine, but since its geared for folks that cant pull bbs from memory, would have liked to see a color button.

darrell

i know just enough to really screw up ;D

Free Town

Quote from: ddarrell on August 21, 2008, 09:50:04 PM
Thanks, works fine, but since its geared for folks that cant pull bbs from memory, would have liked to see a color button.

darrell



Ok, ill fit that in when i get time :)

Wasabite

I suppose that it's compatible with this mod?
http://custom.simplemachines.org/mods/index.php?mod=449
I mean, they won't be parsed if the user does not have the required permissions?

Sabre™

Any chance of implementing the smileys into this also?
It'd be good to have it under the comment box, where Ive shown in the image.

Right click and select view for larger image

I've tried this numerous ways, but have had no success.
Any assistance would be greatly appreciated :)
Cheers.
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


brandonroy

I need this mod but....

I installed it successfully but when I try to apply the mod I get sent to a "Error 500 - Internal server error. An internal server error has occured!
Please try again later." page.

Whats the problem?

Sabre™

Refer to [THIS]
It will help someone to help you.

The mod author doesnt reply, so I and any other will try to assist you.

Cheers
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


brandonroy

Quote from: Sabre™ on November 27, 2008, 05:48:27 PM
Refer to [THIS]
It will help someone to help you.

The mod author doesnt reply, so I and any other will try to assist you.

Cheers

Okay?
I'm using smf 1.1.7 and this is the only mod I've ever tried to install that gives a 500 internal server error when I try to apply it. What would be the reason for this?

brandonroy

Anybody?

Mod still gives a 500 internal server error when I try to apply it. And I really like this mod as it would be quite useful for members who don't know how to use BBcode by memory for their signatures.


miaz


Garou

brandonroy, I don't know what to tell you. I just installed this mod on two different servers, one windows and one Linux. The mod installed just fine on both.

A 500 error is so broad the problem could be anything. Have you checked your log to see if there are any other errors that show up when you try to install? Have you tried to install the mod manually? Are you able to install any other mods after trying to install this one and not receive the error? Im thinking the problem is on the server and not the mod.

brandonroy

Quote from: Garou on December 03, 2008, 09:39:37 PM
brandonroy, I don't know what to tell you. I just installed this mod on two different servers, one windows and one Linux. The mod installed just fine on both.

A 500 error is so broad the problem could be anything. Have you checked your log to see if there are any other errors that show up when you try to install? Have you tried to install the mod manually? Are you able to install any other mods after trying to install this one and not receive the error? Im thinking the problem is on the server and not the mod.

Ah thanks for mentioning that. I didn't even think to just manually do the mod by editing the profile.template.php file. I just did that and it looks good. Works great.

As for the 500 error... I have no idea. It's never happened with any other mods (before AND after trying to apply this mod) I've installed and applied new mods since trying this one, and they work fine. So idk! Everything's good for now though. Thanks :]

Garou

Glad it worked for you.

Its such an odd issue that installing any mod would cause a 500 error but if all works fine for you Ill let it go at that.  :)

mirakhu


sheryltoo

Any chance of making this a WYSIWYG editor for RC1?
Sheryl

fals







500fan.dk - SMF 2.0 ~ custom theme
ls-forum.dk - SMF 2.0.2 ~ custom theme and custom iPhone theme

Advertisement: