View file menu.php

File size: 1.39Kb
<? include "head.php"; ?>
<? include "config.php"; ?>
<div class="title">Меню:</div>
<div class="main">

<?

if($mode == news)
{

$f = file('data/news.txt'); 


for($i=0;$i<count($f);$i++){ 

list($one,$two) = explode('<|#|>',$f[$i]); 


$div = "<b>";

$div_cl = "</b>";
echo   "$div $one<BR>$div_cl";
echo "$two<br><br>";
}


}

if($mode == pic)
{
function read_rec($dr)
{
$dir .= pic;
$indent = sizeof(explode("/", $dir));
$hndl = opendir($dir) or die("Cant open directory");

while(false !== ($str = readdir($hndl)))
{
if(($str != ".") && ($str != ".."))
{
$str = $dir."/".$str;
if(is_dir($str))
{
$i = 0;
while($i++ < $indent*5)
{
print "&nbsp";
}
print "<b><font color=\"red\">".basename($str)."</font></b><br>";
read_rec($str);
}
else
{
$x = 0;
while($x++ < $indent*5)
{
print "&nbsp";
}
print "<a href = \"$str\">".basename($str)."</a><br>";
}
}
}
closedir($hndl);
}
read_rec('.');
}

$mode = $_GET['mode'];

if($mode == 'stat') {
$stat = mysql_query("SELECT * FROM blogs ORDER BY id DESC LIMIT 1");
$stat_view = mysql_fetch_array($stat);
$stat_cats = mysql_query("SELECT * FROM cat ORDER BY id DESC LIMIT 1");
$stat_cats_v = mysql_fetch_array($stat_cats);
echo "Всего категорий сделано: $stat_cats_v[id] <br>";
echo "Всего записей сделано: $stat_view[id]";
}

?>
<br><br>
<a href="index.php">На главную</a>

</div>
<? include "foot.php"; ?>