Hello,
I want to create functions to return chunks of html, i want those functions to use fasttemplate class. I keep getting this error message:
"Fatal error: Cannot redeclare class fasttemplate"
here is the index.php file:
<?php
/ Start the user session /
session_start();
require ("lib/config.php");
require($TemplateLib);
require ($DatabaseLib);
require ($HtmlLib);
require ($CommonLib);
if (! $db = DBConnect()){ echo "Database connection failed";}
/ globalize the template handle /
global $tpl;
if(!defined($tpl) ) { define(,1); echo "Object not defined";}
/ Initialize Content /
$Header = SiteHeader($CommonTitle,$ImagesPath,$SiteURL,"0");
$Footer = SiteFooter($CommonFooter);
$NavBar = SiteNavBar($SiteURL,$ImagesPath,"0");
$FeatDJ = CreateFeatureDJHtml();
$TopTen = CreateTopMusicHtml("All");
$Login = CreateLoginHtml();
$Events = CreateEventListHtml(5,"Rave","Upcoming Raves",$db);
$Poll = CreatePollHtml(1);
/ Create Columns /
$LeftCol = "$Login $NavBar";
$CenterCol = "$FeatDJ";
$RightCol = "$Events $TopTen";
/ Populate the template /
$tpl = new FastTemplate($TemplatesPath)
$tpl->define( array( SHELL => "shell.tpl"));
$tpl->assign(IMAGESPATH, $ImagesPath);
$tpl->assign(SITEHEADER, $Header);
$tpl->assign(LEFTCOLUMN, $LeftCol);
$tpl->assign(CENTERCOLUMN, $CenterCol);
$tpl->assign(RIGHTCOLUMN, $RightCol);
$tpl->assign(SITEFOOTER, $Footer);
$tpl->parse(MAIN,"SHELL");
$tpl->FastPrint(MAIN);
?>
Here is a typical function (SiteNavBar) which resides in $CommonLib:
/**
Create the navigational bar
/
function SiteNavBar ($SiteURL,$ImagesURL)
{
/ Populate the template /
$tpl = new FastTemplate($TemplatesPath),1);
$tpl->define( array( NAV => "nav.tpl"));
$tpl->assign(SITEURL, $SiteURL);
$tpl->assign(IMAGESURL, $ImagesURL);
$tpl->parse(MAIN,"NAV");
$data = $tpl->fetch("MAIN");
return $data;
}
What am i doing wrong?