Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
SyntaxHighlighter vB 4.X Details »»
SyntaxHighlighter vB 4.X
Version: 1.02, by DarkSupremo DarkSupremo is offline
Developer Last Online: Jan 2011 Show Printable Version Email this Page

Category: Add-On Releases - Version: 4.0.8 Rating:
Released: 11-28-2010 Last Update: 11-30-2010 Installs: 24
Template Edits
Re-useable Code Additional Files  
No support by the author.

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/...taxhighligher/

- 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/SyntaxHigh...anual/brushes/

Download Now

File Type: zip syntaxhighlighter_3.0.83_FIXED.zip (77.6 KB, 271 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-29-2010, 05:25 PM
ImmortalForums ImmortalForums is offline
 
Join Date: Feb 2007
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I recommend you put an if then script statement as loading this much javascript on every page is going to kill your board load times.
Reply With Quote
  #3  
Old 11-29-2010, 05:39 PM
DarkSupremo DarkSupremo is offline
 
Join Date: Nov 2010
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can remove the one that you do not want too...
Reply With Quote
  #4  
Old 11-29-2010, 06:57 PM
smnet smnet is offline
 
Join Date: Feb 2009
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think what ImmortalForums means is that the .js should only really be loaded on thread display pages only, not globally on every single page of the site.
Reply With Quote
  #5  
Old 11-29-2010, 07:36 PM
DarkSupremo DarkSupremo is offline
 
Join Date: Nov 2010
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thread updated,

- Added AutoLoader, to load only the file that you'll use, now it's much more faster.
- Added 2 more supported language: ASM and AutoHotKey
- Removed toolbar
- Removed vertical scrollbar
Reply With Quote
  #6  
Old 11-30-2010, 09:38 AM
aryshi's Avatar
aryshi aryshi is offline
 
Join Date: Sep 2005
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks darksupremo

its not work with me, i tried don't know where is the problem!
Reply With Quote
  #7  
Old 12-01-2010, 11:34 AM
PiroX's Avatar
PiroX PiroX is offline
 
Join Date: Jun 2009
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i m on 4.0.8 vb and it is also not working for me

it does not highlight anything, i tested with [xcode=php]
the only thing what changes is the font and the space between the line, i looked into htlm source and there is no div stlye font or what ever
Reply With Quote
  #8  
Old 12-01-2010, 11:39 AM
PiroX's Avatar
PiroX PiroX is offline
 
Join Date: Jun 2009
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

scripts/shCore.js is missing in the download file!
should it be styles/shCore.css ?!

--

i need to change the include files to absolut paths
altough it does not replace anything
Reply With Quote
  #9  
Old 12-01-2010, 12:06 PM
PiroX's Avatar
PiroX PiroX is offline
 
Join Date: Jun 2009
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

found the problem!
1. the shCore.js is missing, downloaded from the site
2. i need everywhere to set absolut paths in the bbcode replacement

---

if i use more than one xcode option on one page with different types. there comes an error that the brush can not be loaded
Reply With Quote
  #10  
Old 12-01-2010, 01:20 PM
DarkSupremo DarkSupremo is offline
 
Join Date: Nov 2010
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

added the shCore.js that is missing...


about the problem with more than 1 type in the same topic.. it can be problem of loader... if you wanna use like that, you can load everything in the bbcode instead of using the load, like that:


Code:
<script type="text/javascript" src="/scripts/shCore.js"></script>
	<script type="text/javascript" src="/scripts/shAutoloader.js"></script>
	<script type="text/javascript" src="/scripts/shBrushAppleScript.js"></script>
	<script type="text/javascript" src="/scripts/shBrushAS3.js"></script>
	<script type="text/javascript" src="/scripts/shBrushBash.js"></script>
	<script type="text/javascript" src="/scripts/shBrushColdFusion.js"></script>
	<script type="text/javascript" src="/scripts/shBrushCpp.js"></script>
	<script type="text/javascript" src="/scripts/shBrushCSharp.js"></script>
	<script type="text/javascript" src="/scripts/shBrushCss.js"></script>
	<script type="text/javascript" src="/scripts/shBrushDelphi.js"></script>
	<script type="text/javascript" src="/scripts/shBrushDiff.js"></script>
	<script type="text/javascript" src="/scripts/shBrushErlang.js"></script>
	<script type="text/javascript" src="/scripts/shBrushGroovy.js"></script>
	<script type="text/javascript" src="/scripts/shBrushJava.js"></script>
	<script type="text/javascript" src="/scripts/shBrushJavaFx.js"></script>
	<script type="text/javascript" src="/scripts/shBrushJScript.js"></script>
	<script type="text/javascript" src="/scripts/shBrushPerl.js"></script>
	<script type="text/javascript" src="/scripts/shBrushPhp.js"></script>
	<script type="text/javascript" src="/scripts/shBrushPlain.js"></script>
	<script type="text/javascript" src="/scripts/shBrushPowerShell.js"></script>
	<script type="text/javascript" src="/scripts/shBrushPython.js"></script>
	<script type="text/javascript" src="/scripts/shBrushRuby.js"></script>
	<script type="text/javascript" src="/scripts/shBrushSass.js"></script>
	<script type="text/javascript" src="/scripts/shBrushScala.js"></script>
	<script type="text/javascript" src="/scripts/shBrushSql.js"></script>
	<script type="text/javascript" src="/scripts/shBrushVb.js"></script>
	<script type="text/javascript" src="/scripts/shBrushXml.js"></script>
	<script type="text/javascript" src="/scripts/shBrushAhk.js"></script>
	<script type="text/javascript" src="/scripts/shBrushAsm.js"></script>
It will make your forum more slow to load the page that use this bbcode, but is bugless...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04574 seconds
  • Memory Usage 2,327KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete