Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 05-09-2004, 02:56 AM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Recreate [code] tag functionality for [as], etc.

Hey everyone,
I like how the code tag retains formatting of any code entered. My problem is that in vB2, I introduced a tag for ActionScript using a 3rd party AS-code formatter. Alas, the code formatter no longer works in VB3.

So, I am trying to recreate the effects of the [ code] tag and apply to it the [as] tag feature so that the all of the code from the older threads from vb2 and earlier still display properly.

I tried going to the bb code manager and entering: [ code]{param}[/ code] for the [as] tag, but the [ code ] was simply not interpreted. I was informed at vbulletin.com to post my request here instead.

Does anybody have any similar solutions? Thanks!

Cheers!
Kirupa
Reply With Quote
  #2  
Old 06-16-2004, 04:10 PM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let's not all jump in and answer at the same time

Is there a way though? I tried various methods to trick vB into thinking that [as] would be seen as PHP, but that did not work well.

Thanks!
Kirupa
Reply With Quote
  #3  
Old 06-16-2004, 04:22 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, you have to edit functions_bbcodeparse.php there are the code-html... tags defined.

you have to create an code handler function, depending on the third party script code
Reply With Quote
  #4  
Old 06-16-2004, 04:25 PM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Xenon! I will give that a shot
Reply With Quote
  #5  
Old 06-17-2004, 12:29 AM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you happen to know of a guide or forum post that outlines how to accomplish that? I looked through that PHP file and it is overwhelming.

I am not interested in re-creating the AS effect at this point. All I would like to do is display the same results when a user types [as][/as] as when a user types [ code ] [/ code]

Thanks!
Kirupa
Reply With Quote
  #6  
Old 06-17-2004, 05:41 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ahh, well that's quite easy then

in functions_bbcodeparse.php find:
PHP Code:
        $bbcodes['custom']['find']['[code]'] = '#\[code\](<br>|<br />|\r\n|\n|\r)??(.*)(<br>|<br />|\r\n|\n|\r)??\[/code\]#esiU';
        
$bbcodes['custom']['replace']['[code]'] = "handle_bbcode_code('\\2')";
        
$bbcodes['custom']['recurse']['code'][0] = array('handler' => 'handle_bbcode_code'); 
and below just add:
PHP Code:
        $bbcodes['custom']['find']['[as]'] = '#\[as\](<br>|<br />|\r\n|\n|\r)??(.*)(<br>|<br />|\r\n|\n|\r)??\[/as\]#esiU';
        
$bbcodes['custom']['replace']['[as]'] = "handle_bbcode_code('\\2')";
        
$bbcodes['custom']['recurse']['as'][0] = array('handler' => 'handle_bbcode_code'); 
Reply With Quote
  #7  
Old 06-17-2004, 07:05 PM
marc_t marc_t is offline
 
Join Date: Mar 2002
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks... will check it right now. Is this also working with the php-Code?

It is not the solution I wanted in original, but for now, if it is working, it gives time to try finding a better way..
Reply With Quote
  #8  
Old 06-17-2004, 07:46 PM
marc_t marc_t is offline
 
Join Date: Mar 2002
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, made this one with the php Tag. Is working fine. Duplicated the section with bbcode_php and made a new template to have the code marked as "ActiionScript".

Any idea how I can make codelines indented?

Thanks so far!
marc
Reply With Quote
  #9  
Old 06-18-2004, 12:18 AM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Xenon - that worked brilliantly! Now, I duplicated a PHP-like section, duplicated a bbcode_as template, and everything works. And, now, where are the color-coding for PHP defined? For I would like to color code the AS tags, and I would like to duplicate the PHP color codes and modify it slowly as time progresses.

Thanks!
Kirupa
Reply With Quote
  #10  
Old 06-18-2004, 10:49 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, the color coding of php isn't a thing vbulletin brought in, it's something build in in PHP itself.

best hint for ya is to take a close look at the html code handler in the functions_bbcodeparse.php file, so you can find out how the html tag works and then rewrite that for the as tags
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:14 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.08310 seconds
  • Memory Usage 2,251KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete