PDA

View Full Version : Trying to figure out an update from 3.6 to 3.7.4...


MTGDarkness
01-16-2009, 04:01 AM
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'

$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:
$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?