require("to_set.php");?>
公告區
if(@$HTTP_GET_VARS['more']=="all"){
# 假設最多的公告筆數為1000筆
$page="1000";
}else{
# $page中代表的是每頁顯示的數目
$page="3";
}
if(@$num==""){
$num=$page;
}
# 讀取儲存檔案、計算檔案長度
$lines=file("sub.dat");
$count=count($lines);
for($a=($count-1);$a>=0;$a--){
$line[]=$lines[$a];
}
?>
# 用for迴圈來讀取公告筆數
for($i=0;$i<$count;$i++){
# 用if判斷句來擷取公告筆數的顯示範圍
if($i>=($num-$page)&&$i<$num){
# 先用list將sub.dat中的檔案分配好,在將檔案用explode()函數來分割
list($kind,$date,$title,$url,$name,$mail,$updname,$hidden,$note)=explode("∥",$line[$i]);
$id=$count-$i;
# 去除php中的斜線衝碼
$url=stripslashes($url);
$name=stripslashes($name);
$mail=stripslashes($mail);
$title=stripslashes($title);
$kind=stripslashes($kind);
$note=stripslashes($note);
# 判斷$mail的值
if($mail!=""){
$person="$name";
}else{
$person="$name";
}
# 判斷$url
if($url==""){
$url="";
}else{
$url="
網址→$url";
}
# 判斷$style_pic的值
if($style_pic=="open"){
$kind_pic="
";
}else{
$kind_pic="";
}
# 顯示列串
if($note):
?>
Warning: Undefined variable $date in /home/unit/ES__/earth/public_html/new/es-news/sub3.php on line 87
|
Warning: Undefined variable $title in /home/unit/ES__/earth/public_html/new/es-news/sub3.php on line 90
|
Warning: Undefined variable $kind_pic in /home/unit/ES__/earth/public_html/new/es-news/sub3.php on line 95
|
Warning: Undefined variable $note in /home/unit/ES__/earth/public_html/new/es-news/sub3.php on line 98
Warning: Undefined variable $url in /home/unit/ES__/earth/public_html/new/es-news/sub3.php on line 98
|
|
|
|
# 結束列串
endif;
}
}
?>