/* Index File
* Version: 0.1-beta1
* Chest Contest - Henrique Mouta (C) 2011
*/
//Start with the requires
session_start();
require_once 'functions.php'; //PHP File with every function
//Some init's
$page = $_GET['p']; //Get what page is the user on.
$file = $page . ".php"; //CONFIG's
//Setting up the CMS crutial information
$pagequery = mysql_query("SELECT * FROM cms_pages WHERE slug='$page'");
$pageinfo = mysql_fetch_assoc($pagequery);
if (file_exists('install/index.php')){
echo 'You must remove the \'install\' directory first!';
} else if (($contest_id == '') AND ($page!='debug')) {
echo 'You must create a contest first.
CLICK HERE to access the backend and create a contest.';
} else {
if (!isset($_COOKIE["cntx"]['cid'])) { //If the cookie is not already created.
setcookie("cntx[cid]", $contest_id);//Create one with the contest id.
}
if (!isset($_COOKIE["cntx"]['sun'])) { //If the cookie is not already created.
setcookie("cntx[sun]", '0'); //Create one with value 0.
}
$played = $_COOKIE['cntx']['sun']; //Set the global var with the cookie.
$contest_cookie = $_COOKIE['cntx']['cid'];
//Set the global var with the cookie.
//If the contest_id is different then the value on the cookie, set the cookie
//and reset the played cookie to 0.
if ($contest_id != $contest_cookie) {
setcookie("cntx[sun]", '0'); //Reset the played times cookie to zero
setcookie("cntx[cid]", $contest_id);//Set the correct contest id
}
//informação cookie.
//1º valor - Alertas activos (1), inactivos(0)
//$theme = $_GET['t'];
//if (!isset($_COOKIE["innervision"]['alert'])) { setcookie("innervision[alert]", '1'); }
/* START OF THE HEADER */
include "theme/header.php";
/* END OF THE HEADER */
/* START OF THE BODY */
include "theme/body.php";
/* END OF THE BODY */
/* START OF THE FOOTER */
include "theme/footer.php";
/* END OF THE FOOTER */
}
?>