Better code syntax highlighting
آخرین زمان حضور: Jan 2017
This Modification is meant more as an example than an actual modification, but will work fine as is.
vBulletin by default has three "code" BB Codes.
The [code] tag simply gives us monospaced text.
The [html] and [php] tags give us some highlighted code that's highlighted pretty much how our webserver software decides how to highlight it. For "serious" coding, that's often insufficient.
GeSHi provides much more accurate highlighting and in a vast number of different languages. It's relatively simple to add these languages to your own BB Codes for highlighting, too.
Attached is the latest version of the GeSHi files, 220.127.116.11. You may go to their website at any time and download newer releases, though the latest was released well over a year ago. (I had to repackage it as a ZIP file, because vB.org doesn't accept tar.gz files.)
Download and extract this file. Upload the geshi.php file and the geshi folder to your FORUMROOT/includes folder.
Download the XML product file and Import it as you would a regular Product through your Admin Control Panel. It will install a plugin that contains BB Code functions for the following languages:
- PHP (as [PHPS])
- CSS (as [CSSS])
- SQL (as [SQLS])
- C++ (as [CPPS])
- HTML (as [HTMLS])
- Java (as [JAVAS])
- Tcl (as [TCLS])
- BASH (as [BASHS])
(If you're wondering, the "S" stands for "Source".)
By looking through those examples, you can see how to easily add other languages GeSHi handles as well (Lua for some of you game programmers, for example).
This has really helped me communicate code stuff withmy Admins for our forum a lot better than the default vBulletin stuff, and it's nice to have for the coders at my forum as well.
Updated (25.JUL.12) [0.02a]
Included install and uninstall scripts that INSERT or DELETE the above BB Codes to/from your database. WARNING! If you have a BB Code named the same as one of the above that you do NOT want deleted, this product will delete that BB Code from the database if you use the Uninstall script. Just wanted to make that clear.
Updated (01.AUG.12) [0.03a]
Product was previously Disabled by default AND (even after enabling product) the Plugin was disabled. Both are now enabled by default.
Updated (01.AUG.12) [0.04a]
Fixed an error from 0.03a that gave SQL errors when trying to update the product. >_>