SMF Syntax Highlighter
by X3mE, version 0.1b
Description
This modification will add extra functionality to the
code BBC tag, enabling syntax highlighting when a language code is passed as a parameter. For example:
[ code=langname]Some code here...[/ code]
The old-fashioned code display will still be available, if used without any parameters.
The list of supported highlighting "brushes" can be seen above the post box, as a new combo box.
Works with both SMF 1.1.7 and 2.0 Beta 4. There are no setting in the admin panel, nor database entries.
Note: This modification is still
beta and hasn't been submited on the SMF Mod site yet.
Screenshot
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi20.photobucket.com%2Falbums%2Fb242%2Fx3me88%2FScreenshot.png&hash=afe0e99217ea057fe32845dfed03d5f13c083366)
Live Demo: http://x3me.iz.rs/index.php?board=11.0
Changelog
* Version 0.1b (02. 02. 2009.)
- Initial version for SMF 2.0 Beta 4 and SMF 1.1.7
Credits
Based on the free
Syntax Highlighter 1.5.1, written by Alex Gorbatchev.
Project Home Page (http://code.google.com/p/syntaxhighlighter/)
Notes
Please post all your support questions and comments in the support thread. You can also use the Issue Tracker (http://x3me.iz.rs/index.php?project=5) on the Demo Website (http://x3me.iz.rs/).
Note: For issues regarding the highlight itself, it would probably be best to notify the author of the original script here (http://code.google.com/p/syntaxhighlighter/issues/list). You can also notify me, and I'll try to fix it myself.
Languages
Languages included:
- English (english, english-utf8)
- Serbian (serbian, serbian-utf8, serbian-utf8-lat)
To translate it to your own language, add the translation for:
$txt['SMF_Syntax_Highlighting'] = 'Syntax Highlighting';
$txt['SMF_Syntax_Highlighting_C'] = 'C';
$txt['SMF_Syntax_Highlighting_Csharp'] = 'C#';
$txt['SMF_Syntax_Highlighting_Cpp'] = 'C++';
$txt['SMF_Syntax_Highlighting_ColdFusion'] = 'ColdFusion';
$txt['SMF_Syntax_Highlighting_CSS'] = 'CSS';
$txt['SMF_Syntax_Highlighting_Delphi'] = 'Delphi';
$txt['SMF_Syntax_Highlighting_HTML'] = 'HTML';
$txt['SMF_Syntax_Highlighting_Java'] = 'Java';
$txt['SMF_Syntax_Highlighting_JavaScript'] = 'JavaScript';
$txt['SMF_Syntax_Highlighting_Pascal'] = 'Pascal';
$txt['SMF_Syntax_Highlighting_Perl'] = 'Perl';
$txt['SMF_Syntax_Highlighting_PHP'] = 'PHP';
$txt['SMF_Syntax_Highlighting_PlSQL'] = 'Pl/SQL';
$txt['SMF_Syntax_Highlighting_Python'] = 'Python';
$txt['SMF_Syntax_Highlighting_Ruby'] = 'Ruby';
$txt['SMF_Syntax_Highlighting_SQL'] = 'SQL';
$txt['SMF_Syntax_Highlighting_VB'] = 'Visual Basic';
$txt['SMF_Syntax_Highlighting_VBNET'] = 'VB .NET';
$txt['SMF_Syntax_Highlighting_XML'] = 'XML';
$txt['SMF_Syntax_Highlighting_XHTML'] = 'XHTML';
in the appropriate Modifications.language.php file. You are welcome to post your translations in the support topic.
Note: This will probably be changed (new stuff added) before the mod gets submited.Donations
If you like this mod, please donate to support its further development. Any amount would be highly appreciated. Thank you.
(https://www.paypal.com/en_US/i/btn/btn_donateCC_LG_global.gif) (https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2EV33MU7KLM5A&lc=GB&item_name=SMF%20modifications&item_number=smf¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG_global%2egif%3aNonHosted)
Ok, I'm waiting for some feedback :)
If this has a select link to highlight code AND can display syntax with configurable colours for Microsoft INI based files (example)
[entry]
attribute = variable
attribute = variable
attribute = variable
I will literally have a womb implanted in me so I can have your babies (ok thats a bit extreme, but this is a feature I really REALLY would like)
Currently there ain't a brush for ini files, but I'll try to make one. All colors are customizable, but you'll have to edit the java script sources.
I seem to have accidentally removed the Select button while modifying how the code tag works for SMF 2 :P. I'll fix that.
I think this might be the same script i integrated in the summer, but ditched because of buggy parsing of php code.
Looks nice :)
Quote from: regularexpression on February 02, 2009, 12:26:55 PM
I think this might be the same script i integrated in the summer, but ditched because of buggy parsing of php code.
TBH, I haven't tested highlighting thoroughly for various pieces of code yet, but I did see on the project home page that there are some issues with parsing "complicated" code. Should be fine for most cases, though.
Since Geshi prohibits distribution for SMF, this is the best replacement I could find (plus, it does everything on the client side :P, unlike Geshi), and I desperately needed this for one of my forums.
Quote from: Nas on February 02, 2009, 12:27:34 PM
Looks nice :)
Thanks :)
All I actually need is the code block to parse JUST ini code, with a select link next to the top of it so that people can click to highlight the whole code.
If you can provide just this, I can't see it as being too much of a trouble for you with the simplicity of the INI format and the fact the code to select I'm assuming you already have.
The reason for me wanting this is because I run a site dedicated to a particular game called Microsoft Freelancer, it makes extensive use of INI files to operate and to allow us to modify it.
Here is an example file:
[Cockpit]
mesh = cockpits\civilian\models\cv_cockpit.cmp
int_brightness = 0.500000
head_turn = 35, 15
[TurretCamera]
tether = 0.000000, 12.970000, 41.888000
yaw_rotate_speed = 2.000000
pitch_rotate_speed = 1.500000
accel_speed = 5
So you'd basically be changing the colour of [entry] and the first word of the lines that come after such as accel_speed, the = sign and then the values after, which can be both words or numbers
Unfortunately my experience in PHP is limited, so if you can add this functionality, that would be utterly fantastic!
Ok, I'll see what I can do :).
excelent like notepad++, line by line :P, a question what programing languages support?
So far: C, C++, C#, ColdFusion, CSS, Delphi, HTML, Java, JavaScript, Pascal, Perl, PHP, Pl/SQL, Python, Ruby, SQL, Visual Basic, VB .NET, XML, XHTML.
The next version will include Bash, Groovy, Scala and probably INI.
I'm sure you are going to have a drop down list to select the language, but for those of us running forums that may say for example only require one to be parsed, an option for a default language would be awesome, then all I need do is remove the list box.
I'm sure you are also going to make the languages themselves into seperate files so that if someone comes across a language thats missing they can add it that way.
Just some thoughts
Yes, all languages are in separate files, so you can add/remove whatever you like.
There won't be any settings panel in the ACP (at least not for now), so you'd have to do what you ask manually, but it's not complicated, I'll tell you what to edit.
I wasn't speaking of settings in ACP, I just meant a drop down list in the post page so if you want to say drop code in for PHP you'd just select that and press the code button, maybe the code would have something like [ code = php ] [ /code ] once inserted, this way you could change the drop down again and click code to something else, like [ code = ini ] [ /code ].
If you get my meaning...
Currently you just select the piece of code in the post box, pick a language from the drop down and the selected text is automatically surrounded with the code=selectedlang tag. No need for an extra click. When I implement INI, it'll surely be in that drop down.
If you'd prefer to have only one language highlighted, it's more appropriate to use a let's say simple image (like some other bbcodes), instead of a drop down, but you can implement it how ever you want.
Btw, it's been a while since I've played Freelancer, but definitely one of the best games ever :P
Heh, the modders of Freelancer have come up with some truly awesome stuff, the project I'm leading is designed to improve the original engine with a lot of the stuff people have come up with over the years.
In the effects department alone there have been leaps and bounds compared to the original game.
You should pop by to the site once its finished once in a while, maybe play it again, theres a nice and simple fix to microsoft shutting down the global server, the community now has its own hehe.
If you have the time, I know that you are probably extremely busy, I'm having an issue with quick reply (in another thread not too far from yours) if you could assist I would be extremely grateful, as its the only feature not working correctly at the moment :(
Looking forwards to having this syntax highlight on our forum, it's going to be a very nice touch to see syntax highlighting for freelancer modding code, especially one that people can just click [ select ] and copy into their own projects!
Quote from: X3mE on February 02, 2009, 12:43:23 PM
Quote from: regularexpression on February 02, 2009, 12:26:55 PM
I think this might be the same script i integrated in the summer, but ditched because of buggy parsing of php code.
TBH, I haven't tested highlighting thoroughly for various pieces of code yet, but I did see on the project home page that there are some issues with parsing "complicated" code. Should be fine for most cases, though.
Since Geshi prohibits distribution for SMF, this is the best replacement I could find (plus, it does everything on the client side :P, unlike Geshi), and I desperately needed this for one of my forums.
Quote from: Nas on February 02, 2009, 12:27:34 PM
Looks nice :)
Thanks :)
off topic
you sure geshi isn't allowed on SMF ? i've been running that mod for some time now on my own site here: http://javaforums.net/ and it works great but if you can't use it then i guess i have to take it down.
On topic
Nice mod!
It's allowed to be used, but not allowed to be distributed, or at least something like that, I do know the mod was removed from the mod site.
Thanks :)
Regarding selecting and copying code... If you take a better look at the "box" which holds the code, there's a Copy to clipboard button. The problem is, it doesn't work very well in all browsers (it works in IE and Opera, copies line numbers in Firefox, don't know about Chrome and Safari), but I'm not sure if there's anything that can be done about that... (When will all browsers start to display all pages equally??? :P)
The Select all button is there by default in SMF 2, but I guess I could also implement it in SMF 1.1.7. The easiest way which works in all cases is to open the plain text popup window, Ctrl+A, Ctrl+C and there you have it :).
Been any updates on this?
Didn't have time to work further on it yet, I'm quite busy IRL now, will continue development from next week :)
Looks good, but it is no use to my forum. Would be GREAT in webmaster forums.
Excellent, I've nearly finished my site now lol, except its missing an INI syntax highlighting feature *hint hint* lol.
Just joking, at your own pace buddy, at your own pace :D
Wow this is great.
What's the best way to add a new language? Just copy\edit one of the "shBrush???.js" files....
I want to create an AutoLISP brush.
I notice Alex Gorbatchev updated his Syntax Highlighter, does that effect your Mod?
Once I find some time I will update it to Alex's new version, and add some more features. And yes, just copy/edit a shBrushXXX.js file.
I know it's in BETA, but have you thought about submitting it to the Customize site? Or wont it make it past the current requirements? Looks like a great mod, that is lost at times in the see of general SMF coding threads.
Why do these blank spaces get removed?
@Rumbaar
I have been planing to do so after the release of the next version.
@bazzacad
I'm not sure :/
I suppose it's fixed in the new version of Alex's Syntax Highlighter.
Great Mod ;) You really should thought about submitting it to the Customize site :D
Here is the Portuguese Translation:
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['SMF_Syntax_Highlighting'] = 'Destaque de Sintaxe';
$txt['SMF_Syntax_Highlighting_C'] = 'C';
$txt['SMF_Syntax_Highlighting_Csharp'] = 'C#';
$txt['SMF_Syntax_Highlighting_Cpp'] = 'C++';
$txt['SMF_Syntax_Highlighting_ColdFusion'] = 'ColdFusion';
$txt['SMF_Syntax_Highlighting_CSS'] = 'CSS';
$txt['SMF_Syntax_Highlighting_Delphi'] = 'Delphi';
$txt['SMF_Syntax_Highlighting_HTML'] = 'HTML';
$txt['SMF_Syntax_Highlighting_Java'] = 'Java';
$txt['SMF_Syntax_Highlighting_JavaScript'] = 'JavaScript';
$txt['SMF_Syntax_Highlighting_Pascal'] = 'Pascal';
$txt['SMF_Syntax_Highlighting_Perl'] = 'Perl';
$txt['SMF_Syntax_Highlighting_PHP'] = 'PHP';
$txt['SMF_Syntax_Highlighting_PlSQL'] = 'Pl/SQL';
$txt['SMF_Syntax_Highlighting_Python'] = 'Python';
$txt['SMF_Syntax_Highlighting_Ruby'] = 'Ruby';
$txt['SMF_Syntax_Highlighting_SQL'] = 'SQL';
$txt['SMF_Syntax_Highlighting_VB'] = 'Visual Basic';
$txt['SMF_Syntax_Highlighting_VBNET'] = 'VB .NET';
$txt['SMF_Syntax_Highlighting_XML'] = 'XML';
$txt['SMF_Syntax_Highlighting_XHTML'] = 'XHTML';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['SMF_Syntax_Highlighting'] = 'Destaque de Sintaxe';
$txt['SMF_Syntax_Highlighting_C'] = 'C';
$txt['SMF_Syntax_Highlighting_Csharp'] = 'C#';
$txt['SMF_Syntax_Highlighting_Cpp'] = 'C++';
$txt['SMF_Syntax_Highlighting_ColdFusion'] = 'ColdFusion';
$txt['SMF_Syntax_Highlighting_CSS'] = 'CSS';
$txt['SMF_Syntax_Highlighting_Delphi'] = 'Delphi';
$txt['SMF_Syntax_Highlighting_HTML'] = 'HTML';
$txt['SMF_Syntax_Highlighting_Java'] = 'Java';
$txt['SMF_Syntax_Highlighting_JavaScript'] = 'JavaScript';
$txt['SMF_Syntax_Highlighting_Pascal'] = 'Pascal';
$txt['SMF_Syntax_Highlighting_Perl'] = 'Perl';
$txt['SMF_Syntax_Highlighting_PHP'] = 'PHP';
$txt['SMF_Syntax_Highlighting_PlSQL'] = 'Pl/SQL';
$txt['SMF_Syntax_Highlighting_Python'] = 'Python';
$txt['SMF_Syntax_Highlighting_Ruby'] = 'Ruby';
$txt['SMF_Syntax_Highlighting_SQL'] = 'SQL';
$txt['SMF_Syntax_Highlighting_VB'] = 'Visual Basic';
$txt['SMF_Syntax_Highlighting_VBNET'] = 'VB .NET';
$txt['SMF_Syntax_Highlighting_XML'] = 'XML';
$txt['SMF_Syntax_Highlighting_XHTML'] = 'XHTML';
]]></add>
</operation>
</file>
wery nice :)
Been any updates on this?
Thanks DeviDarkL ;)
pimosz, I'm very busy at my faculty right now, but once I find some spare time there will be an update, and I hope that will come soon ;).
No problem X3mE ;)
It would be cool if BBC existed like the codes in different color that the other text ;D Just an idea of course eheh!
Only work in default theme, why?
You need to update your template files for your custom theme manually. This link should help you:
http://docs.simplemachines.org/index.php?topic=402
thank you very much ;)
I need help with changeing Subs.php ..
what do I have to find and replace with?
Unpack the installation, open the modification.xml file in a text editor (od modification_1.xml if you're using SMF 1.1.x), and find the
<file name="$sourcedir/Subs.php">
line. Under there you have to replace everything surrounded by
<search position="replace"><![CDATA[
and
]]></search>
with the text surrounded by
<add><![CDATA[
and
]]></add>
Let me know if you need any further assistance.
Very good mod ;)
Thanks
Fel
Two bugs I have found ..
1.. missing global $context in Subs.php (gives errors)
corrected code:
'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
global $context;
/* We must revert all earlier parsning, we need the clean code only */
$data[0] = strtr($data[0], array(\'&#91;]\'=> \'[]\', \'&#91;&#039;\'=> \'[&#039;\', \'<br />\'=> "\n",));
$data[0] = un_htmlspecialchars($data[0]);
'),
2.. have the first line of code a tab character, then the display is not correct.
See attached image.
Fel
Thanks, I'll look into that.
How can i get in on the beta test?
Everyone can download and test it :)
It's attached in the first post on page 1 of this topic.
Could you add a description for manual installation? .. please .. for smf1.1.8
blocks of c code with includes have a
</stdio.h> appended to them, which is not accurate. I think this is because of the
#include <stdio.h> at the beginning of the block
I'll attach a pic.
There will be an update soon, updating the background "engine" which does the highlight, I suppose many of the highlighting errors will be fixed.
Can't say exactly when, as I'm overwhelmed with studies and work obligations, but I'll do my best to find some time.
X3mE,
Great job!
I only found a problem until now: it doesn't work with WYSIWYG editor :(
Are you planning to include that ?
What exactly is the problem with WYSIWYG?
Quote from: X3mE on April 27, 2009, 01:21:36 PM
What exactly is the problem with WYSIWYG?
Hi,
The problem is that the tags doesn't show in the editor after you select the code. It works very fine with the regular editor but with that one don't.
I got an javascript error:
QuoteWebpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 1.1.4322; InfoPath.1)
Timestamp: Mon, 27 Apr 2009 17:52:16 UTC
Message: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.
Line: 401
Char: 3
Code: 0
URI: http://www.-----.org/testplatform/forumteste/Themes/default/scripts/script.js?rc1
Thanks for the reply!
hi there.
this is a brilliant mod. been looking for one of these everywhere.
any chance of an update to working with 2.0 rc1?
cheers.
It is working with RC1 :)
thank you very much for this.
just to confirm, this works fine on 2.0 RC1.1 :D
brilliant mod.
i would donate but im afraid i'm pretty strapped for cash. ill donate when i can ;).
one feature request that would be great though, is for it to all be in a small scrolling box rather than all stretched out for long codes.
Before you submit it to the mods site, I suggest you change 1.0 - 1.99.99 to 1.1 - 1.1.99 in the mod file, unless you actually *did* test with SMF 1.0 ;)
Hi I may have spotted a potential security risk or it may just be an annoying bug but it should be fixed either way.
The php code tags (possibly other web development languages too) some of the code actually displays.
Like for example text fields sometimes display etc.
Hope this helps :)
nice mod
When it will be submited in the mod site ??
Arabic translation (utf-8) :
$txt['SMF_Syntax_Highlighting'] = 'شفرة برمجية';
$txt['SMF_Syntax_Highlighting_C'] = 'C';
$txt['SMF_Syntax_Highlighting_Csharp'] = 'C#';
$txt['SMF_Syntax_Highlighting_Cpp'] = 'C++';
$txt['SMF_Syntax_Highlighting_ColdFusion'] = 'ColdFusion';
$txt['SMF_Syntax_Highlighting_CSS'] = 'CSS';
$txt['SMF_Syntax_Highlighting_Delphi'] = 'Delphi';
$txt['SMF_Syntax_Highlighting_HTML'] = 'HTML';
$txt['SMF_Syntax_Highlighting_Java'] = 'Java';
$txt['SMF_Syntax_Highlighting_JavaScript'] = 'JavaScript';
$txt['SMF_Syntax_Highlighting_Pascal'] = 'Pascal';
$txt['SMF_Syntax_Highlighting_Perl'] = 'Perl';
$txt['SMF_Syntax_Highlighting_PHP'] = 'PHP';
$txt['SMF_Syntax_Highlighting_PlSQL'] = 'Pl/SQL';
$txt['SMF_Syntax_Highlighting_Python'] = 'Python';
$txt['SMF_Syntax_Highlighting_Ruby'] = 'Ruby';
$txt['SMF_Syntax_Highlighting_SQL'] = 'SQL';
$txt['SMF_Syntax_Highlighting_VB'] = 'Visual Basic';
$txt['SMF_Syntax_Highlighting_VBNET'] = 'VB .NET';
$txt['SMF_Syntax_Highlighting_XML'] = 'XML';
$txt['SMF_Syntax_Highlighting_XHTML'] = 'XHTML';
please before put the translation in the file be sure that the file encode is UTF-8
Nice mod. ;)
How can we add another programming language to it?
Aw just the mod i was looking for. Why the ****** wouldnt gesi work with SMF, if its open sourced why wouldnt we be able to use it with this forum software?
Either way this one ur using looks nicer overall, just doesnt support as many languages
Because you need to integrate the two. GeSHi on its own doesn't have anywhere to link to SMF, so you have to add code to link the two. I just don't think it's been fully done yet.
GeSHi is under the GPL, and the license interaction with SMF keeps it from being used. If the developers were to use a less restrictive license, I don't think there would be such a problem.
I have a problem with operator "<"
like Axcess when have problem with include
if i want #include <name.h>
dint work
like cout<<variable<<endl;
endl error
variable error
name.h error
if i set cout<< variable<< endl;
works, but....can fixed that ??
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimage.gxzone.com%2Fimages%2F8%2F5%2F85117ab732c.jpg&hash=07aaaf46cd6959c39c9bf1d4767a47afb527eb2f)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimage.gxzone.com%2Fimages%2F8%2F6%2F8668079910e.jpg&hash=2c7c32eaac502165840978fd1b68f11b97ecde2d)
Nice mod.
Is there a language file for AutoIt (http://autoitscript.com) syntax highlighting?
P.S
The copy link does not working in Opera browser.
Really nice customisation, works a treat for programming oriented sites :)
however my current theme seems to override how code is displayed :( on the default theme it works fine, however on anything other than SMF's default theme, the nice code block and line numbering simply do not show up. Is there a setting i am missing or some kind of configuration.
The theme i am using is DarkZ ~ http://custom.simplemachines.org/themes/index.php?lemm
Is it in development any more..?
It would be nice to see a version based on SyntaxHighlither 2.0 and running on smf 2.0 RC2
Can you do it?
I'm into it, but still with the Syntax Highlighter 1.5.1
The Syntax Highlighter 2.1.364 is pretty hard to implement and this is some work to do.
My version 2.0a of this MOD (RC2 only) is already running on my test board, but can't find the way to implement the dropdownlist, I'm not the only one who want to put another dropdownlist to the editor, but nobody's want to tell us how to ?
http://www.simplemachines.org/community/index.php?topic=345402.0
So for the moment I must use the BBcode button with the type of code.
It isn't so much that no-one wants to, more like no-one really knows outside the dev team. To my knowledge that other thread is the only place it's been discussed.
So any idea when you are going to have a new version? The one you have there seems good but I'd like something stable to put on my forum. The new forum I have working isn't going public before 1 month so if you are going to release something better within that month I'll wait. But the community I work for has more that 10 000 users and many coders who will enjoy this function if it's working properly.
Great work by the way! (and the person who developed this syntax highlighter is even greater, sorry :P)
If you want to give it a try
Notes:
- Alpha stage
- Doesn't work with quick edit (at this time)
- Only for SMF 2.0 RC2
Well I'm running RC1.2 at the moment. Guess I should update to RC2 but I have a lot of mods installed. I'll contact you later maybe.
2.xx doesn't give many more functionality. It will be nice to run it but if it is hart to implement then it isn't must have I think... Not for me for sure. ;)
I've installed your beta, and it runs. But it destroyed linebreaks in my code. Please see the attachment.
If I add html <br/> it breaks the line... but it is impossible to do in 100lines code...
Also it would be nice if you fix the < > problem.
Quote from: wilkolak on November 19, 2009, 08:17:30 PM
2.xx doesn't give many more functionality. It will be nice to run it but if it is hart to implement then it isn't must have I think... Not for me for sure. ;)
I've installed your beta, and it runs. But it destroyed linebreaks in my code. Please see the attachment.
If I add html <br/> it breaks the line... but it is impossible to do in 100lines code...
Also it would be nice if you fix the < > problem.
yeah, me too.... and we should change < into <and > into > manually
I'm waiting too.
Can't wait till you get this working guys, my board could really use this! ( on a side note, I've downloaded the package and seeing if I can't hack the source into shape... I'll keep you posted. So if these guys don't get it done, I'm going to do my best to ensure there is something out there )
I love this mod and want to use it for a work-related site. Here's my problem: I need to support ActionScript 3.0 syntax. I have created a shBrushAS3.js brush. If I copy that to the js directory on the server and manually edit the Subs.php file to include 'shBrushAS3' in the appropriate array then everything works fine.
If I add the shBrushAS3.js to the mod's zip file and upload and install the package that way it works ok, but obviously I need to edit the install-1.x.xml file to reflect the new array value. So, if I extract the install-1.x.xml file, amend it accordingly, and put it back into the zip file, I can upload the mod, but when I try to apply it I get a "Modification parse error". Even if all I do is extract install-1.x.xml from the zip and put it back again unchanged I still get this error.
Any clues as to what I should be doing differently?
[EDIT] Ok, sussed it. It seems there is something in the way OS X zip applications which produces archives that SMF doesn't like. I fired up VMware, opened a Windows session and did the file changes using 7zip. And it worked fine.
So, anyone got any workarounds for how to modify the zip files on OS X without having to resort to opening a Windows session?
[EDIT2] And how do you integrate it with other themes? I followed the link two pages back but the page concerned doesn't seem to address this.
[EDIT3] Ok, solved it. If you want to use this mod with other themes, here's what you do. Using the theme editor in the SMF admin panel, edit the 'index.template.php' file for each theme you want to apply Syntax Highlighter to.
Find:
<title>', $context['page_title'], '</title>';
And put this beneath it:
// Syntax Highlighting javascript...
syntaxHighlightingJavascript();
Then, find Sources/Subs.php and edit that. You need to find the 'function syntaxHighlightingJavascript()' section. Inside that function replace every occurrence of
theme_url
with default_theme_url
. I think there were four occurrences.
And that should do it.
I typed [code =C++] CODE [/ code] (no spaces ofc) and why do I have this?
Thank you in advance. :)
People I need some help!!
My version is 2.0 RC3 and when I try to install it doesn't work!! (Many tests not passed)
What should I do?
Thanks
Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402.0)
I've tried that but I can't get it to work :S
Maybe I'm doing something wrong..
What version should I download to work with 2.0 RC3?
Thanks
Quote from: johnny mercy on July 10, 2010, 04:43:25 PM
I've tried that but I can't get it to work :S
Maybe I'm doing something wrong..
What version should I download to work with 2.0 RC3?
Thanks
Yes, it works with 2.0 RC2-RC3.
Simple paste your code between tags [ code=language] ... [/code ]
Example (w\o spacebars):
Quote[ code=xml]xml-code[/code ]
What version should I download? Your version?
And where should I put that code? xD (i'm little noob when it comes to install mods manually)
Thanks
OK so I have installed this mod and I am just getting this...
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg823.imageshack.us%2Fimg823%2F4476%2F79171873.jpg&hash=00335d74c5420e3585539d21d4fdaa6a355b5c2a)
Can anyone help me please?
My forum is version 2 RC3 and the link is graphics-post.com
Thanks in advance,
Mike
Quote from: RockerMan on August 09, 2010, 03:49:18 PM
OK so I have installed this mod and I am just getting this...
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg823.imageshack.us%2Fimg823%2F4476%2F79171873.jpg&hash=00335d74c5420e3585539d21d4fdaa6a355b5c2a)
Can anyone help me please?
Thanks in advance,
Mike
You can start here: How do I ask support questions the smart way? (http://docs.simplemachines.org/index.php?topic=494.0)
Dude, I only forgot the link and version....
Added it
you never mentioned which version you've installed. maybe these info is not too important for you, but it's very important for people who might help you
I liked Syntax Highlighter. But please help me. I am new in SMF and I couldn't do anything. how can ı install that. Thanks :)
Information :
SMF 2.0 RC3
Hi there !
I successfully installed latest version of this mod from Bugo but i'm having some issues :
- Live news from SimpleMachines isn't displayed - in admin section.
- Version Check is working but "Current SMF version: ??" is displayed - in admin section.
- Detailed Version Check is having the same issue.
I've searched around files and it's actually this mod which is creating a mess. When i comment this in Sources/Load.php :
syntaxHighlightingJavascript();
Everything is working fine back.
Admin.js is present and working fine when i look at sources i can actually see latest news inside.
Any advice ? Thanks !
ill download it later,
Zyos: Send me a link to the forum i own that game! I love it!
Thanks a lot Kcmartz !
For others :
I also fixed a little bug : code bbcode without parameters wasn't working.
Find this :
'tag' => 'code',
'type' => 'unparsed_equals_content',
'content' => '<div class="codeheader">' . $txt['code'] . ': <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>',
// !!! Maybe this can be simplified?
Replace with :
'tag' => 'code',
'type' => 'unparsed_content',
'content' => '<div class="codeheader">' . $txt['code'] . ': <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>',
// !!! Maybe this can be simplified?
Wow, I just put in a request for this a little bit ago. I'll give this a try.
/e/ Nevermind, it doesn't look like this is for 2.0 RC3.
It is ! You have to install by emulated RC2 fist this one :
http://www.simplemachines.org/community/index.php?topic=290024.msg2360372#msg2360372
Then this one :
http://www.simplemachines.org/community/index.php?topic=290024.msg2648453#msg2648453
I may try to merge those two in one package if you prefer (without some extra code that isnt necessary).
Lets go.
Here's my version of this mod based on Sirius OCTeam (http://www.simplemachines.org/community/index.php?action=profile;u=64930) and Bugo (http://www.simplemachines.org/community/index.php?action=profile;u=229017) version.
It fixes some problems :
- [ code]...[ /code] without equals parameters
- News from SimpleMachine in admin panel
And a little bit of cleaning code.
Feel free to edit/copy/distribute this, if you have any problem just post here or private message since i'm not coming often on SimpleMachine boards.
Tested on fresh install of SMF 2.0 RC3 only.
Quote from: Nuks on October 05, 2010, 05:16:51 AM
Lets go.
Here's my version of this mod based on Sirius OCTeam (http://www.simplemachines.org/community/index.php?action=profile;u=64930) and Bugo (http://www.simplemachines.org/community/index.php?action=profile;u=229017) version.
It fixes some problems :
- [ code]...[ /code] without equals parameters
- News from SimpleMachine in admin panel
And a little bit of cleaning code.
Feel free to edit/copy/distribute this, if you have any problem just post here or private message since i'm not coming often on SimpleMachine boards.
Tested on fresh install of SMF 2.0 RC3 only.
Tested on a modified SMF. Worked fine for me!
I made an update using latest Syntax Highlighter by Alex Gorbatchev. There is only one bug in preview : content between code isn't parsed. Do you mind looking at it Kcmartz ? :)
You have to uninstall 2.0 first.
no I don't mind, I can't do it tonite, but tomorrow morning I can!
Did you take a look ? :)
forgot i got busy the day i said i could, and class is over, sorry
which one should i use for linux shell highlight??
btw getting this error,
* 1. Execute Modification ./Sources/Subs-Editor.php Test successful
1. Add After ./Sources/Subs-Editor.php Test successful
* 2. Execute Modification ./Sources/Subs.php Test failed
1. Replace ./Sources/Subs.php Test failed
* 3. Execute Modification ./Themes/default/Post.template.php Test failed
1. Add After ./Themes/default/Post.template.php Test failed
* 4. Execute Modification ./Themes/default/GenericControls.template.php Test failed
1. Add After ./Themes/default/GenericControls.template.php Test failed
2. Add After ./Themes/default/GenericControls.template.php Test failed
* 5. Execute Modification ./Themes/default/scripts/editor.js Test successful
1. Add After ./Themes/default/scripts/editor.js Test successful
6. Execute Modification ./Themes/default/scripts/xml_topic.js File not found
* 7. Execute Modification ./Themes/default/index.template.php Test successful
1. Add Before ./Themes/default/index.template.php Test successful
2. Add Before ./Themes/default/index.template.php Test successful
* 8. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
1. Add Before ./Themes/default/languages/Modifications.english.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english-utf8.php Skipping file
10. Execute Modification ./Themes/default/languages/Modifications.serbian.php Skipping file
11. Execute Modification ./Themes/default/languages/Modifications.serbian-utf8.php Skipping file
12. Execute Modification ./Themes/default/languages/Modifications.serbian-utf8-lat.php Skipping file
This mod is outdated and is not compatible with the latest version.
which mod should i use then?
Hi, there is a syntax highlighter mod, working on SMF 2.0 RC5?
Thanks
You are not allowed to redistribute a mod with changes you made, without permission from the mod author. Removing your attachment.
Quote from: thepisu on March 07, 2011, 06:11:05 PM
I modified "Highlight for SMF" to work in SMF 2.0 RC5. I'm attaching here if someone needs it.
I cannot find the original post / page for this mod.. sorry
To 2.0rc5 exist this?
You can try Code Highlighting (http://dragomano.ru/page/mods-for-smf-english).
any updates for SMF v2.0.2?
@carloscuev, for 2.0.2 you should try this => cb|GeShi-mod (http://custom.simplemachines.org/mods/index.php?mod=3070) :)