The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Better code syntax highlighting Details »» | |||||||||||||||||||||||||||||
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:
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
Show Your Support
|
3 благодарности(ей) от: | ||
conchemimare, Dr@gon |
Comments |
#42
|
|||
|
|||
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 : Code:
<script type="text/javascript"> function selectAll(a) { var e = a.parentNode.parentNode.getElementsByTagName('code')[0]; if (window.getSelection) { var s = window.getSelection(); if (s.setBaseAndExtent) { s.setBaseAndExtent(e, 0, e, e.innerText.length - 1); } else { var r = document.createRange(); r.selectNodeContents(e); s.removeAllRanges(); s.addRange(r); } } else if (document.getSelection) { var s = document.getSelection(); var r = document.createRange(); r.selectNodeContents(e); s.removeAllRanges(); s.addRange(r); } else if (document.selection) { var r = document.body.createTextRange(); r.moveToElementText(e); r.select(); } } </script> Tested on vb 4.2.3 Here's info to add the custom bbcode buttons to Quick Reply and Quick Edit https://vborg.vbsupport.ru/showpost....4&postcount=15 |
#43
|
|||
|
|||
anyone had trouble with highlight bbcode doing this in the code blocks:
I'm at a loss here |
#44
|
||||
|
||||
<font color="DeepSkyBlue">This plugin ruined the forum, do you know any way to restore bbcode php html default, after deleting the plugin?</font>
|
#45
|
||||
|
||||
Any idea?
|
#46
|
|||
|
|||
I have a weird one. Used this plugin for a few years now and works great. However I've come across some code that simply will not parse no matter what. Can anyone assist?
This is the code when parsed with standard CODE wrappers. Code:
*/ picture const int16 BOOT_LOGO[] = { 128, 49, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0FFF,0xFFFF,0xE007,0xFFFF,0xFFFE,0x007C,0x0000,0x0078,0x1FFF,0xFFFF,0xF00F,0xFFFF,0xFFFF, 0x00FE,0x0000,0x00FC,0x1FFF,0xFFFF,0xF80F,0xFFFF,0xFFFF,0x00FF,0x0000,0x00FC,0x1FFF,0xFFFF, 0xF007,0xFFFF,0xFFFF,0x00FF,0x8000,0x00FC, 0x0FFF,0xFFFF,0xE003,0xFFFF,0xFFFE,0x00FF,0xC000,0x00FC,0x0000,0x000F,0xE000,0x0000,0x0000, 0x00FF,0xE000,0x00FC,0x0000,0x001F,0xC000,0x0000,0x0000,0x00FF,0xE000,0x00FC,0x0000,0x003F, 0x8000,0x0000,0x0000,0x00FF,0xF000,0x00FC, 0x0000,0x007F,0x0000,0x0000,0x0000,0x00FF,0xF800,0x00FC,0x0000,0x00FE,0x0000,0x0000,0x0000, 0x00FD,0xFC00,0x00FC,0x0000,0x01FC,0x0000,0x0000,0x0000,0x00FC,0xFE00,0x00FC,0x0000,0x03F8, 0x0000,0x0000,0x0000,0x00FC,0x7F00,0x00FC, 0x0000,0x07F0,0x0000,0x0000,0x0000,0x00FC,0x3F80,0x00FC,0x0000,0x07F0,0x0000,0x0000,0x0000, 0x00FC,0x1FC0,0x00FC,0x0000,0x0FE0,0x0000,0x0000,0x0000,0x00FC,0x1FE0,0x00FC,0x0000,0x1FC0, 0x0000,0x0000,0x0000,0x00FC,0x0FF0,0x00FC, 0x0000,0x3F80,0x0007,0xFFFF,0xFFFE,0x00FC,0x07F0,0x00FC,0x0000,0x7F00,0x000F,0xFFFF,0xFFFF, 0x00FC,0x03F8,0x00FC,0x0000,0xFE00,0x000F,0xFFFF,0xFFFF,0x00FC,0x01FC,0x00FC,0x0001,0xFC00, 0x0007,0xFFFF,0xFFFE,0x00FC,0x00FE,0x00FC, 0x0003,0xF800,0x0003,0xFFFF,0xFFFC,0x00FC,0x007F,0x00FC,0x0003,0xF800,0x0000,0x0000,0x0000, 0x00FC,0x003F,0x80FC,0x0007,0xF000,0x0000,0x0000,0x0000,0x00FC,0x001F,0xC0FC,0x000F,0xE000, 0x0000,0x0000,0x0000,0x00FC,0x000F,0xE0FC, 0x001F,0xC000,0x0000,0x0000,0x0000,0x00FC,0x000F,0xF0FC,0x003F,0x8000,0x0000,0x0000,0x0000, 0x00FC,0x0007,0xF0FC,0x007F,0x0000,0x0000,0x0000,0x0000,0x00FC,0x0003,0xF8FC,0x00FE,0x0000, 0x0000,0x0000,0x0000,0x00FC,0x0001,0xFCFC, 0x01FC,0x0000,0x0000,0x0000,0x0000,0x00FC,0x0000,0xFEFC,0x03F8,0x0000,0x0000,0x0000,0x0000, 0x00FC,0x0000,0x7FFC,0x03F8,0x0000,0x0000,0x0000,0x0000,0x00FC,0x0000,0x3FFC,0x07F0,0x0000, 0x0000,0x0000,0x0000,0x00FC,0x0000,0x1FFC, 0x0FE0,0x0000,0x0000,0x0000,0x0000,0x00FC,0x0000,0x0FFC,0x1FFF,0xFFFF,0xE003,0xFFFF,0xFFFC, 0x00FC,0x0000,0x07FC,0x3FFF,0xFFFF,0xF007,0xFFFF,0xFFFE,0x00FC,0x0000,0x07FC,0x3FFF,0xFFFF, 0xF80F,0xFFFF,0xFFFF,0x00FC,0x0000,0x03FC, 0x3FFF,0xFFFF,0xF00F,0xFFFF,0xFFFF,0x00FC,0x0000,0x01FC,0x1FFF,0xFFFF,0xF007,0xFFFF,0xFFFE, 0x0078,0x0000,0x00F8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 } // picture /* Any thoughts? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|