I really need your help in vbulletin forum .. I am owner of vbulletin forum designed for arab and it's specialised in html and php tutorial how can I highlight code like daniweb forum ?? I dom't know if administrator can help me or not but I hope !!

wating for you answers !!

Please help !

9 Years
Discussion Span
Last Post by martin5211

Have you hear about GeSHi? It is a good syntax colorizer and very unobtrusive. This is the code to put on:


$geshi =& new GeSHi($source, "php");

echo $geshi->parse_code();

There are a bbcode tutorial at phpit.net. You can use preg_replace to get the content of code tags and use it as source.


thank you for your help but can you help me a little bite more .. I mean you know more explanation ..


Ok you are right I found the hack tu add through vb and it's working but still how to put Toggle Plain Text ?


The link calls a javascript function that hide the content with GeSHi and show the next div with a textarea and plain text as value (trimming the bbcodes). For example add the following ID properties to that <div> elements: "geshi" and "plaintext". Then add a JS function like this:

function plainText () {
var geshi = document.getElementById('geshi');
var plaintext = document.getElementById('plaintext');

geshi.style.display = "none";
plaintext.style.display = "block";

By this way, we're changing CSS properties of some elements (geshi and plaintext) when you call this function.
Add the plainText () call on onload property of your link to toggle text.

These modifications has to be done in the view of vb board.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.