header("Content-Type: text/html; charset=iso-8859-1");
require "stdlib/stdinc.inc";
GLOBAL $pagestyle;
// Connect to database
$con = dbcon();
// Find page style
// Default set default style
$q = "SELECT * FROM designtempl LIMIT 1";
// Check if style cookie exists and is in database.
if( isset( $_COOKIE["style"] ) ){
$qtemp = "SELECT COUNT(*) AS A FROM designtempl WHERE ID = ".$_COOKIE["style"];
$res = mysql_query($qtemp ,$con);
$row = mysql_fetch_array($res);
if($row["A"] > 0){
$q = "SELECT * FROM designtempl WHERE ID = ".$_COOKIE["style"];
}
}
// find style in database
$res = mysql_query($q, $con);
$row = mysql_fetch_array($res);
$pagestyle = "styles/".$row["TEMPLNAME"];
// Error Checking
if( !is_file($pagestyle."/design.inc") )
{
die ("No file:".$pagestyle."/design.inc");
}
require($pagestyle."/design.inc");
?>