BPsite Forums

BPSITE => BPSITE Headquarters => Topic started by: Arkanor on July 01, 2004, 05:14:58 PM



Title: Strikethrough
Post by: Arkanor on July 01, 2004, 05:14:58 PM
SS, there's a strikethrough tag here that I can't find on most other forums.  It's Text here.  It's an interesting tag, and I like the effects, but I can't figure out how to get it on another forum [where I am the root admin].  If you don't mind, what exactly is the code for that?


Title: Strikethrough
Post by: FragMaster1972 on July 01, 2004, 05:31:59 PM
Code:
[s]like this.[/s]

 :)[/s]


Title: Strikethrough
Post by: SS on July 01, 2004, 05:50:26 PM
Frag, I think what he wants is the code to make it work, because strikethrough is something I added to the forum (which is why it aint on the toolbar).

Arkanor: I just found the bit where it does bold/etc, and added an extra line to do strikeout. :)


Title: Strikethrough
Post by: FragMaster1972 on July 01, 2004, 05:51:33 PM
I wondered about that about 5 seconds after I hit the post button. This is why I should be sleeping right now.  ;)


Title: Strikethrough
Post by: RipperRoo on July 01, 2004, 06:00:58 PM
I sorted the thread out, its all strikeouts for you now. :P


Title: Strikethrough
Post by: mole on July 01, 2004, 06:03:21 PM
LOL doppy ...


Title: Strikethrough
Post by: Arkanor on July 01, 2004, 06:13:51 PM
Gee, thanks Ripper

Alright, thanks SS.  That would probably be under board styles or somewhere in there.


Title: Strikethrough
Post by: SS on July 01, 2004, 06:56:49 PM
It's in the actual source code - you need to edit one of the PHP files.

The problem is finding which of the files.

Aha, here it is.
/sources/lib/post_parser.php

Around line 220:
Code:
  	$txt = preg_replace( "#[b](.+?)[/b]#is", "<b></b>", $txt );
   $txt = preg_replace( "#[i](.+?)[/i]#is", "<i></i>", $txt );
   $txt = preg_replace( "#[u](.+?)[/u]#is", "<u></u>", $txt );
   $txt = preg_replace( "#[s](.+?)[/s]#is", "<s></s>", $txt );

Then also at approximately line 450:
Code:
  	$txt = preg_replace( "#<i>(.+?)</i>#is"  , "[i][/i]"  , $txt );
   $txt = preg_replace( "#<b>(.+?)</b>#is"  , "[b][/b]"  , $txt );
   $txt = preg_replace( "#<s>(.+?)</s>#is"  , "[s][/s]"  , $txt );
   $txt = preg_replace( "#<u>(.+?)</u>#is"  , "[u][/u]"  , $txt );

You just need to add the two lines with <s> line in.


There's probably a way to add a button for it too, but I couldn't be bothered looking for that.


Title: Strikethrough
Post by: Arkanor on July 01, 2004, 07:09:48 PM
That's great.  Thanks for the code, and I'll let you know if it works in a second.


Title: Strikethrough
Post by: SS on July 01, 2004, 07:13:50 PM
Ok. Make sure you back up the existing file just incase you break things though. ;)


Title: Strikethrough
Post by: Arkanor on July 01, 2004, 07:17:10 PM
Crap.  Invision (what I'm using for my board) won't let you modify the source code.  In fact, I don't even think they give you the source code.  Oh well.  


Title: Strikethrough
Post by: SS on July 01, 2004, 07:20:31 PM
Ah, you're using the free hosted version aren't you?

Yeah, there's not much you can do there. I suppose you could petition them to add strikeout abilities, pointing out that it's jsut a two line edit, but I dunno if they'd listen or not.