This is probably a simple thing but I'm still getting my head around the changes with vB4.
We have a hack that was done for 3.x by someone who can no longer help us out and I've got most of the hack working with our test vB4 forum apart from one line and that is:
eval('$newpost[\'message\'] = "' . fetch_template('nominate', 1, 0) . '";');
The template nominate is cached earlier on in the code and the code actually works, but throws out:
Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: nominate in [path]/includes/functions.php on line 3984
How do I convert the old way of using eval() in this example to use the vB_Template class?
--------------- Added [DATE]1279738718[/DATE] at [TIME]1279738718[/TIME] ---------------
I've had a look around the site and I think it should be:
Code:
$templater = vB_Template::create('nominate');
$templater->register('originalposter', $originalposter);
$templater->register('postnum', $postnum);
$templater->register('pagetext', $pagetext);
$nominate = $templater->render(true);
$newpost['message'] = $nominate;
Does that look right?