The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
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; |
#2
|
||||
|
||||
![]()
did this work out for you ?
I'm looking to do something similar as well to eval('$home["$mods[modid]"][\'content\'] = "' . fetch_template('adv_portal_ibproarcade') . '";'); any idea thanks |
#3
|
|||
|
|||
![]()
Yes... or perhaps I should say it seems to be working
![]() |
#4
|
||||
|
||||
![]()
cool In my case above how would I do it
--------------- Added [DATE]1280189722[/DATE] at [TIME]1280189722[/TIME] --------------- I figured it out thank anyway |
#5
|
||||
|
||||
![]()
Got a similar need. Trying to get a older mod to function on 4.0.8 I know it's not supported but the mp3 player is awesome.
Any help from the masters here would be appreciated! below is my headache lol line 98 eval('$navbar = "' . fetch_template('navbar') . '";'); line 99 eval('$current .= "' . fetch_template('mp3player_popup') . '";'); Code:
Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: navbar in [path]/includes/functions.php on line 4007 Parse error: syntax error, unexpected T_STRING in /home/mysite/public_html/mp3playerindex.php(98) : eval()'d code on line 1 Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: mp3player_popup in [path]/includes/functions.php on line 4007 Parse error: syntax error, unexpected T_STRING in /home/mysite/public_html/mp3playerindex.php(99) : eval()'d code on line 2 Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: mp3player in [path]/includes/functions.php on line 4007 Total in PlayList 1: (0) Total in PlayList 2: (0) Total in PlayList 3: (0) Total in PlayList 4: (0) Total in PlayList 5: (0) |
#6
|
||||
|
||||
![]()
Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|