start('main'); // start session - neccessary if frontend users are available // but neccessary also to check if a bot is visiting the site // -> if so then do not initialize session for larger search engines $BOTSLIST = array('googlebot', 'msnbot', 'ia_archiver', 'altavista', 'slurp', 'yahoo', 'jeeves', 'teoma', 'lycos'); $IS_A_BOT = false; foreach($BOTSLIST as $value) { if(!$IS_A_BOT && stristr($_SERVER['HTTP_USER_AGENT'], $value)) { $IS_A_BOT = true; break; } } // if no bot was found initialize session if(!$IS_A_BOT) { session_name('hashID'); session_start(); /* if (!isset($_SESSION['initiated'])) { session_regenerate_id(); $_SESSION['initiated'] = true; } */ } require_once ('config/phpwcms/conf.inc.php'); require_once ("include/inc_lib/default.inc.php"); $cache_query_string = remove_hashID($_SERVER['QUERY_STRING']); define('FE_CURRENT_URL', PHPWCMS_URL.'index.php?'.$cache_query_string); if(!isset($_SESSION['frontend_user'])) { $_SESSION['frontend_user']['id'] = 0; $_SESSION['frontend_user']['login'] = 'guest'; $_SESSION['frontend_user']['name'] = 'Guest'; // start frontend user login if(isset($_POST['fe_user_submit']) || isset($_POST['fe_user_login'])) { require_once ("include/inc_lib/general.inc.php"); require_once ("include/inc_front/front.func.inc.php"); } } // define VISIBLE_MODE // 0 = frontend (all) mode // 1 = article user mode // 2 = admin user mode if(empty($_SESSION["wcs_user_id"])) { define('VISIBLE_MODE', 0); } else { define('VISIBLE_MODE', $_SESSION["wcs_user_admin"] != 1 ? 0 : 2); } //db based page caching $cache_enabled = 0; $cache_update = 1; $cache_insert = 1; $cache_nosave = (isset($_POST) && count($_POST)) ? true : false; // don't store any page result when $_POST used $cache_searchable = ''; //chache enabled $cache_hash = md5($_SERVER['PHP_SELF'].$cache_query_string); //create hash value //now try to find current page in cache $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_cache WHERE cache_hash='".$cache_hash."'"; if($result = mysql_query($sql, $db)) { if($cache_row_value = mysql_fetch_assoc($result)) { $cache_insert = 0; } mysql_free_result($result); } if($phpwcms['cache_timeout'] && isset($cache_row_value) && is_array($cache_row_value)) { //if cached if($cache_row_value['cache_timeout'] == '') { $cache_row_value['cache_timeout'] = $phpwcms['cache_timeout']; } $cache_searchable = $cache_row_value['cache_searchable']; if($cache_row_value['cache_use'] && (time() - $cache_row_value['cache_changed']) < $cache_row_value['cache_timeout']) { $cache_update = 0; $cache_enabled = 1; } } //script caching to allow header redirect if($phpwcms["compress_page"] && isset($_SESSION['session_is_set'])) { /* if(function_exists('ini_set') && !ini_get('zlib.output_compression')) { ini_set( 'zlib.output_compression', '1' ); ini_set( 'zlib.output_compression_level', $phpwcms["compress_page"] ); ob_start(); } else { ob_start("ob_gzhandler"); //with old style GZ Compression } */ ob_start("ob_gzhandler"); //with old style GZ Compression } else { $_SESSION['session_is_set'] = true; ob_start(); //without Compression (or use browsers default) } if(!$cache_enabled || VISIBLE_MODE == 1 || VISIBLE_MODE == 2) { require_once ("config/phpwcms/conf.template_default.inc.php"); require_once ("config/phpwcms/conf.indexpage.inc.php"); require_once ("include/inc_lib/general.inc.php"); cleanupPOSTandGET(); require_once ("include/inc_lib/imagick.convert.inc.php"); require_once ("include/inc_front/front.func.inc.php"); require_once ("include/inc_front/content.func.inc.php"); $phpwcms["templates"] = TEMPLATE_PATH; $content['page_start'] = ''; $content['page_start'] .= "\n\n"; $content['page_start'] .= "\n
\n