define("ONSTART",true); define ("ERROR", E_USER_WARNING); session_start(); include_once($_SERVER['DOCUMENT_ROOT'].'/modules/main/classes/function.php'); $ttt=getmicrotime(); include_once($_SERVER['DOCUMENT_ROOT'].'/modules/main/classes/db_client.class.php'); $db=new db_client(); include_once($_SERVER['DOCUMENT_ROOT'].'/modules/main/classes/user.class.php'); $User=new user(); $AccessClass = new access(); include_once($_SERVER['DOCUMENT_ROOT'].'/modules/main/classes/cash.class.php'); include_once($_SERVER['DOCUMENT_ROOT'].'/modules/main/classes/tree.class.php'); $treeClass=new tree(); include_once($_SERVER['DOCUMENT_ROOT'].'/modules/main/classes/modules.class.php'); $Module=new module(); include_once($_SERVER['DOCUMENT_ROOT'].'/modules/main/classes/admin_panel.class.php'); $AdminPanel=new admin_panel(); $template_default = $db->get_value_query("SELECT value FROM options WHERE `key`='template_default'"); $User->CookieAuth(); if(isset($_GET['logout'])) { user::Logout(); header('Location: /'); die(); } if(isset($_POST['act'])) { $User->Login($_POST['login'],$_POST['pass'],isset($_POST['cookie'])); } $dn_code=GetValueDB('dnews'); if(!$dn_code) { $Content = ""; $Keywords = ""; $Description = ""; $Title = ""; $H1 = ""; header('HTTP/1.x 404 Not Found'); if($AccessClass->GroupIsAdmin()) { ob_start_my(); include($_SERVER['DOCUMENT_ROOT'].'/admin/panel.php'); $Panel=ob_stop_my(); } ob_start_my(); include($_SERVER['DOCUMENT_ROOT'].'/404.php'); $Content = ob_stop_my(); $Keywords = ''; $Description = ''; $Title = '
'.htmlspecialchars($Title).''; $H1 = ''.htmlspecialchars($H1).'
'; include($_SERVER['DOCUMENT_ROOT'].'/templates/'.$template_default.'/template.php'); die(); } list($dn_site_id,$dn_code)=explode('-',$dn_code); $script = str_replace('.php','',GetValueDB('dn_file').'.php'); $filename = './dnews.inc.xml'; $system = 'http://web-dnews.ru/dnl.php?site='.$dn_site_id.'&code='.$dn_code; $mode = (substr_count($_SERVER['REQUEST_URI'],'.php')==1)?'php':'htm'; function mc_link($cid,$id=''){ global $script,$mode; if($mode=='php'){ return './'.$script.'.'.$mode.'?cat='.$cid.($id!=''?'&id='.$id:''); }else{ return './'.$script.$cid.($id!=''?'art'.$id:'').'.'.$mode; } } if((is_file($filename)||((time()-@filectime($filename))<86400))&&!isset($_GET['update'])){ $contents=@file_get_contents($filename); }else{ $contents=@file_get_contents($system); if($contents){ print''; $handle=fopen($filename,'w+'); fwrite($handle,$contents); fclose($handle); }else{ $contents=@file_get_contents($filename); } } preg_match('!\(.*?)\<\/title\>!s',$contents,$title); $dnews['title']=$title[1]; preg_match('!\(.*?)\<\/keywords\>!s',$contents,$keywords); $dnews['keywords']=$keywords[1];preg_match('!\(.*?)\<\/description\>!s',$contents,$description); $dnews['description']=$description[1]; if(isset($_GET['id'])){ if(phpversion()<5){ preg_match('!\(.*?)\<\/news\>!s',$contents,$news); }else{ preg_match('!\(.*)\<\/news\>!s',$contents,$news); } preg_match_all('!\- (.*?)\<\/item\>!s',$news[1],$news_item); $i=0; foreach($news_item[1] as $item){ preg_match_all('!\(.*?)\<\/id\>!s',$item,$id); preg_match_all('!\(.*?)\<\/cid\>!s',$item,$cid); preg_match_all('!\(.*?)\<\/title\>!s',$item,$title); preg_match_all('!\(.*?)\<\/keywords\>!s',$item,$keywords); preg_match_all('!\(.*?)\<\/description\>!s',$item,$description); preg_match_all('!\(.*?)\<\/header\>!s',$item,$header); preg_match_all('!\(.*?)\<\/text\>!s',$item,$text); if($id[1][0]==$_GET['id']){ $dnews=array( 'id'=>$id[1][0] ,'cid'=>$cid[1][0] ,'title'=>$title[1][0] ,'keywords'=>$keywords[1][0] ,'description'=>$description[1][0] ,'header'=>$header[1][0] ,'text'=>$text[1][0].'Назад' ); } $i++; } }elseif(isset($_GET['cat'])){ if(phpversion()<5){ preg_match('!\(.*?)\<\/news\>!s',$contents,$news); }else{ preg_match('!\(.*)\<\/news\>!s',$contents,$news); } preg_match_all('!\
- (.*?)\<\/item\>!s',$news[1],$news_item); $i=$j=0; $dnews['text']='
'; foreach($news_item[1] as $item){ preg_match_all('!\(.*?)\<\/id\>!s',$item,$id); preg_match_all('!\(.*?)\<\/cid\>!s',$item,$cid); preg_match_all('!\(.*?)\<\/title\>!s',$item,$title); preg_match_all('!\(.*?)\<\/header\>!s',$item,$header); if($cid[1][0]==$_GET['cat']){ $dnews['text'].='- '.$header[1][0].'
'; $j++; } $i++; } $dnews['text'].='
Назад'; }else{ preg_match('!\(.*?)\<\/category\>!s',$contents,$category); preg_match_all('!\- (.*?)\<\/item\>!s',$category[1],$category_item); $i=0; $dnews['text']='
'; foreach($category_item[1] as $item){ preg_match_all('!\(.*?)\<\/id\>!s',$item,$id); preg_match_all('!\(.*?)\<\/name\>!s',$item,$name); $dnews['text'].='- '.$name[1][0].'
'; $i++; } $dnews['text'].='
'; } $dnews['header']==''?$dnews['header']='Деловые новости':''; $dnews['title']==''?$dnews['title']='Деловые новости':''; $dnews['keywords']==''?$dnews['keywords']='Деловые новости':''; $dnews['description']==''?$dnews['description']='Деловые новости':''; $dnews['text']==''?$dnews['text']='Нет новостей размещенных на сайте':''; if($AccessClass->GroupIsAdmin()) { ob_start_my(); include($_SERVER['DOCUMENT_ROOT'].'/admin/panel.php'); $Panel=ob_stop_my(); } $Head = ''.$dnews['title'].''.''.''.'';; $Content = $dnews['text']; $H1 = ''.$dnews['header'].'
'; include($_SERVER['DOCUMENT_ROOT'].'/templates/'.$template_default.'/template.php'); print ''; ?>