Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-01-2011, 06:54 PM
Slayerz's Avatar
Slayerz Slayerz is offline
 
Join Date: Feb 2007
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 09-01-2011, 07:00 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 09-01-2011, 07:06 PM
Slayerz's Avatar
Slayerz Slayerz is offline
 
Join Date: Feb 2007
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wanted to convert vb3 type "fetch and eval" into vb4
Reply With Quote
  #4  
Old 09-01-2011, 07:12 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #5  
Old 09-01-2011, 07:25 PM
Slayerz's Avatar
Slayerz Slayerz is offline
 
Join Date: Feb 2007
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 09-01-2011, 08:43 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
$templater vB_Template::create('inferno_header');
$inferno_header $templater->render();
vB_Template::preRegister('navbar', array('inferno_header' => $inferno_header)); 
and then in the navbar template:

Code:
{vb:raw inferno_header}
Reply With Quote
  #7  
Old 09-01-2011, 08:47 PM
Slayerz's Avatar
Slayerz Slayerz is offline
 
Join Date: Feb 2007
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's what I'm assuming.

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


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

Forum Jump


All times are GMT. The time now is 07:58 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03784 seconds
  • Memory Usage 2,214KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete