We all love php code so I thought I would try and add an option in the commenting system so you can post php code without any problems.
Let's just say it was a bitch to code!
I also included some basic bb code. I started with the basic bb code. To include the php highlighting it made the code three times the size!! argh and it only works once per post. Oh well. It's better than nothing.
You better post heaps of php code now ;)
Okay php formatting should work here now too:
[code]function bbcode($content) {
$text = $content;
$text = htmlentities($text);
$search = array ("", "", "", "", "[u]", "[/u]", "™");
$replace = array ("", "", "", "", "", "", "");
$text = str_replace($search, $replace, $text);
return $text;
} [/code]
Ok strange sometimes the colours don't show up!:S
Okay. Done some searching highlight_string() is buggy ;) So it isn't my code.
http://bugs.php.net/bug.php?id=27901
riight is it meant to work? Because it doesnt (at the moment)
aah it does now. weird.
aah it does now. weird.
Found a semi-bug in your comment system. if you refresh the page after posting it will re-post your message. This is not good because refreshing a page and waiting for more ppl to post is an integral component to online messaging.
its not really a bug, you are resending the post information. The same thing happens on other forums. Instead of pressing F5, just click on the url in the link bar and press enter. Although I will look into fixing this. I have an idea.
Yeah okay I'd call it a bug. Now fixed.
Right an example!
my old BB old
[code]function bbcode($content) {
$text = $content;
$text = htmlentities($text);
$search = array ("", "", "", "", "[u]", "[/u]", "™");
$replace = array ("", "", "", "", "", "", "™");
$text = str_replace($search, $replace, $text);
return $text;
} [/code]