View file menu.php

File size: 1Kb
<? include "head.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('.');
}


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

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