"; print "
沒有任何檔案
"; print "
"; } elseif ($number > 0) { //處理分頁 if ($total%$limit!=0) { $totalpage=intval($total/$limit)+1; }else{ $totalpage=intval($total/$limit); } $nowpage=intval($show/$limit)+1; echo "
總檔案數: $total  | "; echo "每頁$limit 筆 | 共$total 筆 | 第$nowpage /$totalpage 頁"; echo "
"; //秀出內容 while ($i < $number){ $row = mysql_fetch_array($result); $fileid=$row[fileid]; $filename = stripslashes($row[filename]); $name=$row[name]; $writer=$row[writer]; $writerurl = $row[writerurl]; $hits = $row[hits]; $comment = nl2br($row[comment]); $inputdate = $row[inputdate]; $demourl = $row[demourl]; $demohits = $row[demohits]; $votehits = $row[votehits]; $filesize = $row[filesize ]; $votegrade = $row[votegrade]; $used_link = $row[used_link]; //計算時間! $tok = strtok($inputdate,'-') ; $j = 0 ; while ($tok) { $d[$j] =$tok ; $tok = strtok('-') ; $j = $j+1 ;} $year=$d[0]; $month=$d[1]; $day=$d[2]; $since=mktime(0,0,0,$month,$day,$year); $now=time(); $day_off=($now-$since)/86400; $new= ($day_off<1)? "新!":$new=""; $new.=($hits>20)? "燒!":""; $new.=($demohits>20)? "酷!":""; $new.=($votehits>20)? "好!":""; $voteshow=($votehits<4)? " 少於3票": "$votegrade ($votehits 票)"; //檢查是否有示範連結 $votelink=""; if(strlen($demourl)<8){ $demolink=""; $votelink=""; }else $demolink=""; $downlink= ($filesize <1 && $used_link=="N")? "":""; if(strlen($writerurl)<8) $writerurl=""; //精簡模表格分色 $tr_class = ($i % 2)? "td_main":"td_top"; ?>
"; else echo ""; echo " "; if ($type!=1){ echo" " ; } ?>
$fileid $name $new $demolink 示範:$demohits  $downlink 下載:$hits $votelink 票選:$voteshow  
簡介:
     $comment
作者: $writer 檔案大小  $filesize byte 上傳日期:  $inputdate
"; $i++; } print "
總檔案數: $total  | "; print "每頁$limit 筆 | 共$total 筆 | 第$nowpage /$totalpage 頁"; print "
"; require("footer.php"); ?>