Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

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
  #12  
Old 12-01-2010, 02:54 PM
PiroX's Avatar
PiroX PiroX is offline
 
Join Date: Jun 2009
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

please upload a version with a max height
Quote:
- Removed vertical scrollbar
Reply With Quote
  #13  
Old 12-01-2010, 08:58 PM
DarkSupremo DarkSupremo is offline
 
Join Date: Nov 2010
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It already have the max height... the scrollbar removed is only a bug that happens with vbulletin, that i fixed.
Reply With Quote
  #14  
Old 12-02-2010, 06:49 AM
Dr.osamA's Avatar
Dr.osamA Dr.osamA is offline
 
Join Date: Aug 2004
Location: Syrie
Posts: 979
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent = 5 stars
insalled

i'll try it on vb 4.1.0
Reply With Quote
  #15  
Old 12-02-2010, 11:43 PM
PiroX's Avatar
PiroX PiroX is offline
 
Join Date: Jun 2009
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It gets very very laggy if you use it multiple times. I removed all languages expect of one
maybe it is better if it gets included one time only. maybe if i put it in header

btw i fixed the scoll bar thing, i just added a max-height: in css
Reply With Quote
  #16  
Old 12-03-2010, 09:47 AM
DarkSupremo DarkSupremo is offline
 
Join Date: Nov 2010
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

only get laggy if you load everything, the idea is use the loader....

and make separated category in your forum, to each language, to no one use more than one in the same topic...
Reply With Quote
  #17  
Old 12-03-2010, 12:07 PM
PiroX's Avatar
PiroX PiroX is offline
 
Join Date: Jun 2009
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I told you i removed all clanguages expect of one languages, because i only need one

the bbcode gets called 60 times in one thread. The thread is a summary of all functions i use in that language, so the file gets included 60 times in this thread and this totally slows down the whole browser while the site is getting loaded. And it takes about 20-30sec, and yes it is much data on one page.
Yes i know i could split it up, but this isn't good atm

is it possible to add that it only gets included one time and only if needed.
Maybe you know what cause the long load time, by the numbers the .js gets included or by the numbers the script has to be its job`?


i'll show you my bbcode
Code:
<script src="http://www.piroxbots.com/forum/scripts/shCore.js" type="text/javascript"></script>
<script src="http://www.piroxbots.com/forum/scripts/shAutoloader.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="http://www.piroxbots.com/forum/styles/shCoreDefault.css"/>
 

<pre style="height: 132px;" class="brush: pt;  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('@', 'http://www.piroxbots.com/forum/scripts/'));
       
  return result
};
 
SyntaxHighlighter.autoloader.apply(null, path(
  'pt           @shBrushAhk.js'
));
SyntaxHighlighter.config.stripBrs = true;
SyntaxHighlighter.all();
</script>
you see i only use shBrushAhk.js as language


btw thank you very very much for this cool mod, thats what i really needed!
Reply With Quote
  #18  
Old 12-08-2010, 10:50 AM
DarkSupremo DarkSupremo is offline
 
Join Date: Nov 2010
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No idea... here it load in less than 1 secound....

But, if you will only use one of then, so use it instead:

Code:
<script type="text/javascript" src="/scripts/shCore.js"></script>
<script type="text/javascript" src="/scripts/shBrushAhk.js"></script>

<pre style="height: 132px;" class="brush: pt;  toolbar: false; ">{param}</pre>

<script type="text/javascript">
SyntaxHighlighter.config.stripBrs = true;
SyntaxHighlighter.all();
</script>
Reply With Quote
  #19  
Old 05-05-2011, 06:57 PM
neal007 neal007 is offline
 
Join Date: Nov 2001
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for the mod. My forum uses one language so I'd rather have an image on the toolbar above that places the code in using the xcode=vb syntax and also if they highlight code then press the button it would work like the # button.

Anyone know how to implement this so my xcode=vb works just like the # button?

Thank you.
Reply With Quote
  #20  
Old 12-27-2012, 03:06 PM
calord calord is offline
 
Join Date: Sep 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone still modding this? It's not working.
Reply With Quote
  #21  
Old 02-19-2013, 09:47 AM
Widey Widey is offline
 
Join Date: Aug 2004
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone managed to get this working in 4.2 recently?

Thanks
Reply With Quote
Reply

Thread Tools

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 05:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07430 seconds
  • Memory Usage 2,329KB
  • Queries Executed 26 (?)
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
  • (3)bbcode_code
  • (1)bbcode_quote
  • (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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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