www.pudn.com > bbs3000afree.zip > quote.cgi


#!/usr/bin/perl 
#------------------------------------------------------# 
#         本程序为Yuzi工作室提供        # 
#        Yuzi论坛3000(BBS3000)v4.00      # 
#------------------------------------------------------# 
$cgipa=".";  # CGI程序文件的绝对路径 
###################### 
## 以下部分不需修改 ## 
###################### 
require "$cgipa/setup.cgi"; 
&GetCookies; 
if($Cookies{username}){open(PSD,"$filepath/yhzl/$Cookies{username}.cgi")||&errorview("对不起,此用户名还没有注册!");$liness=;close(PSD);($password)=split(/\t/,$liness);if($password ne $Cookies{password}){&errorview("对不起,您的密码错误!");}} 
$username=$Cookies{username}; 
$userpsd=$Cookies{password}; 
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=~tr/+/ /; 
$value=~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; 
$value=~s///g; 
$value=~s/\t/    /g; 
$value=~s/>/>/g; 
$value=~s/; 
close(CHAT); 
($bzmc,$secret,$bzrmail,$outurl,$bbsname,$fbzmc2,$rtime,$htmlt,$htmlw,$jj,$fbzmc)=split(/\t/,$line); 
} 
if($fff eq ""){ 
open(PSD,"$filepath/list/$id/$replytime"); 
$line=; 
close(PSD); 
chomp($line); 
($titles,$rthistime,$rusername,$nr,$rfrom,$rhasreply,$remote,$rlastname,$rlasttime,$re,$rhassee)=split(/\t/,$line); 
}else{ 
open(PSD,"$filepath/list/$id/$replytime"."b"); 
@lines=; 
close(PSD); 
foreach $line (@lines) { 
chomp($line); 
($rtime,$rthistime,$rusernamess,$nrss,$rfroms,$remote,$titless)=split(/\t/,$line); 
if($fff eq $rthistime){$nr=$nrss;$rusername=$rusernamess;$titles=$titless;$rfrom=$rfroms;}} 
} 
$nr=~s/(\)(.+?)(\<\/BLOCKQUOTE\>)//isg; 
$nr =~s/function(.+?)HTML代码如下://isg; 
$nr=&unybbcode($nr); 
$nr=~s/<([^<])*>//g; 
if($menu eq "mail"){&mail;exit;} 
if($id ne ""){ 
open (CHAT,"$filepath/list/$id.cgi"); 
$line=; 
close(CHAT); 
($bzmc,$rpass,$bzrmail,$outurl,$bbsname,$fbzmc2,$rtime,$htmlt,$htmlw,$jj,$fbzmc)=split(/\t/,$line); 
} 
if($menu eq ""){&okview("对不起,您没有输入任何数据!");} 
if($menu eq "ip"){&ip;exit;} 
if($menu eq "lock"){&lock;exit;} 
if($menu eq "good"){&good;exit;} 
if($menu eq "ungood"){&ungood;exit;} 
sub mail{ 
if($username ne ""){ 
open(PSD,"$filepath/yhzl/$username.cgi"); 
$line=; 
close(PSD); 
($rdpassword,$rdnamee,$rdmail)=split(/\t/,$line); 
} 
if ($mail eq "") { 
&css; 
print <


请 输 入 E-mail
如果要输入多个,请用“,”格开。





EOF }else{ if(!($mail=~ /.*\@.*\..*/)){&errorview("您的Email输入错误!");exit(0);} $sendto="$mail"; $subject="$titles"; $message="\n发信人:$rusername 讨论区:$bbsname\n标 题:$titles\n\n$nr\n\n免费论坛服务由 $zyname($zyurl) 提供 程序制作:Yuzi工作室(http://www.yuzi.net)\n\n\n"; if(-e $mailprg){&sendmail;}else{do "$cgipa/sub/smtp.cgi";} &okview("您的邮件已经送出!");exit; } exit; } sub lock{ &monitor; open(PSD,"$filepath/list/$id/$replytime"); $line=; close(PSD); ($rtitles,$rthistime,$rusername,$nr,$rfrom88,$rhasreply,$remote,$rlastname,$rlasttime,$re,$rhassee,$jing,$lock)=split(/\t/,$line); if ($lock eq "1"){ open(PSD,">$filepath/list/$id/$replytime"); print PSD $rtitles."\t".$rthistime."\t".$rusername."\t".$nr."\t".$rfrom88."\t".$rhasreply."\t".$remote."\t".$rlastname."\t".$rlasttime."\t".$re."\t".$rhassee."\t".$jing."\t".0; close(PSD); &okview("主题已经开放,可以自由回复了!");exit; }else{ open(PSD,">$filepath/list/$id/$replytime"); print PSD $rtitles."\t".$rthistime."\t".$rusername."\t".$nr."\t".$rfrom88."\t".$rhasreply."\t".$remote."\t".$rlastname."\t".$rlasttime."\t".$re."\t".$rhassee."\t".$jing."\t".1; close(PSD); &okview("主题已经关闭,不再接受新的回复!");exit; }} sub good{ &monitor; open(TITLES,"$filepath/list/$id/good"); @filename=; close(TITLES); foreach $filename(@filename) { chomp($filename); if($replytime eq $filename){&errorview("此主题已经添加到精华区了!");}} open(TITLES,"$filepath/list/$id/good"); @hastitles=; close(TITLES); open(TITLES,">$filepath/list/$id/good"); print TITLES "$replytime\n"; print TITLES @hastitles; close(TITLES); chmod(0666,"$filepath/list/$id/good"); open(PSD,"$filepath/list/$id/$replytime"); $line=; close(PSD); ($rtitles,$rthistime,$rusername,$nr,$rfrom88,$rhasreply,$remote,$rlastname,$rlasttime,$re,$rhassee,$jing,$lock,$voteman,$votetol)=split(/\t/,$line); open(PSD,">$filepath/list/$id/$replytime"); print PSD $rtitles."\t".$rthistime."\t".$rusername."\t".$nr."\t".$rfrom88."\t".$rhasreply."\t".$remote."\t".$rlastname."\t".$rlasttime."\t".$re."\t".$rhassee."\t1\t".$lock."\t".$voteman."\t".$votetol; close(PSD); open(NUMBER,"$filepath/guest/2$rusername.cgi"); $NUMBER=; close(NUMBER); ($lys,$oldlys,$money,$charm)=split(/\t/,$NUMBER); $money=$money+15;$charm=$charm+1; open(NUMBER,">$filepath/guest/2$rusername.cgi"); print NUMBER "$lys"."\t"."$oldlys"."\t"."$money"."\t"."$charm"; close(NUMBER); &okview("主题已经添加到精华区了!");exit; } sub ungood{ &monitor; open(TITLES,"$filepath/list/$id/good"); @hastitles=; close(TITLES); open(TITLES,">$filepath/list/$id/good"); foreach $m (@hastitles) { chomp($m); if($m ne "$replytime"){$check=1;}else{ print TITLES "$m\n"; }} close(TITLES); if ($check eq "1"){ open(PSD,"$filepath/list/$id/$replytime"); $line=; close(PSD); ($rtitles,$rthistime,$rusername,$nr,$rfrom88,$rhasreply,$remote,$rlastname,$rlasttime,$re,$rhassee,$jing,$lock,$voteman,$votetol)=split(/\t/,$line); open(PSD,">$filepath/list/$id/$replytime"); print PSD $rtitles."\t".$rthistime."\t".$rusername."\t".$nr."\t".$rfrom88."\t".$rhasreply."\t".$remote."\t".$rlastname."\t".$rlasttime."\t".$re."\t".$rhassee."\t0\t".$lock."\t".$voteman."\t".$votetol; close(PSD); open(NUMBER,"$filepath/guest/2$rusername.cgi"); $NUMBER=; close(NUMBER); ($lys,$oldlys,$money,$charm)=split(/\t/,$NUMBER); $money=$money-20;$charm=$charm-1; open(NUMBER,">$filepath/guest/2$rusername.cgi"); print NUMBER "$lys"."\t"."$oldlys"."\t"."$money"."\t"."$charm"; close(NUMBER); } &okview("主题已经成功移出精华区了!"); exit; } sub ip{ &monitor; &okview("$rusername的IP地址:$rfrom");exit; } ######################### END OF SCRIPT #########################