Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-09-2007, 09:09 PM   PM User | #1
Grunge
New to the CF scene

 
Join Date: Jun 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Grunge is an unknown quantity at this point
Making my own BBCode, sort of..

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.
Grunge is offline   Reply With Quote
Old 06-09-2007, 09:19 PM   PM User | #2
PappaJohn
Senior Coder

 
Join Date: Apr 2007
Location: Quakertown PA USA
Posts: 1,028
Thanks: 1
Thanked 125 Times in 123 Posts
PappaJohn will become famous soon enough
Lots of tutorials:

http://www.google.com/search?source=...=Google+Search
PappaJohn is offline   Reply With Quote
Old 06-09-2007, 09:37 PM   PM User | #3
Grunge
New to the CF scene

 
Join Date: Jun 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Grunge is an unknown quantity at this point
Thanks mate.
Grunge is offline   Reply With Quote
Old 06-09-2007, 11:56 PM   PM User | #4
digital-ether
New Coder

 
Join Date: May 2006
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
digital-ether is an unknown quantity at this point
Quote:
Originally Posted by Grunge View Post
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/
__________________
Fiji Web Design - where i do Joomla Web Design
Bucabay.com - My blog
digital-ether is offline   Reply With Quote
Old 06-10-2007, 01:58 AM   PM User | #5
Grunge
New to the CF scene

 
Join Date: Jun 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Grunge is an unknown quantity at this point
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.
Grunge is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:36 PM.


Advertisement
Log in to turn off these ads.