vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Advanced Syntax Highlighting - BBCode [highlight] (https://vborg.vbsupport.ru/showthread.php?t=93071)

garrynewman 11-13-2005 10:48 AM

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.

Wildthinks 12-22-2005 05:59 PM

Have you any hint, where i can switch the width for bbcode code to 100%?
Thank you
thomas

kirupa 12-24-2005 03:34 PM

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
);

kirupa 12-24-2005 04:39 PM

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:

kirupa 12-24-2005 08:32 PM

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:

Wildthinks 01-02-2006 03:54 PM

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

kirupa 01-05-2006 09:58 PM

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:

marc_t 01-11-2006 10:13 PM

Thanks!

Is working now.

marc_t 01-12-2006 07:39 AM

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

marc_t 01-13-2006 08:23 AM

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!


All times are GMT. The time now is 09:35 AM.

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.01161 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete