...

View Full Version : Making my own BBCode, sort of..



Grunge
06-09-2007, 09:09 PM
Right heres the thing I have multiple files, tutorials.php lists the tutorials and view_tutorial.php displays the tutorial by getting the id. Anyways I need to display code in parts of the tutorial, with only part of it needing highlighting I can't use highlight_string();

How would I go about making a tag that wraps around my code, sits the same in the database then is displayed in a box with syntax highlighting? Also it needs to keep <html> tags in-tact, nother words I don't want them to vanish once its shown to the user.

Cheers,
Jonny.

PappaJohn
06-09-2007, 09:19 PM
Lots of tutorials:

http://www.google.com/search?source=ig&hl=en&q=bbcode+in+php&btnG=Google+Search

Grunge
06-09-2007, 09:37 PM
Thanks mate. :)

digital-ether
06-09-2007, 11:56 PM
Right heres the thing I have multiple files, tutorials.php lists the tutorials and view_tutorial.php displays the tutorial by getting the id. Anyways I need to display code in parts of the tutorial, with only part of it needing highlighting I can't use highlight_string();

How would I go about making a tag that wraps around my code, sits the same in the database then is displayed in a box with syntax highlighting? Also it needs to keep <html> tags in-tact, nother words I don't want them to vanish once its shown to the user.

Cheers,
Jonny.

Check out the geshi project for syntax highlighting in PHP. I use it in an open source project and it is quite awesome..

http://qbnz.com/highlighter/

Grunge
06-10-2007, 01:58 AM
Got it going but I need to tell it to highlight only certain code, ive tried the <pre> and <div> methods, but still nothing, it comes back as plain highlighted text and I mean the whole tutorial.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum