www.pudn.com > bbs3000afree.zip > deltitle.cgi
#------------------------------------------------------#
# 本程序为Yuzi工作室提供 #
# Yuzi论坛3000(BBS3000)v4.00 #
######################---------------------------------#
## 以下部分不需修改 ##
######################
if($Cookies{del} ne $deltitle || $Cookies{del} eq ""){&monitor;}
unless(-f "$filepath/list/$id/$deltitle"){
print "Content-type: text/html\n\n";
if ($FORM{'look'}){print "";exit;}else{
print "";
exit;}}
open(TITLES,"$filepath/list/$id/bbs");
@hastitles=;
close(TITLES);
$size=@hastitles;
if($size < 3){&errorview("您至少必须保留两条帖子!");}
open(TITLES,">$filepath/list/$id/bbs");
foreach $m (@hastitles){
chomp($m);
($rthistime)=split(/\t/,$m);
if($rthistime ne $deltitle){
print TITLES $m."\n";
}
}
close(TITLES);
rename("$filepath/list/$id/$deltitle","$filepath/recycle/$deltitle");
rename("$filepath/list/$id/$deltitle"."b","$filepath/recycle/$deltitle"."b");
unlink("$filepath/vote/$deltitle");
unlink("$filepath/vote/$deltitle.dat");
unlink("$filepath/vote/$deltitle.ip");
open(TITLES,"$filepath/recycle/bbs");
@hastitles=;
close(TITLES);
open(TITLES,">$filepath/recycle/bbs")||&errorview("系统无法建立文件,请检查 $filepath/recycle 目录属性是否为“777”");
print TITLES "$deltitle\t$id\t$bbsname\t$Cookies{username}\t$thistime\n";
for($i=0;$i<=18;$i++){$m=@hastitles[$i];print TITLES "$m";}
close(TITLES);
if (-e "$filepath/list/$id/top"){
open (FILE, "$filepath/list/$id/top");
@top= ;
close(FILE);
open (FILE, ">$filepath/list/$id/top");
foreach $top(@top) {
chomp($top);
if ($top ne $deltitle) {
print FILE "$top\n";
}}
close(FILE);
}
open(PSD,"$filepath/list/recycle/$deltitle");
$line=;
close(PSD);
($rtitles,$rthistime,$rusername)=split(/\t/,$line);
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);
print "Content-type: text/html\n\n";
if ($FORM{'look'}){print "";exit;}
else{
print "";exit;}
######################### END OF SCRIPT #########################