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:
NEW: I changed Part 1 to this:
OLD: Part 2 near the end on the page:
NEW: And I changed part 2 to this:
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
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') . '";');
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";
PHP Code:
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');
PHP Code:
$templater = vB_Template::create('GENERIC_SHELL');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());
Any help will be much appreciated
Comment