View Full Version : Using non-default template set on non-vB page?
MarkB
04-24-2002, 06:45 AM
Hiyis,
I am setting up an external (ie, non-forum) page that is still powered by my vB database. I can pull data through and have it displayed using the default template/style of my forums, but I'd like it to be setup using another template set.
How do I do this??
Thanks :bandit:
Mark
Sparkz
04-24-2002, 07:22 AM
I would think you could do this by hardcoding the templatesetid for templates only and styleid for the full package, or something like this in your script. never tried it tho.
MarkB
04-24-2002, 07:35 AM
Tried that - it pulls the bgcolor etc through ok, but retains the default
header and footer etc :ermm:
MarkB
04-24-2002, 07:39 AM
Then again, I could have the coding for that all messed up :) I have this:
$templatesetid='6';
$replacementsetid='6';
Admin
04-24-2002, 08:48 AM
Do that after require('./global.php') and you should be fine.
MarkB
04-24-2002, 09:44 AM
Unfortunately, no :( The thing is, it pulls the <BODY> tag through ok, everything except for $header and $footer...??
This is the full content of my file:
<?php
error_reporting(7);
$templatesused='metaltours_quickgigs, metaltours_quickgigbits';
chdir('/usr/mahke/public_html/forum/');
require('global.php');
$style=$DB_site->query_first("SELECT templatesetid,replacementsetid FROM style WHERE styleid='6'");
//get template set and replacement set details
$templatesetid=$style['templatesetid'];
$replacementsetid=$style['replacementsetid'];
// BY MARK get latest gigs
$events = $DB_site->query("SELECT eventid, DATE_FORMAT(eventdate,'%M %d') AS gigdate, eventdate, event, subject, location, country FROM calendar_events WHERE public='1' AND eventdate >= '".vbdate('Y-m-d',time())."' ORDER BY eventdate LIMIT 25");
while ($gig = $DB_site->fetch_array($events) and ++$bgcounter) {
$bgcolor = iif($bgcounter%2==0, '{firstaltcolor}', '{secondaltcolor}');
$gigid = $gig['eventid'];
$gigdate = $gig['gigdate'];
$giginfo = $gig['event'];
$gigband = "<a href=$bburl/shows.php?s=&action=getinfo&eventid=" . $gig['eventid'] . ">" .
$gig['subject'] . "</a>";
$gigcity = $gig['location'];
$gigcountry = $gig['country'];
eval("\$gigbits .= \"".gettemplate("metaltours_quickgigbits")."\";");
}
eval("\$nextgigs = \"".gettemplate("metaltours_quickgigs")."\";");
// BY MARK end latest gigs
eval("dooutput(\"".gettemplate('metaltourshome')."\");");
?>
The result is http://www.ultimatemetal.com/metaltours/
Admin
04-24-2002, 09:59 AM
You'll need to eval() the header/footer/headinclude again since it's a different template now.
eval('$header = "'.gettemplate('header').'";');
And so on for the mentioned templates. But you this might not work because it will pull the cached version fo the template, which isn't the right one. Hmm... then before doing that put:
unset($templatecache['header']);
And it should work.
MarkB
04-24-2002, 10:20 AM
Once again you assert your legendary status. Thankyou, sir.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.