vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Using $variables in templates (https://vborg.vbsupport.ru/showthread.php?t=75394)

garon 01-30-2005 12:33 AM

Using $variables in templates
 
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 Code:

<?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.

Code:

$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

Quote:

Originally Posted by garon
fetch_template('resources_head')

Quote:

Originally Posted by garon
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

Quote:

Originally Posted by Xenon
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.


All times are GMT. The time now is 09:22 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01467 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete