Facebook Twitter Pinterest Share

Other vBulletin Requests vBulletin requests that don't fit into other request topics.


New Thread  Post Reply
abitbole's Avatar
abitbole : Newbie +
abitbole is on a distinguished road
offline Joined: Oct 2007 Posts: 7 Thanked: 0
  #1  
Thread Starter Unread 12-24-07
[REQ]Advanced Syntax Highlighting

Can someone upload this for me , please with the modification on the last page ?
Advanced Syntax Highlighting - BBCode [highlight] - vBulletin.org Forum

or if you know how create a bbcode for display some c++ codes.

Thanks and merry christmas
skrazydogz's Avatar
skrazydogz : Member
skrazydogz has a spectacular aura aboutskrazydogz has a spectacular aura about
offline Joined: Dec 2007 Location: USA Posts: 35 Thanked: 5
  #2  
Unread 12-24-07
Here you go and merry christmas

Codes from lastpage:

$code = str_replace(array('[', ']', '%'), array('[', ']', '%'), $code);
//################################################################
//20070518 -- brothercake mod commented these lines so we can control from geshi.php directly                
// $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
// $tabs = 4;
// $geshi->set_header_type(GESHI_HEADER_DIV);
// $geshi->set_tab_width($tabs);
//################################################################
 foreach (array('code', 'php', 'html','highlight') AS $pre_tag)
        {
            if (isset($this->tag_list['no_option']["$pre_tag"]))
            {
                $this->tag_list['no_option']["$pre_tag"]['callback'] = 'handle_preformatted_tag';
                unset($this->tag_list['no_option']["$pre_tag"]['html'], $this->tag_list['option']["$pre_tag"]['strip_space_after']);
            }

            if (isset($this->tag_list['option']["$pre_tag"]))
            {
                $this->tag_list['option']["$pre_tag"]['callback'] = 'handle_preformatted_tag';
                unset($this->tag_list['option']["$pre_tag"]['html'], $this->tag_list['option']["$pre_tag"]['strip_space_after']);
            }
        }
 function handle_preformatted_tag($code)
    {
        $current_tag =& $this->current_tag;

        if($current_tag['option']) {
            return "[$current_tag[name]=$current_tag[option]]" . $this->emulate_pre_tag($code) . "[/$current_tag[name]]";
        } else {
            return "[$current_tag[name]]" . $current_tag['option']. " ". $this->emulate_pre_tag($code) . "[/$current_tag[name]]";
        }
    }
'#\[(html|php)\]((?>[^\[]+?|(?R)|.))*\[/\\1\]#siUe',				// strip html from php tags
'#\[(html|php|highlight)\]((?>[^\[]+?|(?R)|.))*\[/\\1\]#siUe',				// strip html from php tags
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'
	);

Last edited by skrazydogz; 02-24-08 at 02:08 PM.
abitbole's Avatar
abitbole : Newbie +
abitbole is on a distinguished road
offline Joined: Oct 2007 Posts: 7 Thanked: 0
  #3  
Thread Starter Unread 12-25-07
Big thanks skrazydogz
fwhite's Avatar
fwhite : Newbie +
fwhite is on a distinguished road
offline Joined: Dec 2007 Posts: 5 Thanked: 1
  #4  
Unread 12-26-07
where exactly would I put this code in the XML file?

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'
	);
abitbole's Avatar
abitbole : Newbie +
abitbole is on a distinguished road
offline Joined: Oct 2007 Posts: 7 Thanked: 0
  #5  
Thread Starter Unread 12-27-07
i really don't know ...
but it didn't work for me , maybe i miss something.
i guess i will search a custom bbcode for c++ , it will be easier
New Thread  Post Reply

Thread Tools

Bookmarks
  • Submit Thread to Facebook
  • Submit Thread to Twitter
  • Submit Thread to Pinterest
  • Submit Thread to LinkedIn
  • Submit Thread to Reddit
Tags
reqadvanced, highlighting, syntax, [req]advanced
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
Powered by GYSN Underground 2021