Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Better code syntax highlighting Details »
Better code syntax highlighting
Mod Version: 0.04a, by Sarteck (Coder) Sarteck is offline
Developer Last Online: Jun 2020 I like it Show Printable Version Email this Page

vB Version: 4.x.x Rating: (4 votes - 4.00 average) Installs: 40
Released: 25 Jul 2012 Last Update: 01 Aug 2012 Downloads: 301
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.

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. >_>

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #31  
Old 03 Jun 2014, 03:41
aminp30 aminp30 is offline
 
Join Date: Jul 2013
it seems geshi support vb codes. but there is no vb tag after installation.
is there any way to solve it?
Reply With Quote
  #32  
Old 22 Jul 2014, 08:45
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by TheSupportForum View Post
this does nto work for 4.2.0

each time an post is edited the BBCode is removed
Originally Posted by Cadellin View Post
Similar issue here. When editing the BBcode is removed and replaced with HTML which isn't repostable.
Originally Posted by Widey View Post
Did anybody get this working in 4.2 in the end or is it still removing the BBCode when a post is edited?
I have this problem too.
is there any solution?
Reply With Quote
  #33  
Old 16 Sep 2014, 17:55
thetechgenius's Avatar
thetechgenius thetechgenius is offline
 
Join Date: Jun 2014
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.
Reply With Quote
  #34  
Old 16 Sep 2014, 18:39
tbworld tbworld is offline
 
Join Date: Oct 2008
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.

Last edited by tbworld; 17 Sep 2014 at 03:03.
Reply With Quote
  #35  
Old 10 Nov 2014, 23:00
errorware errorware is offline
 
Join Date: Nov 2014
Any chance to change the colors for a dark theme? Is that to much of a hassle?

Cheers
Reply With Quote
  #36  
Old 15 Nov 2014, 14:14
john7911 john7911 is offline
 
Join Date: Feb 2013
Need to have BB code for AutoLISP
http://en.wikipedia.org/wiki/AutoLISP
Thank you.
Reply With Quote
  #37  
Old 02 Dec 2014, 08:53
derbi derbi is offline
 
Join Date: Jun 2007
There are a demo?
Reply With Quote
  #38  
Old 02 Dec 2014, 10:22
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Real name: Chris
Not that I have seen, best way to demo something is to install it and test it out.
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #39  
Old 08 Jul 2015, 12:59
Wedframe Wedframe is offline
 
Join Date: Mar 2013
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Hope this will be useful...
Reply With Quote
  #40  
Old 19 Jul 2015, 01:46
Raptor Raptor is offline
 
Join Date: Nov 2001
Originally Posted by Wedframe View Post
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Hope this will be useful...
perfect! thank you very much

works in vb 4.2.3
Reply With Quote
  #41  
Old 19 Jul 2015, 02:09
Raptor Raptor is offline
 
Join Date: Nov 2001
Thumbs up

Here is the changes to add 'Select All' to this mod (thanks to BCP Hung for his select all mod which I used for this) and also fixed the edit issue so that you can edit the code without everything parsing with no problems (thanks to wedframe in the previous post)

Insert javascript code into headinclude template
AdminCP -> Styles & Templates -> Style Manager -> Edit Templates -> headinclude
Copy and paste following js code to bottom of headinclude template :


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

then import and overwrite the new xml - enjoy

Tested on vb 4.2.3

Here's info to add the custom bbcode buttons to Quick Reply and Quick Edit

https://www.vbulletin.org/forum/show...4&postcount=15
Attached Files
File Type: xml product-cb_geshi_bbcode_selectall.xml (9.8 KB, 10 views)

Last edited by Raptor; 19 Jul 2015 at 04:41.
Reply With Quote
  #42  
Old 31 May 2017, 00:26
GHRake GHRake is offline
 
Join Date: Sep 2015
Real name: Anomander Rake
anyone had trouble with highlight bbcode doing this in the code blocks:


I'm at a loss here
Reply With Quote
  #43  
Old 16 Aug 2017, 08:01
RaYdeN.ADM's Avatar
RaYdeN.ADM RaYdeN.ADM is offline
 
Join Date: May 2006
Location: Los Angeles, CA (US)
Real name: Paul Rayden
This plugin ruined the forum, do you know any way to restore bbcode php html default, after deleting the plugin?
Reply With Quote
  #44  
Old 21 Aug 2017, 00:19
RaYdeN.ADM's Avatar
RaYdeN.ADM RaYdeN.ADM is offline
 
Join Date: May 2006
Location: Los Angeles, CA (US)
Real name: Paul Rayden
Any idea?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 01:58.

Layout Options | Width: Wide Color: