Hello,

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 !

Recommended Answers

All 5 Replies

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

include_once('geshi.php');

$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 how I can add Geshi to vbulletin forum ?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.