Version: 0.04a, by Sarteck
Developer Last Online: Jun 2020
Category: BB Code Enhancements -
Version: 4.x.x
Rating:
Released: 07-24-2012
Last Update: 07-31-2012
Installs: 41
Uses Plugins
Additional Files
No support by the author.
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, 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. >_>
Is there anyway to add these to a single BB Code? I would like to add all of them to the "Code" BB Code, and have them automatically detect and highlight the correct Code Syntax. I think it will be easier for members, then using Multiple Code BB Codes for different Code Languages.
Language highlighting is typically determined by the extension used on the file name. Since there is no file name extension given in a vbulletin code box the individual BBCODES are probably necessary. Note - I have not looked at the code to this modification.
Hi. Maybe for somebody its steel actual.
To correct the problem with disappearing content after editing the message , it is necessary in the module GeSHi BB Codes, at hook bbcode_create to add the following code:
PHP Code:
if ($this->is_wysiwyg())
{
$this->unparsed_tags[] = 'phps';
$this->unparsed_tags[] = 'jss';
$this->unparsed_tags[] = 'htmls';
$this->unparsed_tags[] = 'mysqls';
$this->unparsed_tags[] = 'ahks';
$this->unparsed_tags[] = 'au3s';
$this->unparsed_tags[] = 'avss';
$this->unparsed_tags[] = 'diffs';
$this->unparsed_tags[] = 'xmls';
$this->unparsed_tags[] = 'bashs';
//....and so do this, for all used bbcodes...
}
Hi. Maybe for somebody its steel actual.
To correct the problem with disappearing content after editing the message , it is necessary in the module GeSHi BB Codes, at hook bbcode_create to add the following code:
PHP Code:
if ($this->is_wysiwyg()) { $this->unparsed_tags[] = 'phps'; $this->unparsed_tags[] = 'jss'; $this->unparsed_tags[] = 'htmls'; $this->unparsed_tags[] = 'mysqls'; $this->unparsed_tags[] = 'ahks'; $this->unparsed_tags[] = 'au3s'; $this->unparsed_tags[] = 'avss'; $this->unparsed_tags[] = 'diffs'; $this->unparsed_tags[] = 'xmls'; $this->unparsed_tags[] = 'bashs'; //....and so do this, for all used bbcodes... }