Version: 1.00, by Andreas
Developer Last Online: Jan 2023
Version: 3.5.0 RC1
Rating:
Released: 07-27-2005
Last Update: Never
Installs: 143
Uses Plugins Template Edits
Additional Files Is in Beta Stage
No support by the author.
Advanced Syntax Highlighting
This Hack provides a [highlight] BBCode to highlight a wide range of Languages such as XML, HTML, Java, Javascript, SQL and so on.
It uses GeSHi, which is included in this ZIP.
Details
1 Product XML with 2 Plugins and 2 Templates
Please only click Install if you actually have installed/are using this Hack, and click Uninstall whan you don't use it any longer!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Installed artvs' modified product, as found here. Works great on vB4.0.3 and I'm not seeing any problems as reported in the later posts - and did not scroll down to see jarkkol's modification until it was too late.
Seems good to go, although I'm having trouble finding documentation on this. IE: what are the code tags for all languages? IE: Is ruby [code=ruby]? Is javascript [code=js] or [code=javascript]? Hopefully I'll find a list on the 6 middle pages of this thread.
Don't know why one of you don't post this as an official MOD for vb4... So useful!
This is a really nice add-on. I used this as a basis for one I made for vB4... some changes I made (in case Andreas ever makes an "official" version for vB4):
Updated for vBulletin 4.
Instead of using [highlight], I decided to extend [code]. It uses it if you specify a parameter like so: [code=javascript]
I'm intercepting [html] and [php] BBCodes to use this automatically.
Reads all available languages (from the geshi language directory) so just having the file in the directory displays it as being available on the BBCode help page (see example).
Can anyone confirm that this Add-on works in vB 4.0.5?
I am a vBulletin newbee and if I break it I would not know how to fix it.
I see that it took some modification just to get it to work in 4.0.2 so I imagine it would take more for 4.0.5
This is a really nice add-on. I used this as a basis for one I made for vB4... some changes I made (in case Andreas ever makes an "official" version for vB4):
Updated for vBulletin 4.
Instead of using [highlight], I decided to extend [code]. It uses it if you specify a parameter like so: [code=javascript]
I'm intercepting [html] and [php] BBCodes to use this automatically.
Reads all available languages (from the geshi language directory) so just having the file in the directory displays it as being available on the BBCode help page (see example).
2 - It deletes carriage return when you copy the code and paste it in a editor.
The whole text is one line only.
If someone has also a solution for this.
I will adopt it if I correct it succesfully but I do not know how. :-(
2 - It deletes carriage return when you copy the code and paste it in a editor.
The whole text is one line only.
If someone has also a solution for this.
I will adopt it if I correct it succesfully but I do not know how. :-(
Thanks in advance for your help.
David
We have fixed this issue through trial and error. BIG pain in the a**.
I made few changes to the product-advhighlight.xml file posted by artvs to make this mod work properly with vb4.0.2. I used latest GeSHi (1.0.8.6) with this mod:
- Added the is_array() check mentioned above.
- Changed the bbcode_highlight template to use "Maximum [CODE] Lines" defined in BB Code Settings. Previous version printed all the lines to the page regardless how long code you pasted within the code-tags, while this version limits the code window height and adds vertical scrollbar for code with more lines. It's doesn't limit the height exactly to the "Maximum [CODE] Lines" (I guess because of the different fonts used in the standard vB code tag and GeSHi), but is pretty close anyway (:
- Changed GeSHi to use GESHI_HEADER_PRE_VALID instead of GESHI_HEADER_DIV. This fixes word wrapping issue in the code window, i.e. previous version wrapped long code lines while this version adds horizontal scrollbar in that case.
- Fixed typos
Disclaimer: I'm newbie when it comes to php & vb modding, so use this version at your own discretion (:
Can confirm that this works great with 4.2 and has solved my issue. Thanks