<?php
//+--------得到最新列表--------------------
require"include/functions.php";
require"data/config.php";
$myfile=new IWFile();
$mainarr=$myfile->arrayfromfile("data/main.php","\n");
$hitarr=$myfile->arrayfromfile("data/hit.php","\n");
$total=sizeof($mainarr)-1;
echo"document.write('<UL style=\"LIST-STYLE: url(image/dot.gif)\">');";
//最新10贴
if(empty($action)){
for($i=$total-1;$i>=max(0,$total-$adminnum);$i--){
list($name,,,,$pid)=explode("|%|",$mainarr[$i]);
echo"document.write('<li><a href=$admindown/index.php?action=info&id=$i&pid=$pid target=\"_blank\">$name (<font size=1>$hitarr[$i]</font>)</a>');";
}
}
//点击最新10贴
else if($action=="hit"){
  arsort($hitarr);
  $keys=array_keys($hitarr);
  for($i=0;$i<min($adminnum,$total);$i++){
    $key=$keys[$i];
	list($name,,,,$pid)=explode("|%|",$mainarr[$key]);
   echo"document.write('<li><a href=$admindown/index.php?action=info&id=$i&pid=$pid target=\"_blank\">$name (<font size=1>$hitarr[$key]</font>)</a>');";
  }
}
echo"document.write('</UL>');";
?>