The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Fetch Template
I saw a few threads about it, but they were vague and I couldn't get too deep of a grasp for the basis of it.
I was wondering how to change raw php, using templates. For instances, I got the program to work and it shows in admincp, but to view it on forum errors occur. So I checked it out and found out that it's mostly fetch template coding. I was wondering if there is a simple method to easily change the fetch templates into vb_template class. As if to take main standards of the fetch and just use it in a template of the vb_template class for it to read and work. |
#2
|
|||
|
|||
I don't understand. Do you mean you want to convert vb3 type "fetch and eval" template code to vb4? Or do you want to change an adminCP "just print out the html" page to work in with templates?
|
#3
|
||||
|
||||
I wanted to convert vb3 type "fetch and eval" into vb4
|
#4
|
|||
|
|||
Here's an article on that. https://vborg.vbsupport.ru/showthread.php?t=228078
You really just have to create the template object and call render(), but the big difference is that you have to register all the variables used in the template, where you didn't have to do that at all in vb3. Also the template syntax changed. That's described in the manual: https://www.vbulletin.com/docs/html/...emplates_intro Basically, <if> and <else> are now <vb:if> and <vb:else>, and where you had $varname before you'd now have {vb:raw varname} (but not in condition="", those would stay the same). |
#5
|
||||
|
||||
I saw that, but wasn't 100% sure on what'd I do for this.
eval('$templater = vB_Template::create('inferno_header'); $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); } How would that be changed? |
#6
|
|||
|
|||
To be honest I don't know what to make of that. Are you trying to add a template called 'inferno_header' to your navbar? Then you'd want something like this:
PHP Code:
Code:
{vb:raw inferno_header} |
#7
|
||||
|
||||
That's what I'm assuming.
I'm taking a failed modification and rebuilding it. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|