Back to vBulletin 4.x Add-ons

Better code syntax highlighting
Mod Version: 0.04a, by Sarteck

vB Version: 4.x.x Rating: (4 votes - 4.00 average) Installs: 41
Released: 25 Jul 2012 Last Update: 01 Aug 2012 Downloads: 322
Not Supported Uses Plugins Additional Files  

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.

http://qbnz.com/highlighter/index.php 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, 1.0.8.10. 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])
  • JavaScript (as [JSS])
  • 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. >_>

Download

File Type: %1$s geshi.zip (1.05 MB, 356 downloads)
File Type: %1$s product-cb_geshi_bbcode.xml (8.5 KB, 255 downloads)


vblts.ru supports vBulletin®, 2022-2024