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: Dec 2017 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: 298
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.
  #16  
Old 07 Aug 2012, 05:52
SolidSnakeLive SolidSnakeLive is offline
 
Join Date: Jul 2011
Its works the problem is I was using a plugin that add more buttons to editor such as pdf / flash / advanced colors ...etc

when i disabled it .... it works !

I don't know if there a solution to keep both works
Reply With Quote
  #17  
Old 07 Aug 2012, 11:44
Sarteck's Avatar
Sarteck Sarteck is offline
 
Join Date: Mar 2008
Hmm. What's the modification? Can you link it? Maybe I can modify my thing to be compatible with it (although I'm not sure why it would be incompatible).
Reply With Quote
  #18  
Old 22 Aug 2012, 04:35
SolidSnakeLive SolidSnakeLive is offline
 
Join Date: Jul 2011
Originally Posted by Sarteck View Post
Hmm. What's the modification? Can you link it? Maybe I can modify my thing to be compatible with it (although I'm not sure why it would be incompatible).
Its Editor tool addon

This Product :

http://www.wahtaljouf.com/wahtools/wah-tools-editor.zip

same but UTF-8 Encoding : http://www.wahtaljouf.com/wahtools/w...ditor-utf8.zip

Info : http://www.traidnt.net/vb/traidnt1998010/
Its in Arabic language not English but you can see the images to have the idea about this product
Reply With Quote
  #19  
Old 12 Sep 2012, 12:57
SpikedRocker SpikedRocker is offline
 
Join Date: Jul 2009
When I've tried using this mod, at least with the php code, it actually was causing an error when you try to load the thread. Has anyone else experienced this?
Reply With Quote
  #20  
Old 13 Sep 2012, 09:47
SolidSnakeLive SolidSnakeLive is offline
 
Join Date: Jul 2011
Can you make this script looks like this codebox

http://forum.mtasa.com/viewtopic.php...=47798#p473505

appears as code with using lua highlight support & ofcource with rows id
Reply With Quote
  #21  
Old 16 Sep 2012, 15:56
SpikedRocker SpikedRocker is offline
 
Join Date: Jul 2009
Originally Posted by Sarteck View Post
The product was previously disabled by default, and even after enabling the Product, the Plugin was disabled by default.

Both are now enabled by default in v0.03a, so you can download and over-write to fix, or you can simply enable both the Product and then Plugin.

My bad, oops. ^^;
I have this issue using .04

Anyone know how to fix this?
Reply With Quote
  #22  
Old 08 Oct 2012, 00:56
TheSupportForum TheSupportForum is offline
 
Join Date: Jan 2007
this does nto work for 4.2.0

each time an post is edited the BBCode is removed
__________________
http://www.multihunters.co.uk - all your coding needs
Reply With Quote
  #23  
Old 10 Oct 2012, 15:15
khronos_group khronos_group is offline
 
Join Date: Mar 2012
I've successfully installed your product and have successfully added GLSL! Yay! Thank you.

I have one issue though: We use the fancy editor in vBulletin, and once we add the tags--for any code block-- and preview or save the post, the tags are removed and the code is saved as converted already into its fancy format. If we come back to edit the code, and save, our code is all smushed up onto one line.

Is there a way to have the tags remain in our posts and not get converted, much like how the normal BB Code tags work?

Thank you.

Screen shot of issue for clarity

Last edited by khronos_group; 10 Oct 2012 at 15:38. Reason: Added screen shot
Reply With Quote
  #24  
Old 18 Oct 2012, 09:33
Cadellin's Avatar
Cadellin Cadellin is offline
 
Join Date: Jan 2009
Originally Posted by simonhind View Post
each time an post is edited the BBCode is removed
Similar issue here. When editing the BBcode is removed and replaced with HTML which isn't repostable.
Reply With Quote
  #25  
Old 17 Feb 2013, 14:51
Widey Widey is offline
 
Join Date: Aug 2004
Did anybody get this working in 4.2 in the end or is it still removing the BBCode when a post is edited?
Reply With Quote
  #26  
Old 29 Apr 2013, 18:32
karel1985 karel1985 is offline
 
Join Date: Mar 2007
Real name: Karel B.
is this working on 4.2.1 ?
__________________
Dutch Pc Helpforum - www.pc-helpforum.be
Reply With Quote
  #27  
Old 04 Jun 2013, 20:42
conchemimare conchemimare is offline
 
Join Date: Jan 2010
I got it to work on vb 4.2.1

No problems so far.
Reply With Quote
  #28  
Old 26 Aug 2013, 04:38
Madej's Avatar
Madej Madej is offline
 
Join Date: Aug 2013
And anyone know how to hide the contents of the code in the post for guest?
Reply With Quote
  #29  
Old 18 Nov 2013, 18:02
Raptor Raptor is offline
 
Join Date: Nov 2001
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?

It still removes the codebox when the post is edited

until thats fixed its pretty useless for me unfortunatley
Reply With Quote
  #30  
Old 18 Nov 2013, 18:02
Raptor Raptor is offline
 
Join Date: Nov 2001
Originally Posted by SolidSnakeLive View Post
Can you make this script looks like this codebox

http://forum.mtasa.com/viewtopic.php...=47798#p473505

appears as code with using lua highlight support & ofcource with rows id
i'd love this - cant find the mod anywhere though
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 21:04.

Layout Options | Width: Wide Color: