aviv_el
10-02-2011, 02:03 PM
I have a custom plugin I need to migrate from vb3 to vb4.
The plugin hooks to showthread_complete, runs various tests, and creates a variable.
Based on the value of the variable, the template displays or not certain blocks (ads, etc).
Idealy, for the sake of making things simple, I'd really like to use the same methodology- plugins runs checks, exposes variable to the template, template runs condition to check if value of variables, and accordingly display ads and rest of content.
Here's where I'm stuck: on showthread_complete hook, I can't really register the variable to the SHOWTHREAD template, as the in showthread.php the call to the showthread_complete hook is run before the declaration of $templater variable-
showthread.php code looks like this:
($hook = vBulletinHook::fetch_hook('showthread_complete')) ? eval($hook) : false;
// ################################################## ###########################
// output page
$templater = vB_Template::create('SHOWTHREAD');
$templater->register_page_templates();
$templater->register('pagenumbers', fetch_start_end_total_array($vbulletin->GPC['pagenumber'], $perpage, $totalposts));
$templater->register('totalposts', $totalposts);
Can anyone help?
The plugin hooks to showthread_complete, runs various tests, and creates a variable.
Based on the value of the variable, the template displays or not certain blocks (ads, etc).
Idealy, for the sake of making things simple, I'd really like to use the same methodology- plugins runs checks, exposes variable to the template, template runs condition to check if value of variables, and accordingly display ads and rest of content.
Here's where I'm stuck: on showthread_complete hook, I can't really register the variable to the SHOWTHREAD template, as the in showthread.php the call to the showthread_complete hook is run before the declaration of $templater variable-
showthread.php code looks like this:
($hook = vBulletinHook::fetch_hook('showthread_complete')) ? eval($hook) : false;
// ################################################## ###########################
// output page
$templater = vB_Template::create('SHOWTHREAD');
$templater->register_page_templates();
$templater->register('pagenumbers', fetch_start_end_total_array($vbulletin->GPC['pagenumber'], $perpage, $totalposts));
$templater->register('totalposts', $totalposts);
Can anyone help?