PDA

View Full Version : fetch_template() calls should be replaced fix


regitbull
05-09-2016, 04:44 PM
Hello,

I upgraded to vbulletin 4 and i want to install a old plugin that was made for vb3.
I fixed most problems but the last step left is to fix the fetch_template() calls should be replaced error.

I tried to edit it myself after reading some articles but no luck.
Could any of you guys edit the fetch_template line to make it work with vb4?


This is my code:

function generate_form_html($hash, $cost, $currency, $subinfo, $userinfo, $timeinfo)
{
global $vbphrase, $vbulletin, $stylevar, $show;

$item = $hash;
$currency = strtoupper($currency);

$form['action'] = 'payment_gateway.php?method=rbspoint';
$form['method'] = 'post';

// load settings into array so the template system can access them
$settings =& $this->settings;

eval('$form[\'hiddenfields\'] .= "' . fetch_template('subscription_payment_rbspoint') . '";');
return $form;
}


Thanks

squidsk
05-09-2016, 05:41 PM
Replace:
eval('$form[\'hiddenfields\'] .= "' . fetch_template('subscription_payment_rbspoint') . '";');

with:

$templater = vB_Template::create('subscription_payment_rbspoint ');
form['hiddenfields'] .= $templater->render();

You may need to register some variables for the template to make use of them, the parameters would be the ones to look at. That message is a warning and not an error, so you could leave it as is.

regitbull
05-09-2016, 06:10 PM
thank you for your help.