vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   BB Code Enhancements - Syntax Highlighter (https://vborg.vbsupport.ru/showthread.php?t=182422)

TradeOfAllJacks 11-17-2008 05:16 PM

Any chance for actionscript 2/3 support for this? I've been trying to find a good 3.7 syntax highlighter but to no avail.

veenuisthebest 04-24-2009 08:04 AM

This mod works good in 3.8.x, I have two questions please:-

1. Is there any chance of getting this done without file edits?

2. Any way of showing the old default vb's style of code, when javascript is disabled on the user's browser?

Thanks

beduino 06-02-2009 06:41 PM

thank you lizard king!
all the best
beduino

sheppardzwc 06-02-2009 07:31 PM

Great! Just what we needed.

wo0kie 06-18-2009 05:56 PM

EDIT: Fixed, had to enable legacy support:

http://alexgorbatchev.com/wiki/Synta...hter:Upgrading

Demo: http://www.joinuv.com/forums/showthread.php?t=17316

stanleys 07-23-2009 10:41 PM

Thanks. It would be great if you could package this is a mod, and make it so it overwrites the standard [code] tag.
SitePoint has a nice implementation with a code list dropdown, it would be great to have something like that.

AshMagic 12-09-2009 08:40 PM

Can anyone please confirm if this works with vBulletin 3.8.4?

Thanks.

Mike09 08-07-2010 12:36 AM

Works perfectly with vB 4.0.x with a minor modification in the first code block,

Code:


        /**
        * Handles a [ high ] tag. Displays a preformatted string.
        *
        * @param        string        The code to display
        *
        * @return        string        HTML representation of the tag.
        */
        function handle_bbcode_high($code , $option)
        {
                global $vbulletin, $vbphrase, $stylevar, $show;

                // remove unnecessary line breaks and escaped quotes
                $code = str_replace(array('<br>', '<br />'), array('', ''), $code);

                $code = $this->strip_front_back_whitespace($code, 1);

                if ($this->printable)
                {
                        $code = $this->emulate_pre_tag($code);
                        $template = 'bbcode_high_printable';
                }
                else
                {
                        $blockheight = $this->fetch_block_height($code);
                        $template = 'bbcode_high';
                }

        //        eval('$html = "' . fetch_template($template) . '";');
        //        return $html;


                $templater = vB_Template::create($template);
                        $templater->register('blockheight', $blockheight);
                        $templater->register('code', $code);
                        $templater->register('option', $option);
                return $templater->render();

        }

        /**
        * Handles a [ high ] tag. Displays a preformatted string.
        *
        * @param        string        The code to display
        *
        * @return        string        HTML representation of the tag.
        */
        function handle_bbcode_high1($code)
        {
                global $vbulletin, $vbphrase, $stylevar, $show;

                // remove unnecessary line breaks and escaped quotes
                $code = str_replace(array('<br>', '<br />'), array('', ''), $code);

                $code = $this->strip_front_back_whitespace($code, 1);

                if ($this->printable)
                {
                        $code = $this->emulate_pre_tag($code);
                        $template = 'bbcode_high1_printable';
                }
                else
                {
                        $blockheight = $this->fetch_block_height($code);
                        $template = 'bbcode_high1';
                }

        //        eval('$html = "' . fetch_template($template) . '";');
        //        return $html;


                $templater = vB_Template::create($template);
                        $templater->register('blockheight', $blockheight);
                        $templater->register('code', $code);
                return $templater->render();



        }

Thanks.

Delphiprogrammi 09-28-2010 01:16 PM

Quote:

Originally Posted by Mike09 (Post 2080329)
Works perfectly with vB 4.0.x with a minor modification in the first code block,

Code:


    /**
    * Handles a [ high ] tag. Displays a preformatted string.
    *
    * @param    string    The code to display
    *
    * @return    string    HTML representation of the tag.
    */
    function handle_bbcode_high($code , $option)
    {
        global $vbulletin, $vbphrase, $stylevar, $show;
 
        // remove unnecessary line breaks and escaped quotes
        $code = str_replace(array('<br>', '<br />'), array('', ''), $code);
 
        $code = $this->strip_front_back_whitespace($code, 1);
 
        if ($this->printable)
        {
            $code = $this->emulate_pre_tag($code);
            $template = 'bbcode_high_printable';
        }
        else
        {
            $blockheight = $this->fetch_block_height($code);
            $template = 'bbcode_high';
        }
 
    //    eval('$html = "' . fetch_template($template) . '";');
    //    return $html;
 
        $templater = vB_Template::create($template);
            $templater->register('blockheight', $blockheight);
            $templater->register('code', $code);
            $templater->register('option', $option);
        return $templater->render();
    }
 
    /**
    * Handles a [ high ] tag. Displays a preformatted string.
    *
    * @param    string    The code to display
    *
    * @return    string    HTML representation of the tag.
    */
    function handle_bbcode_high1($code)
    {
        global $vbulletin, $vbphrase, $stylevar, $show;
 
        // remove unnecessary line breaks and escaped quotes
        $code = str_replace(array('<br>', '<br />'), array('', ''), $code);
 
        $code = $this->strip_front_back_whitespace($code, 1);
 
        if ($this->printable)
        {
            $code = $this->emulate_pre_tag($code);
            $template = 'bbcode_high1_printable';
        }
        else
        {
            $blockheight = $this->fetch_block_height($code);
            $template = 'bbcode_high1';
        }
 
    //    eval('$html = "' . fetch_template($template) . '";');
    //    return $html;
 
        $templater = vB_Template::create($template);
            $templater->register('blockheight', $blockheight);
            $templater->register('code', $code);
        return $templater->render();
 
 
    }

Thanks.

no it doesn't work on 4.0.7 it outputs plain text or is it me here ?

[high]test[/high]

[high1=php]//php code[/high1]

Delphiprogrammi 09-30-2010 01:42 PM

anybody alive around here ? this thing does NOT work


All times are GMT. The time now is 02:24 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.01288 seconds
  • Memory Usage 1,766KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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