cache_content(); class CBT extends MainApl { var $htmlFile = "index.html"; var $url_template = "lang/module/act/id/cid/tmp_name1/tmp_name2/tmp_name3/"; var $subdomain = ""; var $sql_cache_time = 200; function __construct(){ parent::__construct(); $this->urlConv(); $sql_tmp = "select id, time, stran, data from cbt_temp order by id asc"; $cache=new MySQLCache($sql_tmp, $this->obj->sql_cache_time); while($tempv = $cache->fetch_assoc()){ $this->var[tempdata][$tempv['id']] = $tempv; } if($this->var[module] == 'news'){ if($this->var[act] == 'read'){ if(!$this->var[r]) { //Header("Location: http://".DOMAIN_NAME."/_redirect_/?get_vars=".base64_encode($this->var[get_vars])); //exit; } } } $this->var[querystring] = $_GET[get_vars]; if(!$this->var[lang]) $this->var[lang] = "ru"; if(!file_exists('inc/lang.'.$this->var[lang].'.php')) { Header("Location: /"); exit; } require_once 'inc/lang.'.$this->var[lang].'.php'; $this->var[language] = $lang; //"SalamNews" - Последние новости Азербайджана, России и стран СНГ - Политика, Экономика $titlearray = array('az'=>'SalamNews - Ən son xəbərlər', 'ru'=>'SalamNews - Новости Азербайджана', 'tr'=>'"SalamNews" - En son haberler'); $this->var[hetml_title] = $titlearray[$this->var[lang]]; $this->var[meta_description] = "новости, азербайджана, сегодня, последние, азербайджана, азербайджан, "; $this->var[meta_keywords] = "новости, азербайджана, сегодня, последние, азербайджана, азербайджан, политика, политикой, внешняя, информационное, агентство, баку, SalamNews"; $pathClear = preg_replace("/\/?$/", "", preg_replace("/^http:\/\//", "", DOMAIN_NAME)); if($_SERVER['HTTP_HOST'] != 'www.'.$pathClear and $_SERVER['HTTP_HOST']!= $pathClear){ $subdomainperma = preg_replace("/\.".$pathClear.".?$/", "", $_SERVER['HTTP_HOST']); $this->subdomain = trim($subdomainperma); } if($this->subdomain != 'm') { require_once 'lib/mobile_device_detect.php'; $mobile = mobile_device_detect(); if($mobile){ //Header("Location: http://m.".DOMAIN_NAME); //exit; } } $logo_type = "def"; $this->var[logohtmkcode] = $this->template('logo_'.$logo_type.'.html'); } function net_match ( $network , $ip ) { $ip_arr = explode ( '/' , $network ); $network_long = ip2long ( $ip_arr [ 0 ]); $x = ip2long ( $ip_arr [ 1 ]); $mask = long2ip ( $x ) == $ip_arr [ 1 ] ? $x : 0xffffffff << ( 32 - $ip_arr [ 1 ]); $ip_long = ip2long ( $ip ); return ( $ip_long & $mask ) == ( $network_long & $mask ); } function urlConv(){ $url_temp = explode("/", $this->url_template); $get_vars_array = explode("/", $this->var[get_vars]); if(sizeof($get_vars_array) > 0){ foreach($get_vars_array as $key=>$val){ if($val) $this->var[$url_temp[$key]] = $val; } } } function clear_title($res){ $res = strip_tags($res, ''); return $res; } function date_convert($res){ $date = explode(" ", $res); $d = explode("-", $date[0]); $t = explode(":", $date[1]); $res = $d[2]." ".$this->var[language][month][intval($d[1])]." ".$d[0].", ".$t[0].":".$t[1]." (GMT +4)"; return $res; } function Transliterate($string){ $cyr=array( "Щ", "Ш", "Ч","Ц", "Ю", "Я", "Ж","А","Б","В", "Г","Д","Е","Ё","З","И","Й","К","Л","М","Н", "О","П","Р","С","Т","У","Ф","Х","Ь","Ы","Ъ", "Э","Є", "Ї","І", "щ", "ш", "ч","ц", "ю", "я", "ж","а","б","в", "г","д","е","ё","з","и","й","к","л","м","н", "о","п","р","с","т","у","ф","х","ь","ы","ъ", "э","є", "ї","і", "A","a","B","b","C","c","Ç","ç","D","d","E","e", "Ə","ə","F","f","G","g","Ğ","ğ","H","h","X","x", "I","ı","İ","i","J","j","K","k","Q","q","L","l", "M","m","N","n","O","o","Ö","ö","P","p","R","r", "S","s","Ş","ş","T","t","U","u","Ü","ü","V","v", "Y","y","Z","z" ); $lat=array( "Sh","Sh","Ch","C","Yu","Ya","J","A","B","V", "G","D","E","E","Z","I","Y","K","L","M","N", "O","P","R","S","T","U","F","X","","I","", "E","E","Yi","I", "sh","sh","ch","c","yu","ya","j","a","b","v", "g","d","e","e","z","i","y","k","l","m","n", "o","p","r","s","t","u","f","x","", "i","" , "e","e","yi","i", "A","a","B","b","C","c","C","c","D","d","E","e", "E","e","F","f","G","g","G","g","H","h","X","x", "I","i","I","i","J","j","K","k","Q","q","L","l", "M","m","N","n","O","o","O","o","P","p","R","r", "S","s","Sh","sh","T","t","U","u","U","u","V","v", "Y","y","Z","z" ); for($i=0; $i"), array(" "), $string); $string = str_replace(" ", "-", $string); //$string = preg_replace("/[_\s\.,?!\[\](){}]+/", "_", $string); $string = preg_replace("/-{2,}/", "--", $string); $string = preg_replace("/_-+_/", "--", $string); $string = preg_replace("/[_\-]+$/", "", $string); $string = $this->Transliterate($string); $string = StrToLower($string); $string = preg_replace("/j{2,}/", "j", $string); $string = preg_replace("/[^0-9a-z_\-]+/", "", $string); return $string; } function convert_tmp($res){ $res = strip_tags($res); $res = $this->encodestring($res); return $res; } function imgicon($img){ $img = trim($img); $id = explode(" ",$img); } function videoicon($videofile){ if(strlen($videofile) > 5) $videofilesource = "var[language][videonewstitle]."\" style=\"margin-left:5px;border:0;\">"; else $videofilesource = ""; return $videofilesource; } } $CBT = new CBT; $CBT->var[modulevars] = array('az'=>'1', 'ru'=>'2', 'en'=>'3', 'tr'=>'4', 'ar'=>'5', 'fa'=>'6'); switch($CBT->var[module]){ case 'aaa1': require_once 'module/convert.php'; $mod = new mainFuction; $CBT->var[site_body] = $mod->switchFunction($CBT); break; case 'demo': echo "Demo text";exit; break; case 'tabCont': require_once 'module/home.php'; $mod = new mainFuction; $CBT->var[site_body] = $mod->switchFunction($CBT); break; case 'ajax': require_once 'module/main.php'; $mod = new homeFuction($CBT); break; case 'news': require_once 'module/main.php'; $ho = new homeFuction($CBT); require_once 'module/news.php'; $mod = new mainFuction; $CBT->var[site_body] = $mod->switchFunction($CBT); break; case 'data': require_once 'module/main.php'; $ho = new homeFuction($CBT); require_once 'module/data.php'; $mod = new mainFuction; $CBT->var[site_body] = $mod->switchFunction($CBT); break; case 'vote': require_once 'module/main.php'; $ho = new homeFuction($CBT); require_once 'module/vote.php'; $mod = new mainFuction; $CBT->var[site_body] = $mod->switchFunction($CBT); break; case 'search': require_once 'module/main.php'; $ho = new homeFuction($CBT); require_once 'module/search.php'; $mod = new mainFuction; $CBT->var[site_body] = $mod->switchFunction($CBT); break; case 'wc': require_once 'module/weather_currency.php'; $mod = new mainFuction($CBT); break; case 'infor': require_once 'module/weather_currency.php'; $mod = new mainFuction($CBT); break; case 'infografik': require_once 'module/main.php'; $ho = new homeFuction($CBT); require_once 'module/infografik.php'; $mod = new mainFuction; $CBT->var[site_body] = $mod->switchFunction($CBT); break; case 'videonews': require_once 'module/main.php'; $ho = new homeFuction($CBT); require_once 'module/videonews.php'; $mod = new mainFuction; $CBT->var[site_body] = $mod->switchFunction($CBT); break; case 'photolents': require_once 'module/main.php'; $ho = new homeFuction($CBT); require_once 'module/photolents.php'; $mod = new mainFuction; $CBT->var[site_body] = $mod->switchFunction($CBT); break; default: require_once 'module/main.php'; $ho = new homeFuction($CBT); require_once 'module/home.php'; $mod = new mainFuction; $CBT->var[site_body] = $mod->switchFunction($CBT); break; } $CBT->var[zaproscol] = intval($CBT->count); $CBT->var[zaprostime] = $CBT->delta; //$CBT->var[alexaimg] = ""; echo $CBT->template($CBT->htmlFile); //$new->haupt_cache(); ?>