0 ) header("Cache-control: private"); ob_start(); // buffer output // first-time in? if (!isset($_SESSION['init'])) { $_SESSION['init'] = 1; $_SESSION['flash'] = true; $_SESSION['bandwidth'] = 'HI'; $_SESSION['PHP_SELF'] = ''; } // Bandwidth? if (isset($_GET['bandwidth'])) { if ($_GET['bandwidth'] == 'lo') { $_SESSION['flash'] = false; $_SESSION['bandwidth'] = 'LO'; } else { $_SESSION['flash'] = true; $_SESSION['bandwidth'] = 'HI'; } } require_once(INC_PATH.'MySmarty.php'); require_once(INC_PATH."MyDB.inc"); require_once(INC_PATH."MyApp.inc"); $DB = new myDB(); // create DB instance and connect $APP = new MyApp(); // app logic $APP->setDB($DB); // check page is local and not a hack page if (!empty($page) and $APP->isLocalPage($page) == false) $APP->go404(); if (isset($_GET['debug'])) { if ($_GET['debug'] == 0) unset($_SESSION['debug']); else $_SESSION['debug'] = 1; } if (isset($_GET['cPageID'])) { $cPage = $DB->getCPage($_GET['cPageID']); if (!$cPage) $APP->go404(); if (isset($cPage['showRightCol']) and $cPage['showRightCol'] == 1) $showRightCol = 1; } // printPage $printPage = isset($_REQUEST['print'])?true:false; //---------------- DECIDE FORWARDING PAGE ----------------------///// // domain has changed or this is the first time load // check whether is is a customer domain $id = getURLlisting(); if (!empty($id)) { $listingID = $id; $page = 'listing'; $customerDomain = true; if (!isset($_GET['id'])) $_GET['id'] = $id; // area is set further down this script } elseif ($_SERVER['PHP_SELF'] <> $_SESSION['PHP_SELF']) { $urlSubID = getURLsubarea(); if (!empty($urlSubID)) { if (!isset($_SESSION['areaID']) or $_SESSION['subAreaID'] <> $urlSubID) { $APP->setAreabySubID($urlSubID); } } } if (!$customerDomain) $bingcode = "4CBCD1969610A1212B4DAE1C63D1D47C"; // if not customer domain set OMD's bing code // new area specified from main if (isset($_GET['area_subID'])) $APP->setAreabySubID($_GET['area_subID']); if (isset($_POST['area_subID'])) $APP->setAreabySubID($_POST['area_subID']); if (empty($page)) { if (isset($_GET['id']) and !empty($_GET['id'])) $page='listing'; elseif (isset($_GET['eid']) and !empty($_GET['eid'])) $page='event'; elseif (isset($_GET['jid']) and !empty($_GET['jid'])) $page='job'; elseif (isset($_GET['cat']) and !empty($_GET['cat'])) $page='directory'; else $page = 'area'; } if ($page == 'area') { if (!isset($cPage)) $showRightCol = true; } /* specific page content */ if ($page == 'listing' and isset($_GET['id'])) { // load particular CSS // $tempate_id = $DB->getListingTemplate($_REQUEST['id']); $listing = $DB->getListingByID($_GET['id']); if ($listing) { $template_id = $listing['template_id']; if (!isset($_SESSION['areaID']) or ($listing['areaID'] <> $_SESSION['areaID'])) { // $APP->setArea($listing['areaID']); $subArea = $DB->getSubAreas4Area($listing['areaID']); $APP->setAreabySubID($subArea[0]['area_subID']); } } else $page = 'main'; } /* check areaID has been set */ // unknown area if ($page <> 'main' and !isset($_SESSION['areaID'])) { $areaSet = false; if (isset($_COOKIE['area_subID'])) $areaSet = $APP->setAreabySubID($_COOKIE['area_subID']); if (!$areaSet) $page = 'main'; // catch all } /* Set PHP_SELF here not in footer in case footer is not executed */ $_SESSION['PHP_SELF'] = $_SERVER['PHP_SELF']; // webstats if (isset($_SESSION['areaID'])) { @include_once( $_SERVER["DOCUMENT_ROOT"]."/slimstat/inc.stats.php" ); } // // ?>