View Full Version : Can someone help me

16 Nov 2009, 12:36
Can someone help me
i try to update on mode for vb4 but i have a probleme
in vb 3.8 i have this :

eval('$mytemplate .= "' . fetch_template('mytemplate') . '";');

i convert like this
$templater = vB_Template::Create('mytemplate');
$templater->register('mytemplate', $mytemplate);
$mytemplate = $templater->render();
and in the template in vb3.8 i have this


replace by this in vb4

{vb:var mytemplate}

but when i look in my post the template are not call just see {vb:var mytemplate}

could you tell me what is wrong
sorry for my bad english

16 Nov 2009, 13:08
and in the template in vb3.8 i have this
What is the name of that template?

Also, are you putting that php code in a plugin or in a custom PHP file?

16 Nov 2009, 13:23
lolo², post your full php code to let us help :)

16 Nov 2009, 13:43
the code is this for ed2k mod http://www.vbulletin.org/forum/showthread.php?t=126481
**edit: code removed**

and the template code
**edit: code removed**

--------------- Added 16 Nov 2009 at 06:51 ---------------

the php code with modification

**edit: code removed**

16 Nov 2009, 14:04
Haven't read the whole source code. But...
To convert
eval('$ed2kbit .= "' . fetch_template('ed2kbit') . '";');

to be 4.0 compatible, use this:
(you need to explicitly register all the variables you intend to use inside a template. for example: $totalper)
$templateBit = vB_Template::create('ed2kbit');

$templateBit->register('totalper', $totalper);
$templateBit->register('some_var_for_ed2kbit', $somevar);

$ed2kbit .= $templateBit->render();

16 Nov 2009, 14:55
thanks i' try this

17 Nov 2009, 10:56
On a principle note: Does the author of the mod give you permission to repost the whole code of his product here? I wouldn't like this to happen with my mods.

17 Nov 2009, 15:46
I've removed the code from post 4. You may NOT repost code without the permission of the author. Please do not do so in the future.

18 Nov 2009, 06:40
Sorry i dont want attribute me the code just want upgrade i dont want distribute this code without the accord of author