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

Reply
 
Thread Tools
Advanced Syntax Highlighting - BBCode [highlight] Details »»
Advanced Syntax Highlighting - BBCode [highlight]
Version: 1.00, by Andreas Andreas is offline
Developer Last Online: Jan 2023 Show Printable Version Email this Page

Version: 3.5.0 RC1 Rating:
Released: 07-27-2005 Last Update: Never Installs: 143
Uses Plugins Template Edits
Additional Files Is in Beta Stage  
No support by the author.

Advanced Syntax Highlighting
This Hack provides a [highlight] BBCode to highlight a wide range of Languages such as XML, HTML, Java, Javascript, SQL and so on.
It uses GeSHi, which is included in this ZIP.

Details
1 Product XML with 2 Plugins and 2 Templates

Please only click Install if you actually have installed/are using this Hack, and click Uninstall whan you don't use it any longer!

Show Your Support

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

Comments
  #42  
Old 11-13-2005, 10:48 AM
garrynewman garrynewman is offline
 
Join Date: Mar 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, finally.. for anyone wanting tags like [sql]code[/sql] and [lua]code[/lua].. here's an example for Lua..

Code:
if (!function_exists('handle_bbcode_lua'))
{
    function handle_bbcode_lua(&$parser, $code, $type)
    {
        return handle_bbcode_highlight( $parser, $code, 'lua' );
    }
}

$this->tag_list['no_option']['lua'] = array(
    'callback' => 'handle_external',
    'strip_empty' => true,
    'stop_parse' => true,
    'disable_smilies' => true,
    'disable_wordwrap' => true,
    'strip_space_after' => 1,
    'external_callback' => 'handle_bbcode_lua'
);
Just add it near the bottom of the bbcode_create hook.
Reply With Quote
  #43  
Old 12-22-2005, 05:59 PM
Wildthinks's Avatar
Wildthinks Wildthinks is offline
 
Join Date: Apr 2002
Location: .:BeRLiN:.
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you any hint, where i can switch the width for bbcode code to 100%?
Thank you
thomas
Reply With Quote
  #44  
Old 12-24-2005, 03:34 PM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

boofo - I was able to retain spacing by changing the code in class_bbcode.php in the includes folder:

// [HIGHLIGHT]
$tag_list['no_option']['highlight'] = array(
'html' => '<span class="highlight">%1$s</span>',
'strip_empty' => false
);
Reply With Quote
  #45  
Old 12-24-2005, 04:39 PM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi everyone,
Where would I add this code to enable only [as] functionality:
Code:
	
	if (!function_exists('handle_bbcode_as'))
	{
	    function handle_bbcode_as(&$parser, $code, $type)
	    {
	        return handle_bbcode_highlight( $parser, $code, 'ActionScript' );
	    }
	}
	
	$this->tag_list['no_option']['ActionScript'] = array(
	    'callback' => 'handle_external',
	    'strip_empty' => true,
	    'stop_parse' => true,
	    'disable_smilies' => true,
	    'disable_wordwrap' => true,
	    'strip_space_after' => 1,
	    'external_callback' => 'handle_bbcode_as'
	);
I've looked everywhere, and I can't figure out where in vb 3.5.2 the above code would be included.

EDIT: Nevermind - I fixed it. I had to add it to the XML file itself. Everything works now

:surprised:
Reply With Quote
  #46  
Old 12-24-2005, 08:32 PM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I swear, this will be my final question!

When pasting code that has been highlighted, the vertical line spacing is no longer retained in IE. All pasted code appears in one line, and for functions containing comments, it makes the code unusable unless line breaks are manually added.

Is there a fix for that? There are examples of that problem here: http://www.kirupa.com/forum/showthread.php?p=1737670

It works well in FF though.

EDIT: I was able to modify the bbcode_highlight template to the following to fix it - though spacing seems a bit off:

[code]<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">$type $vbphrase
Code:
:</div>
	<div class="alt2" style="margin:0px; font-family:Courier New; padding:$stylevar[cellpadding]px; border:1px inset; width:$stylevar[codeblockwidth]; height:{$blockheight}px; overflow:auto"><div dir="ltr" style="text-align:left;">$code</div></pre>
</div>
:ermm:
Reply With Quote
  #47  
Old 01-02-2006, 03:54 PM
Wildthinks's Avatar
Wildthinks Wildthinks is offline
 
Join Date: Apr 2002
Location: .:BeRLiN:.
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

seems are a little bit buggy on this:
1. Can you please change that the line number dont copied, when i copy the code. Is very strange, when you post code and the other must delete line numbers...
2. this["foo"] -> was converted to this["foo"]
I like this and have installed, but i hope the buggy items are fixed soon.

Thomas
Reply With Quote
  #48  
Old 01-05-2006, 09:58 PM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In my previous post, I fixed the IE copy/paste issue by replacing the pre tag with a div. The problem is that the code now wraps. Does anybody have a way of fixing the IE copy/paste issue while retaining no-wrapping of code?

Thanks!
Kirupa :squareeyed:
Reply With Quote
  #49  
Old 01-11-2006, 10:13 PM
marc_t marc_t is offline
 
Join Date: Mar 2002
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!

Is working now.
Reply With Quote
  #50  
Old 01-12-2006, 07:39 AM
marc_t marc_t is offline
 
Join Date: Mar 2002
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works really great. Only thing is that I didn't manage to get a button to the editor. With usual vb-code this is no problem as the vb-code option allows to define a grafik. But how to do this for this hack? I searched in several forums and got no really heloing answer.

maybe here?

thanks,
marc
Reply With Quote
  #51  
Old 01-13-2006, 08:23 AM
marc_t marc_t is offline
 
Join Date: Mar 2002
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cant figure out a little thing: A squared bracket open doesn't show up in the code. For example:

Code:
_root["ball"+i].x=100
shows up as

_root& #91;"ball"+i].x=100 (without the space between & and #)

Any help where to find the line I have to change? Checkes "actionscript.php" in the geshi folder, but with no success.

Thanks!
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 02:39 AM.


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.06193 seconds
  • Memory Usage 2,312KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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
  • (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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete