'./tmp/cache/', 'lifeTime' => 3600, 'pearErrorMode' => CACHE_LITE_ERROR_DIE, 'automaticSerialization' => TRUE ); $cache = new Cache_Lite($options); */ $http_host = $_SERVER['HTTP_HOST']; if($http_host!='uroci.net'){ header("Location: https://uroci.net"); exit; } require("inc/cache.inc.php"); $cache = new MurroCache; define("NON_DIRECT", "1"); require("config.php"); require("inc/mysql.class.php"); $db = new Database; if(isset($_COOKIE['pomnime']) and $_COOKIE['pomnime']==1 and isset($_COOKIE['sid'])){ //session_set_cookie_params(999999999999999999); if($_COOKIE['sid']!='' and !empty($_COOKIE['sid'])){ // session_id($_COOKIE['sid']); } } session_start(); if(!isset($_COOKIE['sid']) or $_COOKIE['sid']==0){ $_COOKIE['sid'] = session_id(); setcookie("sid", session_id()); } if(isset($_COOKIE['pomnime']) and $_COOKIE['pomnime']==1 and isset($_COOKIE['sid']) and $_COOKIE['sid']!=0){ require("inc/dbsession.php"); } require("inc/getconfig.php"); require("inc/core.php"); require("inc/mod_rewrite.php"); require("inc/smarty_functions.php"); /** * --------------------------------- * ����� * --------------------------------- */ if($url[0]=='admin'){ header("Location: {$url_base}/admin/index.html"); } $request_url = $_SERVER['REQUEST_URI']; require("libs/Smarty.class.php"); $smarty = new Smarty; /** * --------------------------------- * �������� ���� ��� �� ������ ���������������� ����� * --------------------------------- */ if(isset($url[1]) AND $url[1]=='admin'){ require("admin/index.php"); }else{ loadClass("categories"); $categories = new Categories; if($cache->get('kategorii')){ $kategorii = $cache->get('kategorii'); }else{ $kategorii = $categories->getSections(); $cache->save($kategorii, 'kategorii'); } $smarty->assign("kategorii", $kategorii); unset($kategorii); if($cache->get('linkove')){ $links = $cache->get('linkove'); }else{ $query = "select sql_cache `link`, `title` from `links` order by `order` desc"; $db->query($query); $links = $db->getArray(); $cache->save($links, 'linkove'); } $smarty->assign("links", $links); unset($links); /** * --------------------------------- * Smarty * --------------------------------- */ $smarty->template_dir = './templates'; $smarty->config_dir = './configs/'; $smarty->compile_dir = './tmp'; $smarty->config_load("main.conf"); $smarty->cache_dir = './tmp'; $smarty->cache_lifetime = '60'; $smarty->caching = FALSE; $smarty->assign("url_base", $url_base); // ���� $smarty->assign("url", $url); // mod rewrite if(isset($post)){ $smarty->assign("post", $post); } $smarty->assign("config", $config); //������������ $smarty->register_modifier('substr_utf8', 'utf8_substr'); $smarty->register_modifier('is_numeric', 'is_numeric'); $smarty->register_modifier('stripslashes', 'stripslashes'); $smarty->register_modifier('makeURL', 'makeURL'); $smarty->register_function('pagination', 'pagination'); $smarty->register_function('checkLogged', 'checkLogged'); $smarty->register_function('strip_tags', 'strip_tags'); $smarty->register_function('forumPosts', 'forumPosts'); $smarty->register_function("urokKomentari", "urokKomentari"); $access = FALSE; $logged = FALSE; if (isset($_SESSION['user_id']) and is_numeric($_SESSION['user_id']) and$_SESSION['user_id']!=0){ $logged = TRUE; $access = $_SESSION['access']; } $smarty->assign("logged", $logged); $smarty->assign("access", $access); if($access > 0){ require("inc/moderator.php"); } require("inc/display_module.php"); } if(isset($debug_queries) and $debug_queries=='1'){ $end_time = microtime(); $generirano_za = round($end_time, 5)-round($start_time, 5); echo "
���������� �� "; echo $generirano_za; echo " �������.
"; if($generirano_za > '0.35'){ $db->query("insert into `loading_peaks` (`peak_date`, `peak_url`, `peak_time`, `peak_ip`) VALUES (NOW(), '$_SERVER[REQUEST_URI]', '$generirano_za', '$_SERVER[REMOTE_ADDR]') "); } } if(!$cache->get('deletedUsers')){ $query = "delete from `jos_users` where `activation`!='' and NOW()-TIMESTAMP(`registerDate`) > 36000 "; $db->query($query); $cache->save('1', 'deletedUsers'); } ?>