HIddenPanda
01-23-2011, 01:38 PM
Take This:
// ************************************************** ********************
// Begin Template Definition
// ************************************************** ********************
//Define our current theme
$file = $themeurl;
// Do the template changes and echo the ready template
$template = file_get_contents($file);
$template = replace(':ARTICLETITLE:',$article_title,$template) ;
$template = replace(':ARTICLECONTENT:',$article_content,$templ ate);
$template = replace(':ARTICLEDATE:',$article_date,$template);
$template = replace(':BROWSERTITLE:',$browsertitle,$template);
$template = replace(':SITENAME:',$sitename,$template);
//Define our links
if($cancp == "yes"){
//Admins see a custom set of links here...
$links = getadmlinks();
}
else{
$links = getlinks();
}
$template = replace(':LINKSBAR:',$links,$template);
//Get the content for the side bar...
$sidebar = getsidebar();
$template = replace(':SIDEFEED:',$sidebar,$template);
//Get the ad content...
$template = replace(':ADS:',$ads,$template);
//Get the slogan info
$template = replace(':SLOGAN:',$slogan,$template);
echo $template;
// ************************************************** ********************
// End Template Definition
// ************************************************** ********************And Put it into a file called inc\templatedefn.php
So that way instead of the above in EVERY SINGLE FILE... we just have:
include('inc\tempdefn.php');at the end of the file :D
This is mainly directed towards HoF and the other Dev Staff
This also makes it alot easier for people who want to add elements to their pages
// ************************************************** ********************
// Begin Template Definition
// ************************************************** ********************
//Define our current theme
$file = $themeurl;
// Do the template changes and echo the ready template
$template = file_get_contents($file);
$template = replace(':ARTICLETITLE:',$article_title,$template) ;
$template = replace(':ARTICLECONTENT:',$article_content,$templ ate);
$template = replace(':ARTICLEDATE:',$article_date,$template);
$template = replace(':BROWSERTITLE:',$browsertitle,$template);
$template = replace(':SITENAME:',$sitename,$template);
//Define our links
if($cancp == "yes"){
//Admins see a custom set of links here...
$links = getadmlinks();
}
else{
$links = getlinks();
}
$template = replace(':LINKSBAR:',$links,$template);
//Get the content for the side bar...
$sidebar = getsidebar();
$template = replace(':SIDEFEED:',$sidebar,$template);
//Get the ad content...
$template = replace(':ADS:',$ads,$template);
//Get the slogan info
$template = replace(':SLOGAN:',$slogan,$template);
echo $template;
// ************************************************** ********************
// End Template Definition
// ************************************************** ********************And Put it into a file called inc\templatedefn.php
So that way instead of the above in EVERY SINGLE FILE... we just have:
include('inc\tempdefn.php');at the end of the file :D
This is mainly directed towards HoF and the other Dev Staff
This also makes it alot easier for people who want to add elements to their pages