<? Error_Reporting(E_ALL & ~E_NOTICE);?> <? header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); $action=empty($_GET['action']) ? null:$_GET['action']; $id=empty($_GET['id']) ? null:$_GET['id']; $mode=empty($_GET['mode']) ? 'main':$_GET['mode']; $page=empty($_GET['page']) ? null:$_GET['page']; include('../config/config_main.php'); include('../includes/functions.php'); include('../includes/class_db.php'); if ($action) include('../includes/functions_action.php'); authorization('../'); if (checkRights('moder')) { if (!empty($_GET['moder'])) {set_Cookie('moder',$_GET['moder']); $_COOKIE['moder']=$_GET['moder'];} } else {set_Cookie('moder','off'); $_COOKIE['moder']='off';} $out['{sectionName}']='Статьи'; $out['{today}']=($ini['enable_Today']) ? getToday():''; $out['{events}']=($ini['enable_Events']) ? getEvents('../'):''; $out['{left}']=''; $out['{main}']=''; $out['{metaTags}']=''; $out['{keywords}']=''; $out['{description}']=''; $out['{titleadr}']=''; $titlePlus=''; if ($user['loggedIn']) { $out['{left}'].=str_replace('{referrer}',$referrer,file_get_contents('../templates/form_exit.tpl')); } else { $out['{left}'].=str_replace('{referrer}',$referrer,file_get_contents('../templates/form_enter.tpl')); } $out['{title}']=$ini['sitename'].'. '.$title; $out['{titleadr}']=$title; //////////////////////////////////////////////////////////////////////////////// switch ($mode) { case 'main': $file="data.dat"; if ($mode == "main") { $titlePlus=''; $fp = fopen ("data.dat", "r"); while (!feof($fp)) { $read = fgets($fp, 9999); list($col,$titlePlus,$author,$pre,$msg,$file,$date)=explode(':',$read);{ $out['{main}'].='<h3>'.$titlePlus.'</h3>'.$msg.'<br><p align="right"><small><a href="content.php?mode=see&show='.$col.'">дaльше</a></small></p>'; $out['{sectionName}']=$titlePlus; $out['{keywords}']=$ini['defKeyWords'].'/Статьи'; $out['{description}']='Статьи'; $out['{titleadr}']='Статьи/'; }}} else { $out['{out}']='Нет файла для чтения!'; } break; case 'see': $titlePlus=''; $file="data.dat"; if ($mode == "see" && $page == "$show") { $titlePlus=''; $fp = fopen ("data.dat", "r"); while (!feof($fp)) { $read = fgets($fp, 9999); list($col,$titlePlus,$author,$pre,$msg,$file,$date)=explode(':',$read); { $out['{main}'].='<h3>'.$titlePlus.'</h3>'.$msg.'<br><p align="right"><small>'.$date.'</small></p>'; $out['{sectionName}']=$titlePlus; $out['{keywords}']=$ini['defKeyWords'].'/'.$titlePlus; $out['{description}']=$titlePlus; $out['{titleadr}']='Статьи/'.$titlePlus; } } } break; } echo strtr (file_get_contents('../templates/index.tpl'), $out); ?> |