BBcode for [CODE] ??<

liunx

Guest
I'm looking to use a bbcode like on most forums you see that if PHP code is within <? ?> tags it will NOT execute the code but just print the code to the webpage. I have it working for Bold and Italics and Underline with str_replace() but just replacing
Code:
 with something like the <PRE> tag does not work.  Any help would be great!  Syntax highlighting would be a nice additional also :)code is a bit more difficult. you basically have to run through the string and replace special characters.[code] just uses <blockquote> is all.

and change all of the html characters to there ascii format < turns into <Originally posted by scoutt 
[code] just uses <blockquote> is all.

and change all of the html characters to there ascii format < turns into < How do I change the html into ascii?  is there a code to use?htmlentities()Originally posted by scoutt 
htmlentities()  I think I have it working...Thanks Scoutt!  :DIt's better to use a div for something like [code]

This way you can add overflow:auto; and make it scroll if necessary. Like vb3 does.Originally posted by Josh 
It's better to use a div for something like [code]

This way you can add overflow:auto; and make it scroll if necessary. Like vb3 does.  You mean instead of <blockquote> right?  How does VB3 do it?  Can you share the <div> code with me? :)yah sure, it's pretty simple...just something like
<div style="overflow:auto; width:50%; ">
lots of code here
</div>

and of course you can add more cssThanks Josh I think I have my scipt working pretty well right now.  ( I HOPE! :) )
 
Back
Top