Bluetrait

Loading
search


Posts:
Comments:

Popular posts

Click here if you are looking for Bluetrait, the weblog software.

Login:

Username:

Password:

PHP code

Posted by Michael Dale on Sun, 11 Jul 2004 12:19 PM

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]

On Sun, 11 Jul 2004 at 12:19 PM, Michael Dale wrote:

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]


On Sun, 11 Jul 2004 at 2:22 PM, Michael Dale wrote:

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


On Sun, 11 Jul 2004 at 4:18 PM, ucosty wrote:

riight is it meant to work? Because it doesnt (at the moment)


On Sun, 11 Jul 2004 at 4:18 PM, same guy as the poster above wrote:

aah it does now. weird.


On Sun, 11 Jul 2004 at 4:19 PM, same guy as the poster above wrote:

aah it does now. weird.


On Sun, 11 Jul 2004 at 4:20 PM, ucosty wrote:

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.


On Sun, 11 Jul 2004 at 4:28 PM, Michael Dale wrote:

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.


On Sun, 11 Jul 2004 at 4:32 PM, Michael Dale wrote:

Yeah okay I'd call it a bug. Now fixed.


On Sun, 11 Jul 2004 at 7:54 PM, ucosty wrote:

nice... i think