Does anyone have an example of;
calling a template inside another templete
Php code
PHP Code:
<?php
include('includes/common.php');
$page_title = 'home';
include('featured.php');
include('stats.php');
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'index');
$globaltemplates = array(
'PLAYER_INDEX_BODY',
'PLAYER_FAQ_BODY',
'PLAYER_FEATURED_BODY',
'PLAYER_LIST_BODY',
'PLAYER_LIST_EDIT_BODY',
'PLAYER_PLAY_BODY',
'PLAYER_FETCH',
'PLAYER_STATS',
'PLAYER_VIEW_ART_BODY',
'PLAYER_VIEW_ART_EDIT',
'PLAYER_VIEW_BODY',
'PLAYER_VEIW_EDIT',
'forumhome_moderator'
);
// pre-cache templates used by specific actions
$actiontemplates = array();
//NO CLUE WHAT"S THIS FOR
// what are actiontemplates ?
chdir('../../vb');
require_once('global.php');
// ## this calls to print out one main template ##
$pagetitle = "$vboptions[bbtitle]PLAYER INDEX";
$navbits[""] = $pagetitle;
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('$VBPLAYER_STATS = "' . fetch_template('PLAYER_STATS') . '";');
eval('print_output("' . fetch_template('PLAYER_INDEX_BODY') . '");');
?>
That setups up the PHP (which works)
I have a template that does--and displays what I want it to
Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<html>
<head>
<meta name="description" content="$foruminfo[description]" />
<title>$vboptions[bbtitle] - VB xxxx Index</title>
$headinclude
</head>
<body>
<!-- logo -->
<!--
<a name="top"></a>
-->
$_phpinclude_output
$header
$navbar
<br>
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left"><span class="nav"><a class="nav" href="[bburl]">Forum Index</a>
-> <a href="{other_INDEX}" class="nav">somewhere Index</a></span></td>
</tr>
</table>
<table width="100%" cellspacing="1" cellpadding="3" border="0">
<tr>
<td valign="top">
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0">
<tr>
<th class="thead">Welcome to <i>xxxx</i></th>
</tr>
<tr>
<td class="alt1" width="500"><span class="gen">SOME TEXT HERE.<br />You can learn <a href="{X_FAQ}">more about xxxx</a> in the 'help' section.<br />
<br />What are you waiting for? <a href=".....">Start</a>!</span></td>
</tr>
</table>
<br />
{XXX_FEATURES}
</td>
<td valign="top">
{XXXX_STATS}
</td>
</tr>
</table>
$footer
where XXX_FEATURES is in the above template , is where I need to display some sql that is called in antother template same with the place holder called xxx_Stats
what would be the syntax for adding (or pulling the data) from the other template?
the xxx_features template has
Code:
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0">
<tr>
<th class="thTop">Features</th>
</tr>
<tr>
<td class="catLeft"><span class="cattitle">Featured</span></td>
</tr>
<tr>
<td class="row1"><span class="genmed">
<!-- BEGIN feat -->
* <a class="genmed" href="{feat_xxx.U_VIEWxxxST}">{feat_xxx.XXXX_NAME}</a>
- <a class="genmed" href="{feat_xxxx.U_VIEWYYY}">{feat_xxx.YYYY_TITLE}</a>
{feat_xxx.YYYY_DESC}<br/>
<!-- END feat_s -->
</span>
</td>
</tr>
<tr>
<th class="thTop">List Features</th>
</tr>
<tr>
<td class="catLeft"><span class="cattitle">Featured lists</span></td>
</tr>
<tr>
<td class="row1"><span class="genmed">
<!-- BEGIN feat_pl -->
* <a class="genmed" href="{feat_pl.U_VIEWPL}">{feat_pl.PL_TITLE}</a>
{feat_pl.PL_DESC}<br/>
<!-- END feat_pl -->
</span>
</td>
</tr>
<tr>
<td class="catLeft"><span class="cattitle">in play</span></td>
</tr>
<tr>
<td class="row1"><span class="genmed">
<!-- BEGIN upl_YYYs -->
* <a class="genmed" href="{upl_YYYY.U_VIEWART}">{upl_YYYY.ARTIST_NAME}</a>
- <span class="genmed" href="{upl_YYYY.U_VIEWYYYY}">{upl_YYYY.YYYY_TITLE}</a><br/>
<!-- END upl_songs -->
</span></td>
</tr>
</table>
which has all the display info for the sql querries.
Trying to port a bunch of old stuff from my phpbb forums
At a lose on how vb pulls data from template to template
Hope you guys can help
Thanks in advance!!
TB