The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
[SOLVED]Need help displaying variable data in vb4 custom template
I'm trying to create a custom template for vb4.
Following is the situation : On my forum root, i have aa.php (Located at ../my_forum_root/aa.php) which includes bb.php located under ../my_forum_root/bb/bb.php bb.php contains following code : Code:
<?php $test="test 123"; ?> aa.php contains following code : Code:
<?php include('bb/bb.php'); // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('THIS_SCRIPT', 'aa'); define('CSRF_PROTECTION', true); // change this depending on your filename // ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array(); // get special data templates from the datastore $specialtemplates = array(); // pre-cache templates used by all actions $globaltemplates = array('aa', ); // pre-cache templates used by specific actions $actiontemplates = array(); // ######################### REQUIRE BACK-END ############################ require_once('./global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $navbits = construct_navbits(array('' => 'aa')); $navbar = render_navbar_template($navbits); // ###### YOUR CUSTOM CODE GOES HERE ##### $pagetitle = 'test 123'; // ###### NOW YOUR TEMPLATE IS BEING RENDERED ###### $templater = vB_Template::create('aa'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); ?> Code:
{vb:stylevar htmldoctype} <html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html"> <head> <title>{vb:raw vboptions.bbtitle}</title> {vb:raw headinclude} </head> <body> {vb:raw header} {vb:raw navbar} <div id="pagetitle"> <h1>{vb:raw pagetitle}</h1> </div> <h2 class="blockhead">TEST ABC</h2> <div class="blockbody"> <div class="blockrow"> {vb:raw contents} </div> </div> {vb:raw footer} </body> </html> Am i missing something?? I would like to know how do i render data under some variable in vb4 templates. |
#2
|
||||
|
||||
add
Code:
$templater->register('test', $test); |
#3
|
||||
|
||||
Thanks BBR-APBT for your time.
I got it sorted out. I forgot to register variables for my custom made template. lolz |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|