?? recycle.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=<PSD>;close(PSD);($password)=split(/\t/,$liness);if($password ne $Cookies{password}){&errorview("對不起,您的密碼錯誤!");}}
##########
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;
$FORM{$name} = $value;
}
##########
opendir (MEMBERDIR2, "$filepath/recycle");
@members2 = readdir(MEMBERDIR2);
closedir (MEMBERDIR2);
if($FORM{menu} eq "clean"){
if($Cookies{username} ne "$admname"){&errorview("對不起,只有區長才有執行該操作的權限!");}
foreach $m (@members2){
unlink("$filepath/recycle/$m");
}
}
if($FORM{menu} eq "revert"){
#####################
&monitor;
rename("$filepath/recycle/$FORM{deltitle}","$filepath/list/$FORM{id}/$FORM{deltitle}")||&errorview("該帖子不存在回收站!");
rename("$filepath/recycle/$FORM{deltitle}"."b","$filepath/list/$FORM{id}/$FORM{deltitle}"."b");
open(TITLES,"$filepath/list/$FORM{id}/bbs");
@hastitles=<TITLES>;
close(TITLES);
open(TITLES,">$filepath/list/$FORM{id}/bbs");
print TITLES $FORM{deltitle}."\n";
print TITLES @hastitles;
close(TITLES);
open(PSD,"$filepath/list/$FORM{id}/$FORM{deltitle}");
$line=<PSD>;
close(PSD);
($rtitles,$rthistime,$rusername)=split(/\t/,$line);
open(NUMBER,"$filepath/guest/2$rusername.cgi");
$NUMBER=<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);
open(TITLES,"$filepath/recycle/bbs");
@hastitles=<TITLES>;
close(TITLES);
open(TITLES,">$filepath/recycle/bbs");
foreach $m (@hastitles){
chomp($m);
($rthistime)=split(/\t/,$m);
if($rthistime ne $FORM{deltitle}){
print TITLES $m."\n";
}}
close(TITLES);
}
if($FORM{menu} eq "log_frame"){
open (PEO,"$filepath/recycle/bbs");
@lines=<PEO>;
close (PEO);
foreach $line (@lines) {
chomp($line);
($slttitle,$id,$bbsname,$delname,$deltime)=split(/\t/,$line);
open(TITLES,"$filepath/recycle/$slttitle");
$m=<TITLES>;
close(TITLES);
($rtitles,$rthistime,$rusername,$nr,$rfrom,$rhasreply,$emote,$lastname,$rlasttime,$re,$rhassee,$jing,$lock)=split(/\t/,$m);
if (length($rtitles) > 34) {$rtitles = substr($rtitles,0,34);$rtitles.="...";}
if($lastname ne "--"){$lastname="<a onclick=min_yuzi() target=message href=yhreg.cgi?menu=viewuser&username=$lastname>$lastname</a>";}
if($Cookies{username} ne "$admname"){$delname="--";}
$new="$new
<table width=100% cellspacing=0 border=1 bordercolor=$bgcolor>
<tr align=center>
<td bgcolor=$bgcolor2 align=left width=40% onMouseOver=this.style.backgroundColor='$bgcolor1' onMouseOut=this.style.backgroundColor=''>
<input onclick=javascript:open('recycle.cgi?menu=revert&id=$id&deltitle=$slttitle','yuzi_frame','') type=button value=還原>
<img src=$imagurl/$emote.gif> $rtitles</td>
<td bgcolor=$bgcolor1 width=10% style=word-break:break-all><a onclick=min_yuzi() target=message href=yhreg.cgi?menu=viewuser&username=$rusername>$rusername</a></td>
<td bgcolor=$bgcolor2 width=7%>$rhasreply</font></td>
<td bgcolor=$bgcolor1 width=8%><a onclick=min_yuzi() target=message href=yhreg.cgi?menu=viewuser&username=$delname>$delname</a></td>
<td bgcolor=$bgcolor2 width=18%>$deltime</td>
<td width=17% bgcolor=$bgcolor1><a href=bbs$Cookies{style}.cgi?menu=listtitle&id=$id>$bbsname</a></td>
</tr></table>
";
}
&css;
$howfile=@members2-2;
print "<SCRIPT>if(top==self)document.location='recycle.cgi';</SCRIPT><center>
<table background=$imagurl/color/$color/iebg.gif width=100% border=0 cellpadding=4 cellspacing=0 bgcolor=$bgcolor0>
<tr>
<td width=50% align=center><font color=ffffff>回收站</font></td>
<td align=center><a href=recycle.cgi?menu=clean><font color=ffffff>
清空回收站(共有 $howfile 個文件)</font></a></td>
</tr></table>
<br>
<style>TABLE{BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:1px}TD{BORDER-RIGHT:0px;BORDER-TOP:0px}</style>
<table width=100% cellspacing=0><tr align=center>
<td width=40% bgcolor=$bgcolor0><font color=$bgcolor4>文章標題</font></td>
<td width=10% bgcolor=$bgcolor0><font color=$bgcolor4>作者</font></td>
<td width=7% bgcolor=$bgcolor0><font color=$bgcolor4>回復數</font></td>
<td width=8% bgcolor=$bgcolor0><font color=$bgcolor4>刪除者</font></td>
<td width=18% bgcolor=$bgcolor0><font color=$bgcolor4>刪除日期</font></td>
<td width=17% bgcolor=$bgcolor0><font color=$bgcolor4>所屬論壇</font></td>
</tr></table>
";
print "$new
<br><a href=javascript:history.back();>BACK</a><br>
<hr noShade SIZE=1 width=450>
本論壇言論純屬發表者個人意見,與 <font color=ff6633><b>$zyname</font></b> 立場無關<br>免費論壇服務由 <font color=ff6633><b><a href=$zyurl target=_blank>$zyname</a></b></font> 提供 技術支持:<b><a href=http://www.yuzi.net target=_blank>Yuzi工作室</a></b>
<br>Yuzi Bulletin Board<font style=font-size:7pt><sup><b>TM</b></sup></font> Version $ver
";
exit;
}
print "Content-type: text/html\n\n";
print <<EOF;
<html><link REL="SHORTCUT ICON" href=$imagurl/ybb.ico><title>回收站</title><FRAMESET name=main_frame rows=*,0 frameborder=0>
<FRAME name=yuzi_frame src=recycle.cgi?menu=log_frame><FRAME name=message src=$imagurl/loading.htm>
EOF
exit;
######################### END OF SCRIPT #########################
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -