Back to vBulletin 4.x Add-ons

SyntaxHighlighter vB 4.X
Mod Version: 1.02, by DarkSupremo

vB Version: 4.0.8 Rating: (4 votes - 4.75 average) Installs: 24
Released: 29 Nov 2010 Last Update: 01 Dec 2010 Downloads: 218
Not Supported Template Edits Additional Files Re-usable Code  

Demo:
http://users.on.net/~mjneish/syntax/test.html
or
http://alexgorbatchev.com/SyntaxHighlighter/about.html

Download the latest version of SyntaxHighlighter attached to the topic.

and upload the "scripts" and "styles" to your root folder in forum.

Create a new BB Code like that:
(AdminCP->Add New BB Code)

Title: XCODE
BB Code Tag Name: xcode
Replacement:
Code:
<script src="/scripts/shCore.js" type="text/javascript"></script>
<script src="/scripts/shAutoloader.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="styles/shCoreDefault.css"/>
<pre class="brush: {option};  toolbar: false;">{param}</pre>
<script type="text/javascript">
function path()
{
  var args = arguments,
      result = []
      ;
  for(var i = 0; i < args.length; i++)
      result.push(args[i].replace('@', '/scripts/'));
  return result
};
SyntaxHighlighter.autoloader.apply(null, path(
  'applescript            @shBrushAppleScript.js',
  'actionscript3 as3      @shBrushAS3.js',
  'ahk autohotkey             @shBrushAhk.js',
  'asm x86             @shBrushAsm.js',
  'bash shell             @shBrushBash.js',
  'coldfusion cf          @shBrushColdFusion.js',
  'cpp c                  @shBrushCpp.js',
  'c# c-sharp csharp      @shBrushCSharp.js',
  'css                    @shBrushCss.js',
  'delphi pascal          @shBrushDelphi.js',
  'diff patch pas         @shBrushDiff.js',
  'erl erlang             @shBrushErlang.js',
  'groovy                 @shBrushGroovy.js',
  'java                   @shBrushJava.js',
  'jfx javafx             @shBrushJavaFX.js',
  'js jscript javascript  @shBrushJScript.js',
  'perl pl                @shBrushPerl.js',
  'php                    @shBrushPhp.js',
  'text plain             @shBrushPlain.js',
  'py python              @shBrushPython.js',
  'ruby rails ror rb      @shBrushRuby.js',
  'sass scss              @shBrushSass.js',
  'scala                  @shBrushScala.js',
  'sql                    @shBrushSql.js',
  'vb vbnet               @shBrushVb.js',
  'xml xhtml xslt html    @shBrushXml.js'
));
SyntaxHighlighter.config.stripBrs = true;
SyntaxHighlighter.all();
</script>
Use {option}: Yes
Remove Tag If Empty: Yes
Disable BB Code Within This BB Code: Yes
Disable Smilies Within This BB Code: Yes
Disable Word Wrapping Within This BB Code: Yes
Disable Automatic Link Parsing Within This BB Code: Yes

Supported language by default:

ActionScript3
Bash/shell
ColdFusion
C#
C++
CSS
Delphi
Diff
Erlang
Groovy
JavaScript
Java
JavaFX
Perl
PHP
Plain Text
PowerShell
Python
Ruby
Scala
SQL
Visual Basic
XML
AutoHotKey
ASM

You can add more unofficial languages if you want, doing that:

- Download the language that you want from here:
http://www.undermyhat.org/blog/2009/09/list-of-brushes-syntaxhighligher/

- Upload the file to scripts folder

- After this line in bbcode (the last one of the lsit)
'xml xhtml xslt html @shBrushXml.js'

- Add:
'ALIASES_HERE @FileNameHere.js'

Exemple, how to use:

[xcode=js] CODE HERE [/xcode]
[xcode=cpp] CODE HERE [/xcode]
[xcode=xml] CODE HERE [/xcode]

For the complete list of options: http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/

Download

File Type: %1$s syntaxhighlighter_3.0.83_FIXED.zip (77.6 KB, 273 downloads)


vblts.ru supports vBulletin®, 2022-2024