The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
BBCode issues again... Getting another error.
Fatal error: Call to undefined function: handle_bbcode_deck() in <snip>/forums/includes/class_bbcode.php on line 1199
Well, here we go again. Errors where there shouldn't be errors. Where am I supposed to define this? When I had the error with a previous BBCode (Mana), I added the function right above the end of class_bbcode_alt.php, and it worked. But this one is giving me trouble. Code:
$tag_list['no_option']['mana'] = array( 'callback' => 'handle_bbcode_manacost', 'strip_empty' => true, 'stop_parse' => true, ); $tag_list['option']['deck'] = array( 'callback' => 'handle_bbcode_deck', 'strip_space_after' => 2, 'strip_empty' => true, ); |
#2
|
||||
|
||||
Your callback should be "handle_external". You should then add another element "external_callback" which you should define your handling function. You should define your functions in bbcode_create, using a require_once() to a file with your functions.
|
#3
|
|||
|
|||
This is odd. See, the thing that's bugging me is, that one of those two tags works perfectly.
Also, can you explain the "add another element" part? Don't get that... |
#4
|
||||
|
||||
PHP Code:
|
#5
|
|||
|
|||
Dammit. Still getting fatal errors.
Fatal error: Call to undefined function: bbcode_deck() in <snip>/includes/class_bbcode.php on line 1426 Dammit. I can't evaluate which line it is effectively at this point... your method didn't work. Code:
$tag_list['option']['deck'] = array( 'callback' => 'handle_external', 'strip_space_after' => 2, 'strip_empty' => true, 'external_callback' => 'bbcode_deck' ); Code:
require_once("http://forums.mtgdarkness.com/includes/bbcode_deck.php"); The bbcode_deck.php file is basically this: Code:
<?php function bbcode_deck($body, $name) { (working function goes here) } ?> |
#6
|
||||
|
||||
You cannot use URLs in includes to include local PHP. It will go to the URL and look at the output from that file, which is not what you want.
PHP Code:
|
#7
|
|||
|
|||
Ah, I see. Thanks. That fixed it.
And how about adding a little clickable icon like with other bbcodes? Is that possible? |
#8
|
||||
|
||||
I think you can do that by editing one of the editor templates (I'm not sure, I have not had any need to do it before), editor_toolbar, maybe?
|
#9
|
|||
|
|||
Yeah, I looked at that before, but the code there is rather... specialized.
This is from editor_toolbar_on. Code:
<if condition="$show['url_bbcode']"> <td><div class="imagebutton" id="{$editorid}_cmd_createlink"><img src="$stylevar[imgdir_editor]/createlink.gif" width="21" height="20" alt="$vbphrase[insert_link]" /></div></td> Also, another thing... For some reason, with all the above functioning correctly, it isn't defining the 'option' correctly. Code:
<?php function bbcode_deck($body, $name) { // Start output and build header row with name. $output .= '<table width="75%" align="center" cellpadding="0" cellspacing="0" style="border: 1px solid #000000;"> <tr><td class="tcat" style="padding:5px; font-size:20px;">' . $body . '</td></tr> <tr><td class="alt2"><table cellspacing="0" cellpadding="0" border="0" width="100%" style="margin:5px;">'; (rest of function) } ?> number*content2[/deck] (of course, any number of content items)... For some reason, with this, $body automatically becomes "Object". I dunno why... |
#10
|
||||
|
||||
You are not structuring your function correctly. Rather than explain it, I will just post the comment from class_bbcode.php.
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|