#!/usr/bin/perl #!c:/perl/bin/perl $|=1; ############################################################################# # 本软体著作权属【琪琪的家】所有。【本版严禁 转传、收录】 # # 任何人皆可自由使用本程式于非商业用途, 如需用于商业用途请于事先告知。 # # 您可以对程式内容作必要的修改,但是必须先告知作者及保留本段宣告资料。 # # 人物图是 [小正正] http://www2.nsysu.edu.tw/alex/ 提供。 # # 【琪琪的家】 http://yaci.hypermart.net/ # ############################################################################# $data_path = "data/"; $gbhead = 'book.htm'; #留言格式档 $gbdata = $data_path.'book.txt'; #留言资料档 $cgiurl = 'book.cgi'; #留言读取程式 $picdir = 'pic'; #存放图档目录 $num = 1; #显示留言编号 1=on $show = 10; #设定每页笔数 $pass = 'xinyi'; #设定板主密码 ############################################################################# &parse_get; open (MSGS, $gbdata); @MSGSDATA=; close (MSGS); $i=0; $j=1; $temp=1; $flag=0; foreach $line (@MSGSDATA) { if ($line =~ //) { $i++; } } $page=($i%$show); if ($page != 0 || $i == 0){ $page=int($i/$show)+1; } else { $page=($i/$show); } if ($cici eq ""){ $min=1; $max=$show; $cici=1; } if ($cici ne ""){ $min=(($cici-1)*$show)+1; $max=$cici*$show; } print "Content-type: text/html\n\n"; open (FILE, $gbhead);@lines=;close (FILE); foreach $head (@lines) { if ($head=~ //) { print "
※ 现有 $i 笔 ※ "; print "【第 $cici 页】 ※ 共分 $page 页 ※\n"; foreach $line (@MSGSDATA) { ($cnt,$hidd,$msg,$sex,$name,$url,$www,$email,$time)=split(/∥/,$line); chop($line); $cnt=~ s///g; if ($yaci ne "$pass" && $hidd eq "on") {$msg="【这是给板主的悄悄话】"; } if ($yaci eq "$pass" && $hidd eq "on") { $msg="★悄悄话★
$msg";} $msg=~s/
/
\n/g; if ($temp>=$min && $temp <=$max) { print "\n"; print "
\n"; print "$msg
"; print "$name\n"; if ($url) { print "\n"; print "\"$www\"\n"; } if ($email) { print "\n"; print "\"$email\"\n"; } print ""; print "$time\n"; if ($num eq 1 ){ print "$cnt"; } print "

\n"; $flag=1; } $temp++; } if ($flag == 0){ print "本 页 尚 未 有 留 言 哦 !
"; print "";} print "
\n"; while ($i>0) { print "【"; print "" if ($cici != $j); print "第 "; if ($j <10 ){ print "0"; } print "$j 页"; print "" if ($cici != $j); print "】\n"; $i=$i-$show; $j++; } print "
"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
回覆:\n"; print "删除观密
\n"; print "本程式由\n"; print "盈嘉网络 提供
"; print "\n"; } else { print "$head"; } } sub parse_get { $buff = "$ENV{'QUERY_STRING'}"; ($cici,$yaci)=split(/∥/,$buff); }