Log in

View Full Version : Using $variables in templates


garon
01-30-2005, 12:33 AM
I'm really stuck on this one, and would love some help.

I have a file called resources.php. This is the code in it.


<?php

error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'resources');
require_once('./global.php');

//Create Variables
eval('$resourcesh = "' . fetch_template('resources_head') . '";');
eval('$resourcesf = "' . fetch_template('resources_foot') . '";');

//Construct navbits
$navbits = array("rules.php?$session[sessionurl]" => $vbphrase['resources']);
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

//Echo main template
eval('print_output("' . fetch_template('Resources') . '");');

?>


I then have a template called "Resources" with this data.


$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$pagetitle</title>
$headinclude
</head>
<body>
$header
$navbar

$resourcesh

$resourcesf

$footer
</body>
</html>


The templates resources-head and resources-foot are both there, and have data in them, but it won't output in resources.php. I get a regular vB page, with no content. (But it has the navbar and footer and all)

Any help? Thanks in advance!!

Xenon
01-30-2005, 03:44 PM
fetch_template('resources_head')
templates resources-head and resources-foot

you see you use a dash once, and an underscroe on the other part, maybe you just used the wrong template name?

garon
01-30-2005, 05:44 PM
you see you use a dash once, and an underscroe on the other part, maybe you just used the wrong template name?
Nope - that was just an error in my post.