Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 01-16-2009, 04:01 AM
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Trying to figure out an update from 3.6 to 3.7.4...

I recently received a BBCode modification, and I tried to install it. I got errors. It worked in vBulletin 3.6.x, but not in 3.7.x. What I need to do is get it up and running. It gave my two plugin codes to install:

The first one went in 'BBCode Fetch Tags'

Code:
$tag_list['no_option']['mana'] = array(
		'callback' => 'handle_external',
		'strip_empty' => true,
		'external_callback' => 'handle_bbcode_manacost'
	);
I can understand the first part fine. But for some reason, this brings back an error about handle_bbcode_manacost(); that it doesn't exist. Well, of course. But after I turn on the other part, which defines the function, and stick it in 'Gobal Start', you'd think it would work... It did on 3.6.x. How can I get this certain function (which I believe could work on its own; the only variable not defined within it is $external, and that is not necessary for the primary function thereof) to work as a BBCode?
Reply With Quote
  #2  
Old 01-16-2009, 04:47 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The function (handle_bbcode_manacost) should ideally be inside its own PHP file in the includes directory. That file should be included at the hook bbcode_start.
Reply With Quote
  #3  
Old 01-16-2009, 01:29 PM
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bbcode_start doesn't exist. I tried putting it into bbcode_parse_start and it gives me
Fatal error: Cannot redeclare handle_bbcode_manacost() (previously declared in <snip>/forums/includes/class_bbcode.php(343) : eval()'d code:5) in <snip>/forums/includes/class_bbcode.php(343) : eval()'d code on line 5

And this just confuses me to no end... I'm not redeclaring it; this function has never been declared!
Reply With Quote
  #4  
Old 01-17-2009, 10:51 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I meant bbcode_create. But also, PHP doesn't lie. (Meaning it has already been declared.)
Reply With Quote
  #5  
Old 01-17-2009, 11:49 AM
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

k. Either way, I got it. My solution was to edit the function explanation itself into the class_bbcode_alt.php file, then drop this as a plugin into BBCode_fetch_tags:
Code:
			$tag_list['no_option']['mana'] = array(
				'callback' => 'handle_bbcode_manacost',
				'strip_empty' => true,
				'stop_parse' => true,
			);
Then again, I'm probably doing something stupid or missing something. Thanks for the help though.

Oh wait. There is one thing left:

How can I add a clickable image for it like I would a normal bbcode?
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 01:38 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.05713 seconds
  • Memory Usage 2,192KB
  • 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_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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