View Single Post
  #45  
Old 07-17-2005, 10:06 AM
Acedeal Acedeal is offline
 
Join Date: Jul 2005
Location: Texas
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>&nbsp;&nbsp;
	  {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>&nbsp;&nbsp;
	  {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
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01490 seconds
  • Memory Usage 1,807KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete