init(); //var_dump($path);die; if (($path['abs_section'] != 'pages' || ($path['abs_section'] == 'pages' && $path['path_array'][1] == 'redirect' )) && !isset($op)) $op = $path['path_array'][1]; //echo ' se='.$se.' path='.$path.' page='.$page.'
'; //$obj = user::online(); //var_dump($obj);die; if (($path['active'] > 0) OR ($path['active'] == 0 AND user::is_admin())) { if (($path['view'] == 0) || ($path['view'] == 1 AND user::is_guest() AND !user::is_admin()) || ($path['view'] == 2 AND user::is_user()) || ($path['view'] == 3 AND user::is_admin())) { if (!empty($path['fn']) && function_exists($path['fn'])) { $page_contents = $path['fn']($path); } else { $file = isset($_GET['file']) && preg_match('/^[a-z][_\-\w\.]*$/i', $_GET['file']) ? $file : 'index.php'; $sctpath=get_module_path($path['abs_section']).'/'.$file; if (file_exists($sctpath)) { ob_start(); include($sctpath); $page_contents = ob_get_contents(); ob_end_clean(); } else { $e404page = cfg::v('error404page'); if (empty( $e404page )) { header("HTTP/1.0 404 Not Found"); exit(); } else { Header("Location: ".$GLOBALS['siteurl'].'/'.$e404page); } exit(); } } } else { header("HTTP/1.0 403 Forbidden"); $pagetitle = "- "._ACCESSDENIED.""; ob_start(); win_start(_ACCESSDENIED); echo "
"._RESTRICTEDAREA."

"; win_end(); $page_contents = ob_get_contents(); ob_end_clean(); } } else { Header("Location: ".$GLOBALS['siteurl'].'/'.cfg::v('error404page')); exit(); } if (!empty($page_contents)) { $theme->set_block('contents',$page_contents); $page_contents = $theme->parse(); } if (intval(cfg::v('cache_fullpage')) == 1){ cache::put(serialize(array($Last_Modified, $page_contents))); } } if (!empty($page_contents)) { $page_contents = strtr($page_contents, array( '{ sql_cnt }' => sizeof($GLOBALS['db']->sql_log), '{ gentime }' => number_format(getmicrotime() - $GLOBALS['START_TIME'], 2, '.', '') )); $lmdate = getdate($Last_Modified); header ("Expires: " . date("D, d M Y H:i:s", mktime(23, 59, 59, $lmdate['mon'], $lmdate['mday'], $lmdate['year'])) . " GMT"); header ("Last-Modified: " . date("D, d M Y H:i:s", mktime($lmdate['hours'], $lmdate['minutes'], $lmdate['seconds'], $lmdate['mon'], $lmdate['mday'], $lmdate['year'])) . " GMT"); //Content-Type=text/html; charset=utf-8 echo $page_contents; //var_dump($path); //-------- debug db queries if ($db_debug) { echo ""; } //------------------------- } ?>