![]() |
Forum Need to change fetch_template lines and need help. I have a script that runs, for the most part, independent from the forums but it is integrated with the forum's users and styles. Since the upgrade to 4.0, fetch_template is no longer used. I need to convert the old code to the new variables so the script will work again. This is what the old code looks like... partial code that refers to the templates. OLD: Part 1 near the top of the main page of the script: PHP Code: $phrasegroups = array(); $specialtemplates = array(); $globaltemplates = array(); define('THIS_SCRIPT', 'TEST'); require_once('./global.php'); $pagetitle = "Test Page"; //Changes the page title $navbits = array(); $navbits[$parent] = 'TestArea'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); NEW: I changed Part 1 to this: PHP Code: error_reporting(E_ALL & ~E_NOTICE); define('THIS_SCRIPT', 'TEST'); define('CSRF_PROTECTION', true); $phrasegroups = array(); $specialtemplates = array(); $globaltemplates = array(); $actiontemplates = array(); require_once('./global.php'); $navbits = construct_navbits(array('' => 'TestArea')); $navbar = render_navbar_template($navbits); $pagetitle = "My page Title"; OLD: Part 2 near the end on the page: PHP Code: eval('print_output("' . fetch_template('GENERIC_SHELL') . '");'); NEW: And I changed part 2 to this: PHP Code: $templater = vB_Template::create('GENERIC_SHELL'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); There a nice article at vbulletin.org but for the life of me, I have not been successful making the page work. I can get the header / footer to work, but no content from the page will display. I know I'm missing something, but I don't know what it is. Any help will be much appreciated :) |
| الساعة الآن 11:11 PM |
Powered by vBulletin® Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By
Almuhajir