View file dportal_0.2/bibl/inci.php

File size: 975B
<?
include 'dan.php';


 print"<img src=\"$dir_razd/txt.png\" alt=\".\"/> <a href=\"bibl/razdel.php?ver=$ver&amp;pas=$pas&amp;login=$login\">Статьи:</a><br/><small>";


$ar_news="";

$shet_razdel=@file("$dir_razd/kateg.dat");
$n=0;
while($n<=$shet_razdel[0]){

$dir = @opendir ("$dir_razd/$n");
  while ( $file = @readdir ($dir))
  {
    if ( $file != "."& $file != ".." & $file!="razdel.dat")
    {
	$file=explode(".dat", $file);
   $file=$file[0];
      $ar_news[]=$file;
	  $ar_nera[]=$n;
    	}
	  }
  @closedir ($dir);
$n++;}

$shet=0;
$na_page=3;
arsort($ar_news);
foreach( $ar_news as $index => $value){
if($shet<$na_page){
$name_news=@file("$dir_razd/$ar_nera[$index]/$value.dat");
$name_news=trim($name_news[0]);
if($ver=="wml"){$name_news=str_replace("$", "$$", $name_news);}
print"
<a href=\"$dir_razd/read.php?ver=$ver&amp;login=$login&amp;pas=$pas&amp;text=$value&amp;raz=$ar_nera[$index]\">$name_news</a><br/>
";
$shet++;}

}
  print"</small><hr/>";

?>