<?php	
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";
$text = @file("../local/profil/$log.prof"); 
if ($text!=""){
$udata = explode(":||:",$text[0]);
$provlog=trim($udata[0]);
$provpar=trim($udata[1]);
$dostup=trim($udata[7]);
$privat=trim($udata[10]);}
echo '<div class="b">';
echo '<b><font color="#33D05F">Статьи Сайта</font></b></div>';
echo 'Категории:<br>';
$dir = opendir ("."); 
while ($file = readdir ($dir)) 
{if(!eregi("[^a-z0-9_-]",$file) && ($file != "img")) 
{$a[]=$file;}}  
closedir ($dir); 
sort($a);
$total = count($a);  
for ($i = 0; $i < $total; $i++){ 
$d=opendir($a[$i]); $n = "0"; while(($k=readdir($d))!==false){ if (ereg(".txt$", $k)){$n++;}} closedir($d); 
$lib_name=file_get_contents("$a[$i]/name.dat");
echo '» <a href="lj.php?did='.$a[$i].'&amp;'.SID.'">'.$lib_name.'</a> ['.$n.']<br>';}
echo '</div>';
/////////////////////////////////////////////////////////////////////////
$dir = opendir ("."); 
while ($file = readdir ($dir)) 
{if (( $file != ".") && ($file != "img") && ($file != "..") && ($file != ".htaccess") && ($file != "index.php") && ($file != "img") && ($file != "addtext.php") && ($file != "add.php") && ($file != "lj.php")&& ($file != "top.php") && ($file != "topj.php")&& ($file != "search.php")) 
{$a[]=$file;}}  
closedir ($dir);  
$total2 = count($a);  
for ($i = 0; $i < $total; $i++){ 
$dir = opendir ("./$a[$i]"); 
while ($file = readdir ($dir)) 
{if (( $file != ".") && ($file != "..") && ($file != "img") && ($file != ".htaccess") && ($file != "index.php") && ($file != "count") && (!ereg (".dat$", "$file")&& !ereg (".php$", "$file")&& !ereg (".GIF$", "$file"))) 
{$a[]=$file;}}  
closedir ($dir); 
$tot = count($a); 
$to=round($tot-$total2); 
for ($i2 = 0; $i2 < $total2; $i2++){ 
$dircc = opendir ("./$a[$i2]");
while ($filecc = readdir ($dircc)) {
$filtime=filemtime ("./$a[$i2]/$filecc"); 
$filtime=$filtime+(3600*24*5); 
$ttime=time();
if($filtime>=$ttime){   
if (ereg(".dat$", "$filecc"))
{$cc[]=$filecc;   }}} 
closedir ($dircc);}
$to2 = count($cc); 
if($to2>0){   
$dtext=(int)$to.'/+'.(int)$to2; 
}else{
$dtext =(int)$to;}}

echo '<img src="img/edit.png" alt=""> <a href="add.php?'.SID.'">Добавить статью</a><br>';
$dir1 = opendir ("../local/gazeta");
while ($file1 = readdir ($dir1)) 
{if (( $file1 != ".") && ($file1 != "..") && ($file1 != ".htaccess") && ($file1 != "index.php")) // эти файлы игнорируем
{$a1[]=$file1;}} 
closedir ($dir1);
   
$total1 = count($a1); 
/////////////////////////////////////////////////////////////////////////

echo '<img src="../images/img/homepage.gif" alt=""> <a href="../index.php?'.SID.'">На главную</a><br/>';


include_once"../themes/$config_themes/foot.php";
?>