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} 
$cityname
$index 管理人员 社区区长:$admname 注册会员:$membertol
欢迎新会员:$newmember
论坛 主题 最后发表 版主 私人珍藏
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 "
 $sort
"; }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="
$rtitles ($lastname)
$rlasttime
"; } 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
个人简介
$lucida2
个人简介
昵 称 :$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 < 在线用户
看看现在谁在这个论坛($people)
$rname1
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 < $logourl
$webname
$intro
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
EOF exit; } ########## sub index{ print "Content-type: text/html\n\n"; print <
3
EOF if($id ne ""){ open (CHAT,"$filepath/list/$id.cgi"); $line=; close(CHAT); ($bzmc,$rpass,$bzrmail,$outurl,$bbsname)=split(/\t/,$line); print <$bbsname
EOF }else{ print <$cityname EOF } exit; } sub many{ open (FILE,"$filepath/data/people.cgi"); @LINES=; close(FILE); $people=@LINES; print "Content-type: text/html\n\n"; print < EOF }else{ $tol=$rfy+$rhf; open(NUMBER,"$filepath/guest/2$username.cgi"); $NUMBER=; close(NUMBER); ($lys,$oldlys,$money,$charm)=split(/\t/,$NUMBER); if($Cookies{estate} eq "1"){$estate="隐身";}else{$estate="在线";} print <BODY{scrollbar-face-color:$bgcolor0;scrollbar-3dlight-color:$bgcolor0;scrollbar-darkshadow-color:$bgcolor0;scrollbar-track-color:$bgcolor0;scrollbar-arrow-color:ffffff;scrollbar-shadow-color:ffffff;}
$username
EOF }} sub lucida{ opendir (MEMBERDIR2, "$ImgDir/img"); @b = readdir(MEMBERDIR2); closedir (MEMBERDIR2); $star=$b[rand (@b)]; $star =~s/.jpg//g; if(($star eq ".")||($star eq "..")){$star="$bzmc";} $star2=$b[rand (@b)]; $star2 =~s/.jpg//g; if(($star2 eq ".")||($star2 eq "..")){$star2="$bzmc";} open(TMP,">$filepath/data/lucida"); print TMP "$star\t$star2"; close(TMP); } sub top{ open(ROOM,"$filepath/data/leftlist"); @lines=; close(ROOM); foreach $username1 (@lines){ ($id1,$sort)=split(/__/,$username1); ($id,$bbsname)=split(/\t/,$id1); if($id ne ""){ $i++; open(PSD,"$filepath/list/$id/bbs"); @hastitles=; close(PSD); $wzs=@hastitles; @string[$i]="$wzs\t$id\t$bbsname\n"; }} @string=(reverse sort{$a<=>$b}@string); open(PSD,">$filepath/data/bbstop"); foreach(@string[0..9]){ $_=~s/\n//isg; print PSD "$_\n"; } close(PSD); chmod(0666,"$filepath/data/bbstop"); } ######################### END OF SCRIPT #########################
EOF if($username eq ""){ print <

$from

您目前是访客

--欢迎您的到来--

■ 登陆社区

■ 找回密码

■ 注册会员

■ 返回首页
----------------
在线用户:$people人
注册会员:$membertol人
----------------
Version $ver

EOF ######## if ($bbs_top){ @toltime=stat("$filepath/data/bbstop"); @modtime=gmtime(@toltime[9]); @modtime[5]=@modtime[5]+1900; @modtime[4]=@modtime[4]+1; $modtime=@modtime[5]."年".@modtime[4]."月".@modtime[3]."日"; $rqtop=(-M "$filepath/data/bbstop"); if(($rqtop > $lucidatime)||(-z "$filepath/data/leftlist")){⊤} open (FILE,"$filepath/data/bbstop") || ⊤ @line=; close(FILE); open(TITLES,"$filepath/data/bbstop"); @hastitles=; close(TITLES); for ($i=0; $i<$bbs_top; $i++){ $hastitle=@hastitles[$i]; if($hastitle ne ""){ ($wzs,$id,$bbsname)=split(/\t/,$hastitle); $bbstop="$bbstop  ├ $bbsname
"; }} print <论坛排行
$bbstop
EOF }else{ open(ROOM,"$filepath/data/leftlist"); @lines=; close(ROOM); if(@lines){ $i=1; foreach $line (@lines){ ($id1,$sort)=split(/__/,$line); if($sort eq "" && $i eq 1){print " 论坛导航
";} if($sort ne ""){ print "
 $sort
"; }else{ ($id,$bbsname)=split(/\t/,$id1); print " ├ $bbsname
"; } $i++; } } print "
"; } ######## open (PEO,"$filepath/fun.txt"); @fun=; close (PEO); if(@fun){ print <社区娱乐
EOF foreach $fun (@fun){ chomp($fun); ($funname,$funurl)=split(/__/,$fun); print " ├ $funname
"; } } print <  个人服务
 ├ 修改资料
 ├ 个性设置
 ├ 照片上传
 ├ 头像上传
 ├ 查看留言
 ├ 我的文章
 ├ 我的收藏
 系统服务
 ├ 社区公告
 ├ 回 收 站
 ├ 更改用户
 ├ 会员排行
 ├ 社区管理
 私人珍藏
EOF open (PEO,"$filepath/favorites/$username.cgi")||open (PEO,">$filepath/favorites/$username.cgi"); @lineszd=; close (PEO); foreach $lineszds (@lineszd) { chomp($lineszds); ($rnamezd,$bbsming)=split(/\t/,$lineszds); print " ├ $bbsming
"; } print <  改变状态
 ├ 上 线
 ├ 隐 身
 返回首页
 离开社区
----------------
在线用户:$people人
注册会员:$membertol人
----------------
Version $ver