Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 01 Sep 2011, 19:54
Slayerz's Avatar
Slayerz Slayerz is offline
 
Join Date: Feb 2007
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.
__________________
Reply With Quote
  #2  
Old 01 Sep 2011, 20:00
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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?
Reply With Quote
  #3  
Old 01 Sep 2011, 20:06
Slayerz's Avatar
Slayerz Slayerz is offline
 
Join Date: Feb 2007
I wanted to convert vb3 type "fetch and eval" into vb4
__________________
Reply With Quote
  #4  
Old 01 Sep 2011, 20:12
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Here's an article on that. http://www.vbulletin.org/forum/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).
Reply With Quote
  #5  
Old 01 Sep 2011, 20:25
Slayerz's Avatar
Slayerz Slayerz is offline
 
Join Date: Feb 2007
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?
__________________
Reply With Quote
  #6  
Old 01 Sep 2011, 21:43
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and then in the navbar template:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #7  
Old 01 Sep 2011, 21:47
Slayerz's Avatar
Slayerz Slayerz is offline
 
Join Date: Feb 2007
That's what I'm assuming.

I'm taking a failed modification and rebuilding it.
__________________
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 08:25.

Layout Options | Width: Wide Color: