Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts

  • #3
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks mate.

  • #4
    New Coder
    Join Date
    May 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •