News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[BETA] SMF Syntax Highlighter

Started by X3mE, February 02, 2009, 11:43:32 AM

Previous topic - Next topic

TheDisturbedOne

Looks good, but it is no use to my forum.  Would be GREAT in webmaster forums.

Zyos

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

bazzacad

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?

X3mE

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.
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



Rumbaar

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.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

bazzacad

Why do these blank spaces get removed?

X3mE

@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.
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



DeviDarkL

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>

rower

wery nice :)

Been any updates on this?

X3mE

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 ;).
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



DeviDarkL

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!

pery77

Only work in default theme, why?

X3mE

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
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



pery77


kromonos

I need help with changeing Subs.php ..
what do I have to find and replace with?

X3mE

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.

Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



feline


feline

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(\'&#38;#91;]\'=> \'[]\', \'&#38;#91;&#38;#039;\'=> \'[&#38;#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

X3mE

Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



Axcess

How can i get in on the beta test?

Advertisement: