![]() |
So after 2+ hours of working on this I finally found a solution, it's not very clean as you have to edit a class file from vbulletin but such is life.
This is done with version 3.6.7 PL1 open up includes/class_bbcode_alt.php 1. Replace the second foreach loop in the `vB_BbCodeParser_Wysiwyg` function on line 82 with this code: PHP Code:
PHP Code:
|
Hello !
Where can i define the WIDTH of code display ? In Firefox it looks a little bit too small -> http://www.waldbauer.com/vb/showthre...=5552#post5552 EDIT: I see the auto feature has a problem with IE, which correct size in px to use instead ? |
]Hi all!
I have successfully installed Advanced Syntax Highlighting (THX Andreas) with all the modifcations read in the posts above (THX guys). I need to fix at least one more thing: If I use the extended editor, copy paste a colored text and use the [highlight=XXX] vb Code tag the color format (and any othe format) doesn't get delete like using the [php] vb Code tag. example: [highlight=vb][color=red]coloredtext[/color][/highlight] [php]coloredtext[/php] Now i want to fix [highlight=XXX] to work like [php], because inserting preformated code nukes the text between the [highlight] tags. However I can't find where [php] removes the other codes. Can anyone tell me where I can find this, please. THX for help! |
]I did it! With help from vBulletin-germany I could find the line where you need to add the code.
Simply add it to the html and php keywords in functions_wysiwyg.php. So replace: Code:
'#\[(html|php)\]((?>[^\[]+?|(?R)|.))*\[/\\1\]#siUe', // strip html from php tags Code:
'#\[(html|php|highlight)\]((?>[^\[]+?|(?R)|.))*\[/\\1\]#siUe', // strip html from php tags |
Quote:
|
Quote:
PHP Code:
the browser parses the characters, so the line of code i posted should work via copy & paste |
Installed successfully on 3.6.8 pl2 =)
Last problem is, I want to make the [highlight=vb] to [vb] If I try to use a custom bbcode like [vb] which replaces [highlight=vb]{param}[/highlight] it doesn`t work :( Someone knows how to make this working? German/English help for me would be nice :D |
Hi guys, I'm using vBulletin 3.70 RC3 and installed this hack. I tried to make a vB Tag and a button for the editor.
The normal code for highlighting is [highlight=vb]My VB code[/highlight], so I made a new vB Tag with the following content: [highlight=vb]{param}[/highlight] But the problem is when I click on the button and add my text it doesnt highlight anything and just shows [highlight=vb]My Text[/highlight] Do you know how to fix this? |
Will this work with 3.7.0 ?!
|
Hello ! I recently reinstalled this plugin on 3.7.1 but my codeblocks are to width - how can i reduce the codewidthto fit my screen ?
|
Hey all,
I've run into a strange problem with this. As you can see on the attachement, the colored code continues after the highlight should end. Any idea what could be causing this? |
Does this Addon work correctly with 3.7.2pl1?
|
Plugin works fine with 3.7.3.
But i am still figguring out how to get some buttons into the editor. 1) You cant use the build-in method to add the bbcode, because the 'normal' tag is just given out, no highlight will be made. 2) You cant just change the toolbar_on template within the buttonmenu, and add a new entry with _cmd_wrap0_BBCODENAME=language, because then it will be [BBCODENAME=language][/BBCODENAME=language] instead of so we need to change the vbulletin_textedit.js file, because there the choise will be made what to happen with our string. But i cant find a solution that work. Is there somebody who can help me? Thank you very much. Developed a Solution. Check next Post. |
Alright, i found a solution for the Button-Problem.
Just follow the Tutorial, and you will be able to use the Highlighter with the latest vBulletin (3.7.3 i think). You maybe find other information on this, but thats the only code which works perfectly with the WYSIWYG-Editor AND the normal Codeeditor. It allows you to select already inserted Code and wraps your Selection between the Tags, instead of replacing your code. Step 1) Download the uncompressed Javascript Package of your Customer Center Step 2) Open the File /clientscript/vbulletin_textedit.js Step 3) Edit the File Search for Code:
/** after this function enter the following: Code:
/** Search for Code:
case 'insertimage': Insert following Code, after the Case statement Code:
Step 4) Edit the editor_toolbar_on template in ACP Select Styles and Templates, then Search for template. Enter "editor_toolbar_on" and do a search. Remember to edit the template in all your Styles! Search for: Code:
<if condition="$show['php_bbcode']"> Quote:
Code:
<td><div class="imagebutton" id="{$editorid}_cmd_vbnet"><img src="$stylevar[imgdir_editor]/vb.png" width="16" height="16" alt="Visual Basic .NET Quellcode einf?gen" /></div></td> It works fine. Additionally, you can add some Phrases and so on, but this will work as well. Remember to create some Icons for the Editor. Use the default Resolutionof 16x16 Pixels. Quote:
|
There is an error while converting [ and ] - Characters. Here is the Solution:
Open the product-advhighlight.xml and find: Code:
$codefind2 = array( Code:
$codefind2 = array( |
ok so can we change the variable of "hightlight" to like "language" or something like that?
Im trying to use WP and this to work just fine. Example , in wordpress getti uses , <pre lang=css> and how would i make vBulletin or Wordpress hack to ether use similar post code? thanks a bunch. |
I still havent figured out a solution for the highlight-relacement, but it works still fine with Version 3.8.0./ 3.8.1, if you follow my instructions i postet some posts before.
|
DevFuture.de dou you know how to get it to auto indent the code?, i'm currently trying to use it for VBA (Microsofts version of VB) and i'm using teh vb.net language as the highlighting seems closest in that, but all the code stays "as is", it doesn't capitalize or indent the code so highlighted code still looks a bit messy.
|
Hello Simon Lloyd,
I am sorry, i havent subscribed the topic, so that I just saw your entry now. I am sorry, but I dont know how to indent them. Normally this function is not provided by GeShi (afaik). But it should worker proper, if you copy the Sourceode with indented style, and paste them into a thread. Normally it should be displayed intended then. |
Quote:
Code:
For Each..... |
Great Stuff
|
this mod doesnt display the [ correctly in the highlight, it displays [ ; instead of the actual symbol.
I placed a space before the ; due to it displaying it :p the fix above didnt work for me |
What's happened to qbnz.com?
*Edit* The site is back, but if it disappears again, there's still the software here: http://sourceforge.net/projects/geshi/ |
Waiting with baited breath to see this mod in vb4! :)
|
i've just install it on 3.8.4 and work perfectly, better than all the other i've tested! amazing :D
|
I'd successfully adapt this hack for VB4. Not sure can I share my efforts with everyone?
|
Oh please do..
|
What to do:
1) download and import product from attachment. 2) find file /admincp/misc.php and make a backup copy of it 3)in this file find Code:
WHERE title IN ('bbcode_quote', 'bbcode_php', 'bbcode_code', 'bbcode_html', 'bbcode_video') Code:
WHERE title IN ('bbcode_quote', 'bbcode_php', 'bbcode_code', 'bbcode_html', 'bbcode_video', 'bbcode_highlight') Code:
'bbcode_video' =>& $bbcodelist["$tlist[bbcode_video]"], Code:
'bbcode_highlight' =>& $bbcodelist["$tlist[bbcode_highlight]"], Code:
'bbcode_video' => intval($tlist['bbcode_video_styleid']), Code:
'bbcode_highlight' => intval($tlist['bbcode_highlight']), 6) go to admin panel and rebuild post cache Hack usage: [ syntax = cpp ] or [ highlight = cpp ] or [ code = cpp ] (without spaces) I also would reccomend to obtain latest version of geshi. |
fixed my no-color problem, paths were out...great mod thanks
|
Can this mod be used in VB 4.x ?
|
I'm interested too in using this mod for vB 4.x
as soon as I will be ready I will try to apply changes suggested by artvs here above. Thanks |
Confirmed working with VB 4.0.1 according to changes suggested by artvs. Thanks mate.
|
Got warning with vb4.0.2:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/class_bbcode.php(185) : eval()'d code on line 11 |
Quote:
|
Does anyone have a patch for vb4.0.2 to fix the above problem?
Edit: Ok, I was able to fix it by adding the following two lines to the product-advhighlight.xml file in artvs attachment: Code:
if(!is_array($specialtemplates)) Code:
$specialtemplates = array_merge($specialtemplates, array('bbcode_highlight','bbcode_highlight_printable')); |
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 (: |
Having a problem with this mod on vb4.0.2 in that whenever I rebuild post cache, my [code] blocks in posts dont show up at all and I have to revisit each post/edit and save it again to ensure the code appears.
|
Strange, I tried rebuilding the post cache but don't have the problem.
|
I have a problem. I am running 3.8.
It installs fine and works OK.. The syntax highlighting works but it replaces the [ and ] with HTML code. Eg, & #91; This is displayed as code rather than the actual symbol. Any ideas? |
I hacked this for VB4 and my own personal preferences, then installed it. Works great!
|
All times are GMT. The time now is 08:42 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|