View Full Version : Includes - Please help
stuuu
08-15-2002, 05:06 PM
How would I include the vB header, footer, and stylesheet into a separate PHP page, I cant find this anywhere :(
Xenon
08-15-2002, 10:42 PM
require global.php in your scripts
stuuu
08-16-2002, 01:12 AM
Originally posted by Xenon
require global.php in your scripts
Done that, it just brings up a blank page :(
<?php
require("./global.php");
?>
Dont I need to include some templates? I dont know how though.
stuuu
08-16-2002, 08:46 AM
OK, I have managed to get a header and footer working using the vB template method.
<?
error_reporting(7);
require("./global.php");
eval("dooutput(\"".gettemplate("audio")."\");");
?>
I have this in my audio template:
{htmldoctype}
<html>
<head>
<title>$bbtitle - Audio</title>
$headinclude
</head>
<body>
$header
!!MY CODE HERE!!
$footer
</body>
</html>
I have quite a big PHP script that calls audio clips from my database, I need to get that included where it says !!MY CODE HERE!!, I have tried making an include file (audio.inc) and calling that through the phpinclude template, but $variables dont seem to get processed when I do this. Plus the code would be quite intensive if it was included in each page vB loads!
Please help :D
stuuu
08-17-2002, 07:33 AM
PLEAAAASE HELP :D
Xenon
08-17-2002, 11:54 PM
you can't include scripts in templates..
you have to use something like this:
<?
error_reporting(7);
require("./global.php");
include("audio.inc");
eval("dooutput(\"".gettemplate("audio")."\");");
?>
in your audio.inc you should have defined a variable and then you can use this variable in your template
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.