vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Trying to figure out an update from 3.6 to 3.7.4... (https://vborg.vbsupport.ru/showthread.php?t=201943)

MTGDarkness 01-16-2009 04:01 AM

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?

Dismounted 01-16-2009 04:47 AM

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.

MTGDarkness 01-16-2009 01:29 PM

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!

Dismounted 01-17-2009 10:51 AM

Sorry, I meant bbcode_create. But also, PHP doesn't lie. :D (Meaning it has already been declared.)

MTGDarkness 01-17-2009 11:49 AM

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?


All times are GMT. The time now is 12:27 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.01064 seconds
  • Memory Usage 1,716KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete