www.pudn.com > bbs3000afree.zip > list.cgi
#!/usr/bin/perl
#------------------------------------------------------#
# 本程序为Yuzi工作室提供 #
# Yuzi论坛3000(BBS3000)v4.00 #
#------------------------------------------------------#
$cgipa="."; # CGI程序文件的绝对路径
$listpage=20; # 社区每页显示的论坛数目
######################
## 以下部分不需修改 ##
######################
require "$cgipa/setup.cgi";
&GetCookies;
if ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
} else {
$buffer = $ENV{'QUERY_STRING'};
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value=~s/\.\.//g;
$FORM{$name} = $value;
}
$page=$FORM{'page'};
$username=$FORM{'username'};
$menu=$FORM{'menu'};
$id=$FORM{'id'};
$username=$Cookies{username};
$userpsd=$Cookies{password};
if($username ne ""){
open(PSD,"$filepath/yhzl/$username.cgi");
$line=;
close(PSD);
($rpassword,$rusername,$rdmail,$rdhome,$rdlasttime,$rdqm,$rdsex,$rdwork,$rdcity,$rdlove,$rfy,$rhf,$tu,$jiao,$iewin,$QQ,$photo,$rating,$levelname,$level)=split(/\t/,$line);
if ($rating eq ""){$rating=0;}
}
if($menu eq ""){&index;exit;}
if($menu eq "main_frame"){
print "Content-type: text/html\n\n";
print <
EOF
exit;
}
open(TITLES,"$filepath/data/newmember");
$m=;
close(TITLES);
($newmember,$membertol)=split(/\t/,$m);
if($menu eq "many"){&many;exit;}
if($menu eq "show"){&show;exit;}
exit;
##########
sub show{
if($Cookies{estate} eq "1"){$tu=estate;}
$people=1;
open (FILE,"$filepath/data/people.cgi");
@LINES=;
close(FILE);
$SIZE=@LINES;
open (FILE,">$filepath/data/people.cgi");
for ($i=0;$i<$SIZE;$i++)
{
$_=$LINES[$i];
($addr,$come_hour,$come_min,$come_sec,$olduser)=split(/\t/,$_);
$flag=($hour-$come_hour)*3600+($min-$come_min)*60+($sec-$come_sec);
if($addr eq $from && $olduser eq $Cookies{username}){
print FILE $from."\t".$hour."\t".$min."\t".$sec."\t".$Cookies{username}."\t$tu\t社区首页\t\tlist.cgi target=_top\n";
$check=1;
}
elsif ($flag < $timepop && $flag > 0) {
print FILE $_;
$people++;
}}
if ($check == 0) {
print FILE $from."\t".$hour."\t".$min."\t".$sec."\t".$Cookies{username}."\t$tu\t社区首页\t\tlist.cgi target=_top\n";
}
close (FILE);
open(PSD,"$filepath/list/bbs");
$index=;
close(PSD);
open(PSD,"$filepath/list/$index");
$line=;
close(PSD);
($index)=split(/\t/,$line);
&css;
print <TABLE{BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:1px}TD{BORDER-RIGHT:0px;BORDER-TOP:0px}
EOF
open(ROOM,"$filepath/data/list.cgi");
@lines=;
close(ROOM);
$size=@lines;
$ii=0;
$j=$size;
while ($j>0) {
$j=$j-$listpage;
$ii++;
}
if($page eq ""){$page=1;}
$pages=$page-1;
$pages=$page*$listpage-$listpage;
for($i=$pages; $i<$pages+$listpage; $i++) {
$line=@lines[$i];
chomp($line);
($username1,$sort)=split(/__/,$line);
if($sort ne ""){
print "";
}else{
($username1)=split(/\t/,$username1);
if($username1 ne ""){
open(TITLES,"$filepath/list/$username1.cgi")|| &errorview("系统不存在ID为$username1的论坛,请到社区管理->>论坛列表设置->>更新列表");
$m=;
close(TITLES);
($rname,$secret,$rmail,$rhome,$rtitle,$fbzmc2,$rtime,$htmlt,$htmlw,$jj,$fbzmc)=split(/\t/,$m);
$bbsbook="$filepath/list/$username1/bbs";
open(TITLES,"$bbsbook");
@hastitles=;
close(TITLES);
$wzs=@hastitles;
if($wzs > 0){
$rq=(-M "$bbsbook");
$hastitle=@hastitles[0];
open(fff,"$filepath/list/$username1/$hastitle");
$fff=;
close(fff);
($rtitles,$rthistime,$rusername,$nr,$rfrom,$rhasreply,$remote,$lastname,$rlasttime)=split(/\t/,$fff);
if (length($rtitles) > 20) {$rtitles = substr($rtitles,0,20);$rtitles.="...";}
if($lastname eq "--"){$lastname=$rusername};
$zhuihou="";
}
print <
EOF
if($secret ne ""){print " ";}
elsif($rq < "1"){print " ";}else{print " ";}
print <$rtitle $jj |
$wzs |
$zhuihou |
$rname $fbzmc $fbzmc2 |
添加/删除
|
EOF
}}
}
foreach $line (@LINES) {
($rip,$r1,$r2,$r3,$rname,$tuu,$namebbs,$rtitles,$act)=split(/\t/,$line);
if($rtitles){$rtitless="\n当前动作:浏览“$rtitles”";}
$particular="活动时间:$r1:$r2:$r3\n目前位置:$namebbs$rtitless";
if($rname ne "" && $tuu ne "estate"){
$newline="";
if($NO_count <6){$NO_count ++;}else{$NO_count=1;}
$newline=" |
"if ($NO_count==6);
$rname2=" $rname | $newline";}
else{$rname2="";}
$rname1="$rname1$rname2";}
if($openlucida eq "on"){
$rqlucida=(-M "$filepath/data/lucida");
if(($rqlucida > $lucidatime)||(-z "$filepath/data/lucida")){&lucida;}
open (FILE,"$filepath/data/lucida") || &lucida;
$lucida=;
close(FILE);
($lucida,$lucida2)=split(/\t/,$lucida);
open(PSD,"$filepath/yhzl/$lucida.cgi");
$lines=;
close(PSD);
($rpassword,$rname,$rmail,$rhome,$rlast,$rqm,$rsex,$rwork,$rcity,$rlove,$rfy,$rhf,$tuu,$jiao,$iewin,$QQ,$photo)=split(/\t/,$lines);
if($jiao eq ""){$jiao="这家伙很懒,什么都没有留下。"};
if($photo eq ""){$photostar="$imagurl/photo.gif";}else{$photostar="$ImgurlDir/$photo.jpg";}
if (length($jiao) > 100) {$jiao = substr($jiao,0,100);$jiao.="...";}
open(PSD,"$filepath/yhzl/$lucida2.cgi");
$lines=;
close(PSD);
($rpassword,$rname,$rmail,$rhome,$rlast,$rqm,$rsex2,$rwork,$rcity,$rlove,$rfy,$rhf,$tuu,$jiao2,$iewin,$QQ,$photo2)=split(/\t/,$lines);
if($jiao2 eq ""){$jiao2="这家伙很懒,什么都没有留下。"};
if($photo2 eq ""){$photostar2="$imagurl/photo.gif";}else{$photostar2="$ImgurlDir/$photo2.jpg";}
if (length($jiao2) > 100) {$jiao2 = substr($jiao2,0,100);$jiao2.="...";}
print <
|
| 社区明星 |
|
 |
个人简介 |
 |
个人简介 |
昵 称 :$lucida 性 别 :$rsex 介 绍 :$jiao |
昵 称 :$lucida2 性 别 :$rsex2 介 绍 :$jiao2 |
EOF
}
if($username ne ""){
($kkk)=split(/\)/,$ENV{'HTTP_USER_AGENT'});
($bzd,$ie,$win,$me)=split(/;/,$kkk);
if($me eq " Win 9x 4.90"){$win=" Windows Me"}
elsif($win eq " Windows NT 5.0"){$win=" Windows 2000"}
elsif($win eq " Windows NT 5.1"){$win=" Windows XP"};
open(NUMBER,"$filepath/guest/2$username.cgi");
$NUMBER=;
close(NUMBER);
($lys,$tollys)=split(/\t/,$NUMBER);
if($lys){$msg="";}
print <|
| 个人状态 |
|
 | $username - 您现在有 $tollys 条留言 (有 $lys$msg 条新留言) 您的 IP 是:$from 操作系统:$win 浏览器:$ie
|
EOF
}
print <|
| 在线用户 |
|
EOF
open (PEO,"$filepath/data/link");
@fun=;
close (PEO);
if(@fun){
print "";
foreach $fun (@fun){
($linkid,$webname,$weburl,$logourl,$intro)=split(/\t/,$fun);
if($logourl ne "" && $logourl ne "http://"){$logourl=" | ";}else{$logourl="";}
print < |
|
EOF
}}
print <
EOF
$j=$size;
while ($j>0) {
print "" if ($page != $ii);
print "[$ii]";
$j=$j-$listpage;
$ii--;
}
print <Powered by Yuzi Studios © 2001
Yuzi Bulletin Board VersionTM $ver | |