View Full Version : Advanced Syntax Highlighting - BBCode [highlight]
Andreas
07-27-2005, 10:00 PM
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 (http://qbnz.com/highlighter/), 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!
Chris M
07-28-2005, 04:15 PM
Warning: Unknown(/home/xxx/public_html/xxx/includes/geshi.php): failed to open stream: No such file or directory in /includes/class_bbcode.php(148) : eval()'d code on line 70
Fatal error: (null)(): Failed opening required '/home/xxx/public_html/xxx/includes/geshi.php' (include_path='.:/usr/local/lib/php') in /home/xxx/public_html/xxx/includes/class_bbcode.php(148) : eval()'d code on line 70
:ermm:
Edit: I re-uploaded geshi.php and it worked - Odd :speechless:
Satan
prawn
07-28-2005, 05:40 PM
great idea. thanks kirby :)
but html highlightning does not show up colored. what am i doing wrong?
greets
Andreas
07-28-2005, 05:51 PM
You must use the Names of the Files in Directory geshi, eg. for HTML you must use html4strict:
[hightlight=html4strict]
<!-- some HTML here -->
[/highlight]
prawn
07-28-2005, 05:58 PM
ah thank you. that's pretty easy. didn't really look into the geshi dir.
Boofo
07-29-2005, 12:11 AM
Is there a way we can make a bbcode replacement for like sql and xml tags? And is there any way to take the numbers out of the code on each line at the beginning?
Boofo
07-29-2005, 06:49 AM
It looks like xml hightlighting gets broken.
Andreas
07-29-2005, 07:41 AM
Line Numbers -> Edit the Plugin (Hook bbcode_create) and comment out $geshi->enable_line_numbers
Furure Versions might include a setting for this.
As for the Screenshot: Can you post the Text which generated this output?
If you want to have [sql] and [xml] Tags, I guess you would have to create similar handlers that would then call handle_bbcode_highlight
Boofo
07-29-2005, 08:00 AM
Sure thing. ;)
Here you go.
<?xml version="1.0" encoding="ISO-8859-1"?>
<navgroups product="vbulletin">
<navgroup phrase="styles_and_templates" permissions="canadminstyles" displayorder="20">
<navoption displayorder="12">
<phrase>edit_templates</phrase>
<link>template.php?do=modify&expandset=1</link>
</navoption>
<navoption displayorder="14">
<phrase>view_all_templates</phrase>
<link>template.php?do=modify&expandset=1&group=all</link>
</navoption>
<navoption displayorder="16">
<phrase>add_new_template</phrase>
<link>template.php?group=&do=add&dostyleid=all</link>
</navoption>
</navgroup>
<navgroup phrase="languages_and_phrases" permissions="canadminlanguages" displayorder="30">
<navoption displayorder="25">
<phrase>add_new_phrase</phrase>
<link>phrase.php?do=add</link>
</navoption>
</navgroup>
</navgroups>
This is something I did for my admin cpnav.
Andreas
07-29-2005, 08:13 AM
This is the Output I get on my Board ...
Boofo
07-29-2005, 08:50 AM
This is the Output I get on my Board ...
Ok, I see what is going on. In the file I have you are changing the & to &, because that's how it shows on my site. It shows the & in your pic. Am I close?
Because that's where it seems to break in my pic.
Boofo
07-29-2005, 09:00 AM
If I comment this line out in the plug-in, then it shows just like yours.
'&', // & to &
If I leave it in, then it shows like my pic.
Andreas
07-29-2005, 09:08 AM
Hmm, I didn't change anything - I just copypasted your XML and seems to work fine for me.
So can you tell me exactly how to reproduce the Problem?
Boofo
07-29-2005, 09:10 AM
Ok, I figured it out now. You're hack is smarter than I am (big surprise, I know).
I was using & instead of & in my original code. It messes up with just &. I guess it was trying to teach me the proper xml way to do it. Any way to catch that for noobies?
Andreas
07-29-2005, 09:13 AM
Well, just & is invalid XML :)
I guess GeSHIi doesn't like that too much.
I don't think there is any way to detect such things ...
Boofo
07-29-2005, 09:40 AM
Well, just & is invalid XML :)
I guess GeSHIi doesn't like that too much.
I don't think there is any way to detect such things ...
I guess that's one way to learn valid xml coding, huh? ;)
Is there any way to keep the spacing at the beginning of each line so it looks like the code we enter instead of lining it all up the the left? The indents were there before I posted the code for highlighting.
Hi, is this hack compatible to older versions, maybee the 3.0.8 Board, or what do i have to modify to make it work?
regards
Disi
Andreas
08-29-2005, 11:06 PM
No, it's not compatible.
Feel free to backport it, I won't do so :)
Well i've made a 3.5rc2 Test installation on my pc and i don't now why but it doesn't work, its not parsing the code.
example:
[hightlight='php']
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
?>
[/highlight]
will be posted see the attachment
Andreas
08-30-2005, 05:48 PM
Well, it's [highlight] not [hightlight] :)
Well, it's [highlight] not [hightlight] :)
Oh man this is not my day :)
Big thx!
Works great now!
wilky49
08-30-2005, 06:56 PM
KirbyDE,
Thanks for the mod, I have been looking for something to do this.
I added my own format called webfocus (yes its a report language) and it works great.
-Wilky49
Princeton
08-30-2005, 07:06 PM
BEAUTIFUL!!!
Great addon :up:
Well last question How do i make a Button (for example html) which adds the tags automaticly?
thx in advice :)
Disi
wilky49
08-30-2005, 11:36 PM
That would be a cool addition to the hack.
KirbyDE ... Hint Hint.
-Wilky49
Yeah would be nice if we get some hints :)
mfg
Disi
Andreas
09-02-2005, 01:27 PM
If somebody can make a nice Button Image that fi's with the Default Style i'll make it so it does automatically show up.
And an explanation on how to use this (for the Users) at misc.php?do=bbcode is also missing.
WEll maybe a button is not the best solution, whats about a Listbox?
remove the php tag and replace it with a Lisbox, nice to have is something in the ACP where you can select included languages or something?!
What do you think Kirby?
digitalpoint
09-04-2005, 09:21 AM
Wouldn't it be better to make it a tag that isn't already in use by default with vBulletin (or maybe it was be design since it requires a parameter)?
Andreas
09-04-2005, 11:20 AM
@digitalpoint
Well, it highlights Text so I thought that highlight would be best, and it also doesn't conflict as the default [hjighlight] does not have paramaters.
Anyway, you can easily change the Tag by editing the Plugin - should be obvious what to do.
digitalpoint
09-04-2005, 07:54 PM
Is there a way to get it to not parse bbcode within the highlight tags?
For example, try this:
<?php
echo '[b]test';
?>
It gives me:
echo '&#### start pluginlist ###;b&#### start pluginlist ###;test';
Also, really minor, but shouldn't this line:
if (!is_array($codefind))
be:if (!is_array($codefind1))
digitalpoint
09-04-2005, 10:52 PM
The comments being output looks like it was caused by a bug in RC2, which was fixed for the next release already, so I got that squared away. Very nice plug-in BTW... I changed it to be CODE instead of HIGHLIGHT (more natural to me) and I added a little extra to have it intercept the normal PHP and HTML tag calls. :)
Jesse Stratford
10-16-2005, 06:03 AM
Hi Kirby,
This looks like an awesome plugin. I'm interested in knowing if it can be changed such that a tag like [as] automatically invokes this plugin using ActionScript as the type. I know I can use [highlight=ActionScript] but the problem is my board is 4 years old and already has a few hundred thousand posts which used the [as] syntax.
I've tried playing around with it but to no avail.
Primarily I changed:
$this->tag_list['option']['highlight']
to
$this->tag_list['option']['as']
But no dice.
Any help much appreciated.
Cheers
Jesse
Alphawolf83
10-18-2005, 02:52 PM
It does not work on v3.0.7, right? ;)
Good Job!
marc_t
11-02-2005, 09:38 PM
Hi Kirby,
This looks like an awesome plugin. I'm interested in knowing if it can be changed such that a tag like [as] automatically invokes this plugin using ActionScript as the type. I know I can use [highlight=ActionScript] but the problem is my board is 4 years old and already has a few hundred thousand posts which used the [as] syntax.
I've tried playing around with it but to no avail.
Primarily I changed:
$this->tag_list['option']['highlight']
to
$this->tag_list['option']['as']
But no dice.
Any help much appreciated.
Cheers
Jesse
Any NEws on this. HAve the same problem.
Wildthinks
11-04-2005, 09:58 AM
Any NEws on this. HAve the same problem.
Yupp,
also interesting on a solution.
Andreas
11-04-2005, 10:51 AM
If you just want [as] for ActionScript, then change it to
$this->tag_list['no_option']['as']
as well as
function handle_bbcode_highlight(&$parser, $code)
and
$geshi = new GeSHi($code, 'ActionScript', $path);
Jesse Stratford
11-04-2005, 11:03 PM
Thanks Andreas. I figured that our just yesterday myself and it worked pretty well. The only problem I'm finding is that all NEW posts will highlight correctly but all the old posts which have foobar just remain as plain text. What's with that? How can I fix it up?
Any help much appreciated.
Cheers
Jesse
Andreas
11-05-2005, 04:05 AM
truncate post_parsed
Jesse Stratford
11-05-2005, 01:55 PM
Works great. Thanks!
garrynewman
11-13-2005, 10:48 AM
Ok, finally.. for anyone wanting tags like code and code.. here's an example for Lua..
if (!function_exists('handle_bbcode_lua'))
{
function handle_bbcode_lua(&$parser, $code, $type)
{
return handle_bbcode_highlight( $parser, $code, 'lua' );
}
}
$this->tag_list['no_option']['lua'] = array(
'callback' => 'handle_external',
'strip_empty' => true,
'stop_parse' => true,
'disable_smilies' => true,
'disable_wordwrap' => true,
'strip_space_after' => 1,
'external_callback' => 'handle_bbcode_lua'
);
Just add it near the bottom of the bbcode_create hook.
Wildthinks
12-22-2005, 05:59 PM
Have you any hint, where i can switch the width for bbcode code to 100%?
Thank you
thomas
kirupa
12-24-2005, 03:34 PM
boofo - I was able to retain spacing by changing the code in class_bbcode.php in the includes folder:
// [HIGHLIGHT]
$tag_list['no_option']['highlight'] = array(
'html' => '<span class="highlight">%1$s</span>',
'strip_empty' => false
);
kirupa
12-24-2005, 04:39 PM
Hi everyone,
Where would I add this code to enable only [as] functionality:
if (!function_exists('handle_bbcode_as'))
{
function handle_bbcode_as(&$parser, $code, $type)
{
return handle_bbcode_highlight( $parser, $code, 'ActionScript' );
}
}
$this->tag_list['no_option']['ActionScript'] = array(
'callback' => 'handle_external',
'strip_empty' => true,
'stop_parse' => true,
'disable_smilies' => true,
'disable_wordwrap' => true,
'strip_space_after' => 1,
'external_callback' => 'handle_bbcode_as'
);
I've looked everywhere, and I can't figure out where in vb 3.5.2 the above code would be included.
EDIT: Nevermind - I fixed it. I had to add it to the XML file itself. Everything works now :)
:surprised:
kirupa
12-24-2005, 08:32 PM
I swear, this will be my final question!
When pasting code that has been highlighted, the vertical line spacing is no longer retained in IE. All pasted code appears in one line, and for functions containing comments, it makes the code unusable unless line breaks are manually added.
Is there a fix for that? There are examples of that problem here: http://www.kirupa.com/forum/showthread.php?p=1737670
It works well in FF though.
EDIT: I was able to modify the bbcode_highlight template to the following to fix it - though spacing seems a bit off:
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">$type $vbphrase[code]:</div>
<div class="alt2" style="margin:0px; font-family:Courier New; padding:$stylevar[cellpadding]px; border:1px inset; width:$stylevar[codeblockwidth]; height:{$blockheight}px; overflow:auto"><div dir="ltr" style="text-align:left;">$code</div></pre>
</div>
:ermm:
Wildthinks
01-02-2006, 03:54 PM
Hi,
seems are a little bit buggy on this:
1. Can you please change that the line number dont copied, when i copy the code. Is very strange, when you post code and the other must delete line numbers...
2. this["foo"] -> was converted to this["foo"]
I like this and have installed, but i hope the buggy items are fixed soon.
Thomas
kirupa
01-05-2006, 09:58 PM
In my previous post, I fixed the IE copy/paste issue by replacing the pre tag with a div. The problem is that the code now wraps. Does anybody have a way of fixing the IE copy/paste issue while retaining no-wrapping of code?
Thanks!
Kirupa :squareeyed:
marc_t
01-11-2006, 10:13 PM
Thanks!
Is working now.
marc_t
01-12-2006, 07:39 AM
Works really great. Only thing is that I didn't manage to get a button to the editor. With usual vb-code this is no problem as the vb-code option allows to define a grafik. But how to do this for this hack? I searched in several forums and got no really heloing answer.
maybe here? ;)
thanks,
marc
marc_t
01-13-2006, 08:23 AM
I cant figure out a little thing: A squared bracket open doesn't show up in the code. For example:
_root["ball"+i].x=100
shows up as
_root& #91;"ball"+i].x=100 (without the space between & and #)
Any help where to find the line I have to change? Checkes "actionscript.php" in the geshi folder, but with no success.
Thanks!
marc_t
01-17-2006, 07:04 AM
No help? No idea? :(
Any hint?
;)
lutek
01-25-2006, 08:39 PM
No help? No idea? :(
Any hint?
;)
I have the same problem :(
marc_t
01-26-2006, 08:52 AM
Would be really great to get any hint where to find the code which replaces the "["...
Thanks very much....
lutek
01-27-2006, 08:56 AM
Would be really great to get any hint where to find the code which replaces the "["...
Thanks very much....
change in file geshi/actionscript.php line
'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
to:
'COMMENT_SINGLE' => array(1 => '//'),
kirupa
01-28-2006, 09:28 PM
When a post containing some highlighted code is edited, I am not seeing the code back in its normal form with the [highlight=foo] brackets. Instead, I am seeing the actual box with the code inside it similar to a WYSIWYG mode.
Is there a problem with using the highlighter with the full WYSIWYG mode in VB3?
Thanks,
Kirupa
marc_t
01-30-2006, 07:59 AM
lutek: Great! Thanks alot!!
shabbirbhimani
02-08-2006, 07:08 AM
It does not work on v3.0.7, right? ;)
Good Job!
I have made it to work with 3.0.x versions as weel and you can check that at my forums. Link in sig. You can see the running version of the same at one of the thread Query optimization (http://www.go4expert.com/forums/showthread.php?t=565). I am not sure if I can put that here or not but if you need it I can probably give it to you.
Delphiprogrammi
03-04-2006, 12:17 PM
this no longer works on 3.5.4 anybody with the same problem ? i upgraded geshi then it started to stop working then downgraded it again but nope ... this just stopped working without a "reason" why
edit
i've fixed it the urls are hyperlinked again in PHP source code i liked that feature so i've played with it and got it back.It wasn't this hack it was geshi itself that changed some stuff anyway if anybody wants it give me a yell
TKlingler
03-29-2006, 04:39 AM
Hello, it works great also with the new geshi version,
I have only a littel problem when I use the it so charackters of me script part will displayed wrong. As example the right text is [Setup] with the Highlighter it will dispayed as [Setup]with geshi and phpbb this works so I think it comes for the xml, but I understand not we becaues I konw nothig about php.
Pleas can anyone say me what I must do ?
northcode
04-01-2006, 04:00 AM
I couldn't be bothered to track it down any further than something in the geshi line numbering (too much regex crap) but this will fix the immediate problem.
Open geshi.php and find this line
var $lexic_permissions = array(
Then scroll down a bit and comment or remove this entry from the array (setting it to false may also work, but it felt better to hit the delete key).
'NUMBERS' => true,
Tim Goss
Northcode Inc.
ffevo
04-03-2006, 10:04 PM
This is a problem I am having with ALL code on my forums including the code that your modification uses. In the first attachment you will see that there is a large space at the bottom of all the code.
That was the first issue.
You will also see that all the code used with YOUR modification does not get highlighted at ALL AND is on one line. You can see that on the second attachment.
I also wanted to change the highlight colors of ALL code including PHP. I also wanted to change the default font for highlighted code from courier new to something else. I use 10px font size and courier new is just too small for 10px. I would like to change the font face NOT the size.
Delphiprogrammi
04-25-2006, 02:56 PM
everytime you update Geshi it stops working ?????
if (!function_exists('handle_bbcode_highlight'))
{
function handle_bbcode_highlight(&$parser, $code, $type)
{
global $vbulletin, $vbphrase, $stylevar, $show;
static $codefind1, $codereplace1, $codefind2, $codereplace2;
$code = $parser->strip_front_back_whitespace($code, 1);
if (!is_array($codefind))
{
$codefind1 = array(
'<br>', // <br> to nothing
'<br />' // <br /> to nothing
);
$codereplace1 = array(
'',
''
);
$codefind2 = array(
'>', // > to >
'<', // < to <
'"', // " to ",
'&', // & to &
'[', // [ to [
']', // ] to ]
);
$codereplace2 = array(
'>',
'<',
'"',
'&',
'[',
']',
);
}
$code = trim(str_replace($codefind1, $codereplace1, $code));
$blockheight = $parser->fetch_block_height($code) + 18; // fetch height of block element
$code = str_replace($codefind2, $codereplace2, $code); // finish replacements
$path = DIR . '/includes/geshi/';
//$code = geshi_highlight($code, $type, $path, true);
$geshi = new GeSHi($code, $type, $path);
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
$geshi->set_url_for_keyword_group($group, $url);
$geshi->set_link_target('_BLANK', $styles);
$tabs = 4;
$geshi->set_header_type(GESHI_HEADER_DIV);
$geshi->set_tab_width($tabs);
$code = $geshi->parse_code();
$code = preg_replace('/&#([0-9]+);/', '&#$1;', $code);
$code = str_replace(array('[', ']', "\n"), array('[', ']', ''), $code);
$template = $parser->printthread ? 'bbcode_highlight_printthread' : 'bbcode_highlight';
eval('$html = "' . fetch_template($template) . '";');
return $html;
}
}
$this->tag_list['option']['highlight'] = array(
'callback' => 'handle_external',
'strip_empty' => true,
'stop_parse' => true,
'disable_smilies' => true,
'disable_wordwrap' => true,
'strip_space_after' => 1,
'external_callback' => 'handle_bbcode_highlight'
);
require_once(DIR . '/includes/geshi.php');
still the php keywords are not linked :mad: damn it
blueaura
05-04-2006, 02:59 PM
Any way to get this to plug into the code button? The by doign example code [/ code] it would automatically replace it with [highlight=Java] example code [/ highlight].
This would be much easier for less technical forum users to work and means the admin could limit the syntax highlighting to one specific language like Java if you run a Java programming forum.
Previously I got Geshi to work on the code button but I had to hack the php code for BBcode. Nice to see a more friendly way to get Geshi in there now anyway.
ffevo: You can change fonts and colours by editing the php.php file or what ever language you are using in /incudes/geshi
Also would like to suggest the following changes
[code]if (!is_array($codefind))
{
$codefind1 = array(
'<br>', // <br> to nothing
'<br />' // <br /> to nothing
);
$codereplace1 = array(
'',
''
);
$codefind2 = array(
'>', // > to >
'<', // < to <
'"', // " to ",
'&', // & to &
'& #91;', // without the space after the &
'& #93;', // ] without the space after the &
);
$codereplace2 = array(
'>',
'<',
'"',
'&',
'[',
']',
);
}
It sorts out the issue with square brackets.
EDIT: you can edit includes/class_bbcode.php to get the plugin to use [code] with a bit of hacking. Can't be doign with that at the moment so I'm back at my own method. The author of this mod may want to explore this though.
kirupa
05-04-2006, 04:54 PM
So, basically, does the highlighter work in vBulletin 3.5.4? I recall not being able to get it to work in an earlier vB 3.5.x version, so I have delayed updating my boards because of it.
blueaura
05-04-2006, 05:55 PM
So, basically, does the highlighter work in vBulletin 3.5.4? I recall not being able to get it to work in an earlier vB 3.5.x version, so I have delayed updating my boards because of it.
Yes it works
bullzeye
07-16-2006, 10:04 PM
Is there any way to change the location of Geshi? For use with other parts of our site we had a directory /lib where geshi can be found and for update work and similarity on out other parts we want to place geshi in the folder /lib/geshi. I changed the path and the require_once in the xml-file of this plugin to lib/geshi (for $path) and require_once('lib/gehsi/geshi.php'). Installation was no problem and it seems that this gets parsed correctly but there is no highlightning only a gray Background with line numbers. I hope it is possible to understand what i want.
Excuse my bad english.
StarShaper
08-16-2006, 06:30 PM
Is there any way to change the location of Geshi?
You have to change the include path. Just edit the plugin code.
There is a problem with this product. If you do a manual cache update of all Postings all geshi Code Blocks are deleted.
zylstra
12-27-2006, 08:56 AM
I changed it to be CODE instead of HIGHLIGHT (more natural to me) and I added a little extra to have it intercept the normal PHP and HTML tag calls. :)digitalpoint, care to share your modification with us?
zylstra
12-27-2006, 10:51 AM
When I place <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en">
<head>
<base href="http://www.example.com/" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
inside the tags with the html4strict option I get
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[ur l="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/ur l]">
<html dir="ltr" lang="en">
<head>
<base href="[ur l="http://www.example.com/"]http://www.example.com/[/ur l]" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> without the space between the "ur" and the "l". It seems that URLs are parsed into links within code blocks, but this fails inside the Geshi parsed code. How do I turn off URL parsing within code blocks?
vB.org parses URLs inside posts, but not inside code blocks. This is how I want my site to work also.
Test: http://www.example.com/
zylstra
12-27-2006, 05:21 PM
I discovered that the automatic URL linking is due to the WYSIWYG interface in IE: http://www.vbulletin.com/forum/bugs35.php?do=view&bugid=2018&status=60 .
zylstra
12-27-2006, 05:38 PM
Have you any hint, where i can switch the width for bbcode code to 100%?
Thank you
thomas
Well, you can change it here, Styles & Templates -> Style Manager -> StyleVars -> Sizes and Dimensions -> Code Block Width, but IE will stretch the entire page to the dimension of the code.
delaen1
01-15-2007, 04:42 PM
Anyone know if this still works with 3.6.4?
Gryphon
01-18-2007, 09:34 PM
Yes
Smike
03-05-2007, 11:22 AM
Thank you !
How can i add a button when i reply ?
Andrijeski
04-12-2007, 01:18 PM
Works fine so far, thanks :)
Florian Bernd
05-17-2007, 01:06 PM
Mhh .. look at my problem:
http://img248.imageshack.us/img248/940/syntaxev0.jpg
On the next edit the spaces got lost and some chars are maleformed .. =(
James Edwards
05-18-2007, 07:37 AM
I can confirm that this works in 3.6.4; you can update the range of available languages by grabbing the latest version of "geshi.php" and the "geshi" directory from the developer's site -- http://qbnz.com/highlighter/
I fixed the square bracket issue (which also happens with percentage symbols) by adding the following line to the parse_code function in geshi.php (just before "// Initialise various stuff"):
$code = str_replace(array('[', ']', '%'), array('[', ']', '%'), $code);
(Can't get the entitities to show up unparsed - the first array of replacements should be numeric entities 91, 93 and 37)
Florian Bernd
05-20-2007, 10:48 AM
Thank you .. with this line it works fine for me .. but the bug with the tabs and spacings does already exists =/ After preview or on edit all spaces and tabs bevore the commands are missing .. Any ideas?
James Edwards
05-22-2007, 12:11 AM
Not yet, I'm still trying to hack a solution for that!
James Edwards
05-25-2007, 03:48 AM
Okay there's a few different things contributing to the whitespace/line-break formatting problems. I had to hack quite a bit to fix all this, so I've just uploaded my edited gehsi.php -- http://www.brothercake.com/clients/geshi.zip
All the changes I made begin with a comment that says "20070518 -- brothercake". Apart from fixing these issues, I've also removed the list markup (because line-numbers were being copied into the clipboard in some browsers), while retaining fancy lines (alternate line highlighting). And I've also stripped out some of the markup it generates - everything apart from what's actually needed!
To make these changes work I also had to comment out four lines from the product (the code inside the XML file):
//################################################## ##############
//20070518 -- brothercake mod commented these lines so we can control from geshi.php directly
// $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
// $tabs = 4;
// $geshi->set_header_type(GESHI_HEADER_DIV);
// $geshi->set_tab_width($tabs);
//################################################## ##############
Hope this is useful :) It's all pretty brutal, but it works!
sidhighwind
08-09-2007, 12:14 AM
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:
foreach (array('code', 'php', 'html','highlight') AS $pre_tag)
{
if (isset($this->tag_list['no_option']["$pre_tag"]))
{
$this->tag_list['no_option']["$pre_tag"]['callback'] = 'handle_preformatted_tag';
unset($this->tag_list['no_option']["$pre_tag"]['html'], $this->tag_list['option']["$pre_tag"]['strip_space_after']);
}
if (isset($this->tag_list['option']["$pre_tag"]))
{
$this->tag_list['option']["$pre_tag"]['callback'] = 'handle_preformatted_tag';
unset($this->tag_list['option']["$pre_tag"]['html'], $this->tag_list['option']["$pre_tag"]['strip_space_after']);
}
}
2. Replace `handle_preformatted_tag` function with this code on line 179
function handle_preformatted_tag($code)
{
$current_tag =& $this->current_tag;
if($current_tag['option']) {
return "[$current_tag[name]=$current_tag[option]]" . $this->emulate_pre_tag($code) . "[/$current_tag[name]]";
} else {
return "[$current_tag[name]]" . $current_tag['option']. " ". $this->emulate_pre_tag($code) . "[/$current_tag[name]]";
}
}
waldbauer.com
08-10-2007, 07:33 AM
Hello !
Where can i define the WIDTH of code display ?
In Firefox it looks a little bit too small -> http://www.waldbauer.com/vb/showthread.php?p=5552#post5552
EDIT: I see the auto feature has a problem with IE, which correct size in px to use instead ?
Vertex [HW-F]
08-16-2007, 08:06 AM
]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 vb Code tag the color format (and any othe format) doesn't get delete like using the [php] vb Code tag.
example:
[highlight=vb]coloredtext
coloredtext
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!
Vertex [HW-F]
08-17-2007, 05:31 AM
]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:
'#\[(html|php)\]((?>[^\[]+?|(?R)|.))*\[/\\1\]#siUe', // strip html from php tags
to (whatever your tagsname is, here I added highlight)
'#\[(html|php|highlight)\]((?>[^\[]+?|(?R)|.))*\[/\\1\]#siUe', // strip html from php tags
Dean C
10-21-2007, 01:55 PM
Hi everyone,
Where would I add this code to enable only [as] functionality:
if (!function_exists('handle_bbcode_as'))
{
function handle_bbcode_as(&$parser, $code, $type)
{
return handle_bbcode_highlight( $parser, $code, 'ActionScript' );
}
}
$this->tag_list['no_option']['ActionScript'] = array(
'callback' => 'handle_external',
'strip_empty' => true,
'stop_parse' => true,
'disable_smilies' => true,
'disable_wordwrap' => true,
'strip_space_after' => 1,
'external_callback' => 'handle_bbcode_as'
);
I've looked everywhere, and I can't figure out where in vb 3.5.2 the above code would be included.
EDIT: Nevermind - I fixed it. I had to add it to the XML file itself. Everything works now :)
:surprised:
Could anyone explain exactly how to add an [actionscript] tag please? With documented steps. The information in this thread on how-to do it are very sparse :) Thanks
Coders Shack
01-22-2008, 08:00 PM
I can confirm that this works in 3.6.4; you can update the range of available languages by grabbing the latest version of "geshi.php" and the "geshi" directory from the developer's site -- http://qbnz.com/highlighter/
I fixed the square bracket issue (which also happens with percentage symbols) by adding the following line to the parse_code function in geshi.php (just before "// Initialise various stuff"):
$code = str_replace(array('[', ']', '%'), array('[', ']', '%'), $code);
(Can't get the entitities to show up unparsed - the first array of replacements should be numeric entities 91, 93 and 37)
$code = str_replace(array('&#'.'91'.';', '&#'.'93'.';', '&#'.'37'.';'), array(chr(91), chr(93), chr(37) ), $code);
works wonders.
the browser parses the characters, so the line of code i posted should work via copy & paste
Sph1nX
03-27-2008, 06:56 PM
Installed successfully on 3.6.8 pl2 =)
Last problem is, I want to make the to [vb]
If I try to use a custom bbcode like [vb] which replaces [highlight=vb]{param} it doesn`t work :(
Someone knows how to make this working? German/English help for me would be nice :D
xEnco
04-17-2008, 03:34 PM
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 My VB code, so I made a new vB Tag with the following content: {param}
But the problem is when I click on the button and add my text it doesnt highlight anything and just shows My Text
Do you know how to fix this?
Dashman
05-20-2008, 02:03 PM
Will this work with 3.7.0 ?!
waldbauer.com
06-02-2008, 01:54 PM
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 ?
TheRayden
07-18-2008, 10:42 PM
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?
FleyerShaver
07-20-2008, 10:15 PM
Does this Addon work correctly with 3.7.2pl1?
DevFuture.de
08-28-2008, 08:44 PM
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]
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.
[B]Developed a Solution. Check next Post.
DevFuture.de
08-31-2008, 01:19 PM
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
/**
* Insert Email Link
*/(its around Line 1890, if you haven?t modified it)
after this function enter the following:
/**
* Insert Visual Basic .NET Quellcode [(c) 2008 Dennis Alexander Petrasch, EntwickelerGemein.de]
*/
this.vbnet = function(e)
{
var selection = this.get_selection();
return this.insert_text('' + selection + '');
};
/**
* Insert Visual C# Quellcode [(c) 2008 Dennis Alexander Petrasch, EntwickelerGemein.de]
*/
this.csharp = function(e)
{
var selection = this.get_selection();
return this.insert_text('' + selection + '');
};
/**
* Insert XML Quellcode [(c) 2008 Dennis Alexander Petrasch, EntwickelerGemein.de]
*/
this.xml = function(e)
{
var selection = this.get_selection();
return this.insert_text('' + selection + '');
};
You can replace the XML Csharp oder VB.net Statement, if you want to highlight another language.
Search for
case 'insertimage':(its around Line 2633, if you already paste the content below)
Insert following Code, after the Case statement
// (c) 2008 Dennis Alexander Petrasch [http://www.EntwickelerGemein.de]
case 'vbnet':
{
var selection = this.get_selection();
this.wrap_tags('highlight', 'VB.net', selection);
return;
}
case 'csharp':
{
var selection = this.get_selection();
this.wrap_tags('highlight', 'CSharp', selection);
return;
}
case 'xml':
{
var selection = this.get_selection();
this.wrap_tags('highlight', 'xml', selection);
return;
}
Just save the File and upload it to your Server. Now you need to edit your Editor-Template in your Editor.
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:
<if condition="$show['php_bbcode']">
<td><div class="imagebutton" id="{$editorid}_cmd_wrap0_php"><img src="$stylevar[imgdir_editor]/php.png" width="16" height="16" alt="$vbphrase[wrap_php_tags]" /></div></td>
</if>
Add after this:
Optional: If you like to add a seperator, then add the following code first
<td><img src="$stylevar[imgdir_editor]/separator.gif" width="6" height="16" alt="" /></td>
<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>
<td><div class="imagebutton" id="{$editorid}_cmd_xml"><img src="$stylevar[imgdir_editor]/xml.png" width="16" height="16" alt="XML Quellcode einf?gen" /></div></td>
<td><div class="imagebutton" id="{$editorid}_cmd_csharp"><img src="$stylevar[imgdir_editor]/cs.png" width="16" height="16" alt="Visual C# 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.
I hope you enjoy this code, and it helps you to enchance the advanced Syntax Highlighter. If you need more information on this, please ask via mail or in my German .NET Development Board:
www.EntwicklerGemein.de
or via Mail
dennis@EntwicklerGemein.de
DevFuture.de
09-24-2008, 03:36 PM
There is an error while converting [ and ] - Characters. Here is the Solution:
Open the product-advhighlight.xml and find:
$codefind2 = array(
'>', // > to >
'<', // < to <
'"', // " to ",
'&', // & to &
'& #91;', // [ to [ (remove the spacebar between & and #-Char)
'& #93;', // ] to ] (remove the spacebar between & and #-Char)
);
and replace the text with
$codefind2 = array(
'>', // > to >
'<', // < to <
'"', // " to ",
'&', // & to &
'[', // [ to [
']', // ] to ]
);
and it works well.
Xtrato
10-16-2008, 02:29 PM
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.
DevFuture.de
01-30-2009, 12:04 PM
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.
Simon Lloyd
02-17-2009, 10:02 AM
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.
DevFuture.de
02-21-2009, 08:58 AM
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.
Simon Lloyd
02-21-2009, 10:56 AM
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.
Dev. thanks for getting back, you are right it isn't supported by geshi, however the geshi users say it has to be parsed by some other code to indent it, i know its not that simple as in VBA code the indentation is tiered, i.e (without the >'s)
For Each.....
>>>If............Then
>>>>>Do something
>>>>>>>If......then
>>>>>>>>>Do something
>>>>>>>End If
>>>End If
Nextit is possible as i have seen it at www.vbaexpress.com
eliteevil
04-17-2009, 09:34 AM
Great Stuff
ti07shadow
09-27-2009, 08:43 PM
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
Meestor_X
12-20-2009, 10:29 PM
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/
Meestor_X
12-20-2009, 10:34 PM
Waiting with baited breath to see this mod in vb4! :)
smirnoff
12-23-2009, 05:25 PM
i've just install it on 3.8.4 and work perfectly, better than all the other i've tested! amazing :D
artvs
12-27-2009, 10:07 AM
I'd successfully adapt this hack for VB4. Not sure can I share my efforts with everyone?
simunaqv
12-27-2009, 10:08 AM
Oh please do..
artvs
12-27-2009, 10:54 AM
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
WHERE title IN ('bbcode_quote', 'bbcode_php', 'bbcode_code', 'bbcode_html', 'bbcode_video')
replace it with
WHERE title IN ('bbcode_quote', 'bbcode_php', 'bbcode_code', 'bbcode_html', 'bbcode_video', 'bbcode_highlight')
4) find
'bbcode_video' =>& $bbcodelist["$tlist[bbcode_video]"],
add afrer
'bbcode_highlight' =>& $bbcodelist["$tlist[bbcode_highlight]"],
5) find
'bbcode_video' => intval($tlist['bbcode_video_styleid']),
add after
'bbcode_highlight' => intval($tlist['bbcode_highlight']),
5) upload this file to ftp
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.
b6gm6n
01-26-2010, 05:27 AM
fixed my no-color problem, paths were out...great mod thanks
EDAInsight
01-29-2010, 01:10 PM
Can this mod be used in VB 4.x ?
erosolmi
02-07-2010, 07:26 PM
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
Sadikb
02-13-2010, 04:25 PM
Confirmed working with VB 4.0.1 according to changes suggested by artvs. Thanks mate.
JarkkoL
03-03-2010, 05:55 PM
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
lightbox
03-04-2010, 01:32 PM
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
Same here *sigh*
JarkkoL
03-21-2010, 08:58 AM
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:
if(!is_array($specialtemplates))
$specialtemplates = array();
above this line:
$specialtemplates = array_merge($specialtemplates, array('bbcode_highlight','bbcode_highlight_printab le'));
JarkkoL
03-21-2010, 01:20 PM
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 (http://qbnz.com/highlighter) (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 (:
the_bolo
03-22-2010, 09:36 AM
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.
JarkkoL
03-22-2010, 01:09 PM
Strange, I tried rebuilding the post cache but don't have the problem.
AshMagic
04-15-2010, 11:52 AM
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?
golsby
04-15-2010, 06:37 PM
I hacked this for VB4 and my own personal preferences, then installed it. Works great!
zeroality
06-02-2010, 08:27 PM
Installed artvs' modified product, as found here (https://vborg.vbsupport.ru/showpost.php?p=1939314&postcount=108). 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!
mariohn
06-03-2010, 09:56 PM
I can not get this to work on vB4.0.3
Can someone post a step by step guide for 4.0.3 Please, I really need this mod to get my forums going.
digitalpoint
06-04-2010, 07:44 PM
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 (http://forums.digitalpoint.com/misc.php?do=bbcode#code)).
petreza
08-14-2010, 04:28 PM
Can anyone confirm that this Add-on (https://vborg.vbsupport.ru/showpost.php?p=1939314&postcount=108) 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 (https://vborg.vbsupport.ru/showpost.php?p=2007541&postcount=116) just to get it to work in 4.0.2 so I imagine it would take more for 4.0.5
lutek
08-23-2010, 06:32 PM
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 (http://forums.digitalpoint.com/misc.php?do=bbcode#code)).
could you attach your modification?
XLD_Bull
09-19-2010, 12:08 PM
Hi all,
Really interesting but I have 2 big issues to use it definitely :
1 - It deletes spaces before the code
James had a solution but impossible to download it. :-(
https://vborg.vbsupport.ru/showpost.php?p=1254246&postcount=80
Does someone else fixed it?
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
AshMagic
12-09-2010, 12:31 PM
Hi all,
Really interesting but I have 2 big issues to use it definitely :
1 - It deletes spaces before the code
James had a solution but impossible to download it. :-(
https://vborg.vbsupport.ru/showpost.php?p=1254246&postcount=80
Does someone else fixed it?
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**.
AshMagic
12-09-2010, 01:48 PM
Can confirm that:
https://vborg.vbsupport.ru/showpost.php?p=1939314&postcount=108
Works with 4.1.0.. Kind of!
There is an error when visiting the CMS though :(
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/class_bbcode.php(194) : eval()'d code on line 11
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/class_bbcode.php(194) : eval()'d code on line 11
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/class_bbcode.php(194) : eval()'d code on line 11
AshMagic
12-09-2010, 09:03 PM
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 (http://qbnz.com/highlighter) (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 :D
erosolmi
12-26-2010, 11:00 AM
Does someone has a working xml file to be used in 4.1?
Thanks a lot
Sadikb
02-06-2011, 11:41 AM
I have attached my working copy on 4.0.6. May work on 4.1 also.
Edit: Just Tested and this works fine on VB 4.1.1
waldbauer.com
06-20-2011, 06:04 AM
Hello !
I use this a while but now i have troubles with highlighting ASM code.
Instead [ i always get [ - can this be fixed by myself ?
enivid2008
10-15-2011, 12:32 PM
If anyone else here isn't fond of the plugin removing all formatting spaces and tabs in the first line of the code, you can do the following change:
Find:
$code = trim(str_replace($codefind1, $codereplace1, $code));
Replace with:
$code = rtrim(ltrim(str_replace($codefind1, $codereplace1, $code), "\n\r\o\x0B"));
ellenthompson
07-14-2013, 12:59 PM
i upload gashi.php in /include directory
i also upload xml in product upload from admincp.
where i upload this :
"the geshi Directory (which includes all the Language Files) to Direcotry includes"
i also see this error
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/class_bootstrap.php(1419) : eval()'d code on line 125
please suggest me the solution
Gillysnyter
01-06-2014, 08:32 PM
So I can post any code such as Java in the discussion and it will show up woth multple of colors like Notepad ++?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.