miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

BB Code for text strike-through?

 
Author Steve Shaw
Partaker
#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="https://www.minibb.com/forums/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
Partaker
#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?
 Share Topic's Link

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


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑