miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

BB Code for text strike-through?

Author Steve Shaw
Registered
#1 | Posted: 4 Mar 2014 15:57 
Can we have a BB Code button (Like Bold and Italic) that does a text strike through???

Cheers,

Steve
7-DNA

Author Paul
Lead Developer
#2 | Posted: 4 Mar 2014 21:48 
I think it could be done quite easily, replicating existing codes. You will need to draw the button on your own though.

So, for example, take a look in templates/main_post_form.html and replicate the code from let's say the bold tag this way:

<a href="JavaScript:paste_strinL(selektion,3,'[s]','[/s]','')" onmouseover="window.status='{$l_bb_strike}'; return true" onmouseout="window.status=''; return true" onmousemove="pasteSel()"><img src="{$main_url}/img/button_strike.gif" style="width:22px;height:22px" alt="{$l_bb_strike}" title="{$l_bb_strike}" /></a>

Put and translate $l_bb_strike into your language pack (lang/eng.php probably).

Then modify bb_codes.php, replicating for the function enCodeBB:

$pattern[]="/\[[sS]\](.+?)\[\/[sS]\]/s";
$replacement[]='<del>\\1</del>';

and for the function deCodeBB:

$pattern[]="/<del>(.+?)<\/del>/is";
$replacement[]="[s]\\1[/s]";

Don't forget about the button, which should be placed under /img/button_strike.gif.

That would be all...

Author Jaime
Registered
#3 | Posted: 6 Apr 2014 17:54 
Hi Paul, Yes - That would be all! And it does exactly what it should!

Greetings - Jaime

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / BB Code for text strike-through? Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB