#!/usr/local/bin/perl
#------------------------------------------------------#
#                 本程序為飛喵喵提供 
#                Yuzi論壇3000 免費版 v3.47             
#                                                      
#                                                      
#                此程式由 飛喵喵 中文化            
#                                                      
#    中文化版本 : v3.47b5                              
#    日期       : 2001.2.11                            
#    中文化作者 : 飛喵喵站長 DC                    
#                                                      
#    飛喵喵 http://meowfly.myweb.hinet.net                  
#                                                      
#------------------------------------------------------#




require "setup.cgi";
######################
## 以下部分不需修改 ##
######################
$cgiurl  ="cjyh.cgi";
$list="$filepath/data/list.cgi";
$perpage  = 30;
##########
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday)= localtime(time+(3600*$time_hour));
$mon=$mon+1;
if($mon <10){$mon="0".$mon;}
if($mday<10){$mday="0".$mday;}
if($hour<10){$hour="0".$hour;}
if($min<10){$min="0".$min;}
if($sec<10){$sec="0".$sec;}
$year=$year+1900;
$topdata=$year.$mon;
$ftime=$year.$mon.$mday.$hour.$min.$sec;
$thistime=$year."-".$mon."-".$mday.".".$hour.":".$min.":".$sec;
 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/<!--(.|\n)*-->//g;
   $value =~ s/\t//g;
   $FORM{$name} = $value;
}
$userpsd = $FORM{'userpsd'};
$adm     = $FORM{'adm'};
$psd     = $FORM{'psd'};
$otitle  = $FORM{'otitle'};
$username= $FORM{'username'};
$menu= $FORM{'menu'};
$title   = $FORM{'title'};
$titleimg= $FORM{'titleimg'};
$selname = $FORM{'selname'};
$mail    = $FORM{'mail'};
$comment = $FORM{'comment'};
$yyin = $FORM{'yyin'};
$type    = $FORM{'type'};
$delmon  = $FORM{'delmon'};
$ltname  = $FORM{'ltname'};
$page  = $FORM{'page'};
$tjbbs  = $FORM{'tjbbs'};
$money  = $FORM{'money'};
$charm  = $FORM{'charm'};
$bbsname1  = $FORM{'bbsname1'};
if(($delmon < 1)||($delmon eq "")){$delmon =6;}
if(($admname ne $adm)||($delpsd ne $psd)){
&send_html;
print <<EOF;
<html>
<head>
<style type="text/css">TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<style>input{font-size:9pt;color:#000080;background-color:#FFFFFF;padding-top:3px}<!--body,table a{text-decoration:none}a:hover{color:red;text-decoration:underline}--></style>
<title>超級用戶管理</title>
<script language="JavaScript">
function chksend(){
var send=false;
if(document.reg.adm.value){
if(document.reg.psd.value){
send=true;
}
}
if (send==false){
alert('站長管理用，請勿進入，謝謝！');
}
return send;
}
</script>
</head>
<body background=$imagurl/bei.gif>

<br>
<h2 align="center">飛喵喵管理</h2>
<div align="center"><center>
<form name="reg" action="$cgiurl" onsubmit="return chksend();">
  <table border="1" width="400">
    <tr>
      <td width="40%" align=center>飛喵喵區長名字：</td>
      <td width="60%"><input name="adm" type="text" size="30" maxlength="10"></td>
    </tr>
   <tr>
      <td width="40%" align=center>飛喵喵區長密碼：</td>
      <td width="60%"><input name="psd" type="password" size="30" maxlength="12"></td>
    </tr>
    <tr>
      <td><div align="center"><center><p><input type="reset" value="重   填" name="B2"></td>
      <td align="center"><div align="center"><center><p><input type="submit" value="提   交"></td>
    </tr>
  </table>
</form>
</a></center></div>
</body>
</html>
EOF
exit;
}
elsif($menu eq "kills"){&kills;exit;}
elsif($menu eq "listusers"){&listusers;exit;}
elsif($menu eq "chgusers"){&chgusers;exit;}
elsif($menu eq "bf"){&bf;exit;}
elsif($menu eq "hf"){&hf;exit;}
elsif($menu eq "bf1"){&bf1;exit;}
elsif($menu eq "hf1"){&hf1;exit;}
elsif($menu eq "ckyh"){&ckyh;exit;}
elsif($menu eq "ckbz"){&ckbz;exit;}
elsif($menu eq "bbslb"){&bbslb;exit;}
elsif($menu eq "delbbs"){&delbbs;exit;}
elsif($menu eq "jjzz"){&jjzz;exit;}
elsif($menu eq "qlid"){&qlid;exit;}
elsif($menu eq "ssff"){&ssff;exit;}
elsif($menu eq "club"){&club;exit;}
elsif($menu eq "money"){&money;exit;}
elsif($menu eq "clubok"){&clubok;exit;}
elsif($menu eq "bmdel"){&bmdel;exit;}
elsif($menu eq "bmadd"){&bmadd;exit;}
else{
&send_html;
print <<EOF;
<html>
<head>
<style type="text/css">TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<style>input{font-size:9pt;color:#000080;background-color:#FFFFFF;padding-top:3px}<!--body,table a{text-decoration:none}a:hover{color:red;text-decoration:underline}--></style>
<body background=$imagurl/bei.gif>
<title>論壇管理</title>
</head>
<br>
<center><h2>飛喵喵管理</h2></center>
<center>
<br><br><a href="$cgiurl?menu=listusers&adm=$adm&psd=$psd">註冊用戶管理</a>
<br><br><a href="$cgiurl?menu=bbslb&adm=$adm&psd=$psd">註冊論壇管理</a>
<br><br><a href="$cgiurl?menu=club&adm=$adm&psd=$psd">飛喵喵版面設置</a>
<br><br><a href="list.cgi" target=_top>返回飛喵喵首頁</a>
</center>
</body>
</html>
EOF
exit;
}
##########
sub send_html {
  if ($has_send ne "1") {
    print "Content-type: text/html\n\n";
    $has_send = "1";
  }
}
#########
sub listusers{

&send_html;

print <<EOF;
<html>
<head>
<style type="text/css">TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<style>input{font-size:9pt;color:#000080;background-color:#FFFFFF;padding-top:3px}<!--body,table a{text-decoration:none}a:hover{color:red;text-decoration:underline}--></style>
<body background=$imagurl/bei.gif>
<title>註冊用戶管理</title>
</head>
<body background="$imagurl/bei.gif" style="line-height:160%">
<h2 align="center">註冊用戶管理</h2>
<div align=center><center>
<a href=$cgiurl?adm=$adm&psd=$psd>返回管理選單</a><br>

<form action=$cgiurl METHOD="POST">
請鍵入用戶的名稱：<input type=text name="username" size=12>
<input type=hidden name="type" value="one">
 <input type="hidden" name="adm" value="$adm">
<input type="hidden" name="psd" value="$psd">
<input type=hidden name="menu" value="ckyh">
<input type=submit value="確定">
</form>
</center></div>
</body>
</html>
EOF
exit;
}
##########
sub chgusers{
unlink("$filepath/yhzl/$selname.cgi");
unlink("$filepath/guest/1$selname.cgi");
unlink("$filepath/guest/2$selname.cgi");
unlink("$filepath/guest/3$selname.cgi");
unlink("$filepath/guest/4$selname.cgi");
&send_html;
     print <<EOF;
<html><head>
</head>
<style type="text/css">TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<style>input{font-size:9pt;color:#000080;background-color:#FFFFFF;padding-top:3px}<!--body,table a{text-decoration:none}a:hover{color:red;text-decoration:underline}--></style>
<body background=$imagurl/bei.gif>
<center>
<br><br>
<h2>已 經 成 功 刪 除 ！</h2><br><br>
<p align=center><a href=$cgiurl?adm=$adm&psd=$psd>返回管理選單</p></a>
</body></html>
EOF
exit;
}
##########
sub kills{
open (GUEST,"$filepath/data/list.cgi") ;
@lines=<GUEST>;
close(GUEST);
open (GUEST,">$filepath/data/list.cgi") ;
foreach $usersays (@lines) {
$usersays=~ s/\n//g;
if($usersays  ne ""){
($index)=split(/\t/,$usersays);
if($selname ne $index){
print GUEST "$usersays\n";
}
}
}
close(GUEST);
opendir (MEMBERDIR2, "$filepath/list/$selname"); 
@members2 = readdir(MEMBERDIR2);
closedir (MEMBERDIR2);
foreach $m (@members2){
unlink("$filepath/list/$selname/$m");
}
rmdir("$filepath/list/$selname");
unlink("$filepath/list/$selname.cgi");
unlink("$filepath/temp/$selname.stat");
unlink("$filepath/temp/$selname.top");
unlink("$filepath/temp/$selname.tmp");
unlink("$filepath/temp/$selname.good");
unlink("$filepath/temp/$selname.top$topdata");
&send_html;
     print <<EOF;
<html><head>
</head>
<style type="text/css">TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<style>input{font-size:9pt;color:#000080;background-color:#FFFFFF;padding-top:3px}<!--body,table a{text-decoration:none}a:hover{color:red;text-decoration:underline}--></style>
<body background=$imagurl/bei.gif>
<center>
<br><br>
<h2>已 經 成 功 刪 除 此 論 壇 的 所 有 數 據 ！</h2><br><br>
<p align=center><a href=$cgiurl?adm=$adm&psd=$psd>返回管理選單</p></a>
</body></html>
EOF
exit;
}
##########
sub jjzz{
if ( -X "$filepath/yhzl/$selname.cgi"){&errorview("$selname 已經暫時被停止使用權限！");exit;}
open(TITLES,"$filepath/data/prison");
@hastitles=<TITLES>;
close(TITLES);
$size=@hastitles;
open(TITLES,">$filepath/data/prison");
print TITLES $selname."\t".$thistime."\t".$yyin."\t1\n";
for($i=0;$i<=23;$i++){
$m=@hastitles[$i];
print TITLES "$m";
}
close(TITLES);
open(TMP,">$filepath/temp/$selname.cgi");
close(TMP);
&send_html;
     print <<EOF;
<html><head>
</head>
<style type="text/css">TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<style>input{font-size:9pt;color:#000080;background-color:#FFFFFF;padding-top:3px}<!--body,table a{text-decoration:none}a:hover{color:red;text-decoration:underline}--></style>
<body background=$imagurl/bei.gif>
<center>
<br><br>
<h2>您已經成功地將 $selname 停權了！</h2><br><br>
<p align=center><a href=$cgiurl?adm=$adm&psd=$psd>返回管理選單</p></a>
</body></html>
EOF
exit;
}
sub ssff{
open(TITLES,"$filepath/data/prison");
@hastitles=<TITLES>;
close(TITLES);
open(TITLES,">$filepath/data/prison");
foreach $m (@hastitles){
$m=~ s/\n//g;
if($m ne ""){
($rthistime)=split(/\t/,$m);
if($rthistime ne $selname){
print TITLES $m."\n";
}}}
close(TITLES);
unlink("$filepath/temp/$selname.cgi");
&send_html;
     print <<EOF;
<html><head>
</head>
<style type="text/css">TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<style>input{font-size:9pt;color:#000080;background-color:#FFFFFF;padding-top:3px}<!--body,table a{text-decoration:none}a:hover{color:red;text-decoration:underline}--></style>
<body background=$imagurl/bei.gif>
<center>
<br><br>
<h2>您已經成功地將 $selname 從監獄里釋放出來了！</h2><br><br>
<p align=center><a href=$cgiurl?adm=$adm&psd=$psd>返回管理選單</p></a>
</body></html>
EOF
exit;
}
##########
sub ckyh{
if ( -e "$filepath/yhzl/$username.cgi"){
open(PSD,"$filepath/yhzl/$username.cgi");
@lines=<PSD>;
close(PSD);
foreach $line (@lines) {
$line=~ s/\n//g;
($rdpassword,$username1,$mail1,$home1,$lasttime1,$qm1,$sex1,$work1,$city1,$love1,$rdfy,$rdhf,$tu,$jiao,$iewin,$oicq,$photo)=split(/\t/,$line);
$fy1=$rdfy+0;
$hf1=$rdhf+0;
$tol=$fy1+$hf1;
open(NUMBER,"$filepath/guest/2$username.cgi");
$NUMBER=<NUMBER>;
close(NUMBER);
($lys,$oldlys,$money,$charm)=split(/\t/,$NUMBER);
if($sex1 eq ""){$sex1="(不告訴您)"};
if($city1 eq ""){$city1="(不告訴您)"};
if($love1 eq ""){$love1="(不告訴您)"};
if($work1 eq ""){$work1="(不告訴您)"};
if(($home1 eq "http://")||($home1 eq "")){$home1="(不告訴您)"};
if($mail1 eq ""){$mail1="(不告訴您)"};
if($jiao eq ""){$jiao="這隻喵很懶,什麼都沒有留下。"};
if($tol <  11){$deji="新手上路";}
elsif ($tol >  10 && $tol <  31){$deji="一般站友";}
elsif ($tol >  30 && $tol <  101){$deji="中級站友";}
elsif ($tol >  100 && $tol <  201){$deji="高級站友";}
elsif ($tol >  200 && $tol <  501){$deji="老 站 友";}
elsif ($tol >  500 && $tol <  1001){$deji="長 老 級";}
elsif ($tol >  1000 && $tol <  2001){$deji="本站元老";}
elsif ($tol >  2000){$deji="開國大老";}$fy1=$rdfy+0;
$hf1=$rdhf+0;
$tol=$fy1+$hf1;
if (-e "$ImgDir/img/$username.jpg") {$ttt="$ImgurlDir/$photo.jpg"}else{$ttt="$imagurl/photo.gif"}
}
&send_html;
print <<EOF;
<HEAD>
<TITLE>查 看 $username 的 資 料 ！</TITLE>
</HEAD>
<style type=text/css>TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}
.bt {
BORDER-RIGHT: 1px; BORDER-TOP: 1px; FONT-SIZE: 9pt; BORDER-LEFT: 1px; BORDER-BOTTOM: 1px; FONT-FAMILY: 新細明體, 宋體, Arial
}
</style>
<body background=$imagurl/bei.gif>
<SCRIPT language=JavaScript1.2>
function del_reset(){
	if (confirm("你確定要刪除該用戶的資料嗎?")){
		return true;
	}
	return false;
}
function jjzz_reset(){
	if (confirm("你確定要將此用戶停權嗎嗎?")){
		return true;
	}
	return false;
}
</SCRIPT>
<p class=pt10 align=center><b>用 戶 $username 的 資 料 ！</b><br><br>
<table border="0" width="100%">
  <tr>
    <td width="100%" colspan="2" align="center"><form action=$cgiurl METHOD=POST><input type=hidden name=selname value=$username><input type=hidden name=adm value=$adm><input type=hidden name=psd value=$psd><input type=hidden name=menu value=chgusers><input type=submit onclick="return del_reset()" value=刪除此用戶的所有資料></form>
    </td>
  </tr>
  <tr>
    <td align="right">
<form action=$cgiurl METHOD=POST><input type=hidden name=selname value=$username><input type=hidden name=adm value=$adm><input type=hidden name=psd value=$psd><input type=hidden name=menu value=jjzz>入獄原因：<input size="25" name="yyin"> <input type=submit onclick="return jjzz_reset()" value="將 $username 停權"></form> 
    </td>
    <td>
<form action=$cgiurl METHOD=POST><input type=hidden name=selname value=$username><input type=hidden name=adm value=$adm><input type=hidden name=psd value=$psd><input type=hidden name=menu value=ssff><input type=submit  value="從監獄里釋放出來"></form>
    </td>
  </tr>
</table>

<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=80%>
<TBODY>
<TR>
<TD height=58>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=100%>
<TBODY>
<TR>
<TD vAlign=bottom width=2%><IMG height=32
src=$imagurl/image$tu.gif width=32></TD>
<TD vAlign=bottom width=98%>　　 　　　　　
<TABLE border=0 cellPadding=0 cellSpacing=0 width=97%>
<TBODY>
<TR>
<TD bgColor=#F8E8CB width=37%>　秘密檔案請勿外傳
：）</TD>
<TD align=left vAlign=bottom
width=6%><FONT color=#ff0033><IMG src=$imagurl/jiao.gif></FONT></TD>
<TD align=right width=57%><a href=guest.cgi?action=add_form&guest=$username>給 $username 發送一句悄悄話</a></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>  
<TR>
<TD height=36>
<TABLE border=0 cellPadding=0 cellSpacing=1 width=100%>
<TBODY>
<TR bgColor=#eceef2>
<TD>
<TABLE border=1 borderColor=#F8E8CB
cellPadding=0 cellSpacing=0 height=200 width=100% bgcolor=#FEFBF5>
<TBODY>
<TR>
<TD align=middle rowSpan=13 width=2%>&nbsp;</TD>
<TD align=middle width=12%>匿 稱 </TD>  
<TD align=middle width=34%>$username </TD>
<TD align=middle rowSpan=13
width=2%>&nbsp;</TD>
<TD align=middle colSpan=2>密 碼 $rdpassword</TD></TR>
<TR>
<TD align=middle width=12%>性 別</TD> 
<TD align=middle width=34%>$sex1</TD>
<TD align=middle colSpan=2
rowSpan=10><a href=$ttt><img src=$ttt width=200 height=150 border=0></a><br>$jiao</TD></TR>
<TR>
<TD align=middle width=12%>等 級</TD>  
<TD align=middle width=34%>$deji</TD>
</TR>
<tr>
<TD align=middle width=12%>省 份</TD>  
<TD align=middle width=34%>$city1</TD></TR>
<TR>
<TD align=middle width=12%>愛 好</TD>  
<TD align=middle width=34%>$love1</TD></TR>
<TR>
<TD align=middle width=12%>職 業</TD>  
<TD align=middle
width=34%>$work1</TD></TR>
<TR>
<TD align=middle width=12%>貨 幣</TD> 
<TD align=middle
width=34%><form action=$cgiurl METHOD=POST><input type=hidden name=selname value=$username><input type=hidden name=adm value=$adm><input type=hidden name=psd value=$psd><input type=hidden name=menu value=money><INPUT class=bt name=money size=6 maxLength=5 value=$money><INPUT class=bt style="COLOR: #ffffff; BACKGROUND-COLOR: #F8E8C8" type=submit value="確 定"></TD></TR>
<TR>
<TD align=middle width=12%>魅 力</TD> 
<TD align=middle width=34%><INPUT class=bt name=charm size=6 maxLength=5 value=$charm><INPUT class=bt style="COLOR: #ffffff; BACKGROUND-COLOR: #F8E8C8" type=submit value="確 定"></TD></TR>
<TR>
<TD align=middle width=12%>OICQ</TD>
<TD align=middle
width=34%>$oicq</TD></TR>
<TR>
<TD align=middle width=12%>發表文章</TD>
<TD align=middle width=34%>$fy1 篇</TD></TR>  
<TR>
<TD align=middle width=12%>回復文章</TD>
<TD align=middle width=34%>$hf1 篇</TD></TR>  
<TR>
<TD align=middle width=12%>總發表文章</TD>
<TD align=middle width=34%>$tol 篇</TD>  
<TD align=middle width=12%>Email</TD>
<TD align=middle><a href=mailto:$mail1>$mail1</a></TD></TR>
<TR>
<TD align=middle width=12%>註冊日期</TD>
<TD align=middle width=34%>$lasttime1</TD>
<TD align=middle width=12%>個人主頁</TD>
<TD align=middle><a href=$home1 target=_blank>$home1</a></TD></TR>
</TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
</TBODY></TABLE></TD></TR></TBODY></TABLE></form>
<center><p><a href=javascript:window.history.back();><IMG src=$imagurl/back.gif border=0></a></p><br>
<div align=center>
<center>
<table border=0 cellPadding=0 cellSpacing=0 width=60%>
<tbody>
<tr>
<td align=middle width=100%>本頁面使用CGI程序更新，程序制作：<a href=http://meowfly.myweb.hinet.net target=_blank>飛喵喵</a><br>中文化 :<a href="http://meowfly.myweb.hinet.net" target="_blank"><font color=ff0000>飛喵喵</a></font></td>
</tr>
</tbody>
</table>
</center>
</div>
</HTML>
EOF
exit;
}else{
&errorview("對不起，此用戶沒有註冊！");exit;
}
}
##########
sub ckbz{
if ($FORM{'bzname'} ne ""){
if ( -e "$filepath/yhzl/$FORM{'bzname'}.cgi"){}else{&errorview("對不起，你輸入的這個新版主的用戶名還沒有註冊！");exit;}
open(PSD,"$filepath/list/$username.cgi");
@lines=<PSD>;
close(PSD);
foreach $line (@lines) {
$line=~ s/\n//g;
($rname,$rpass,$rmail,$rhome,$rtitle,$yhq,$rtime,$htmlt,$htmlw,$jj,$fbanz)=split(/\t/,$line);
}
open(PSD,">$filepath/list/$username.cgi");
print PSD $FORM{'bzname'}."\t\t".$rmail."\t".$rhome."\t".$rtitle."\t".$yhq."\t".$rtime."\t".$htmlt."\t".$htmlw."\t".$jj."\t".$fbanz;
close(PSD);
}
if ( -e "$filepath/list/$username.cgi"){
open(PSD,"$filepath/list/$username.cgi");
@lines=<PSD>;
close(PSD);
foreach $line (@lines) {
$line=~ s/\n//g;
      ($rname,$rpass,$rmail,$rhome,$rtitle,$yhq,$rtime,$htmlt,$htmlw)=split(/\t/,$line);
}
open(PSD88,"$filepath/yhzl/$rname.cgi");
@lines88=<PSD88>;
close(PSD88);
foreach $line88 (@lines88) {
$line88=~ s/\n//g;
      ($mmymm)=split(/\t/,$line88);
}
$oldmon=$mon-2;
if($oldmon < 1){$year=$year-1;$oldmon=$oldmon+12}
if($oldmon <10){$oldmon="0".$oldmon;}
&send_html;
print <<EOF;

$top
<SCRIPT language=JavaScript1.2>
function del_reset(){
	if (confirm("您確定要刪除該論壇的全部數據嗎?")){
		return true;
	}
	return false;
}
function mon_reset(){
	if (confirm("您確定要該刪除該論壇以前的文章嗎?")){
		return true;
	}
	return false;
}
</SCRIPT>
<HEAD>
<TITLE>查 看 $rtitle 的 資 料 ！</TITLE>
</HEAD>
<style type=text/css>TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<body background=$imagurl/bei.gif>
<br>
<p class=pt10 align=center><b>查 看 $rtitle 的 資 料 ！</b><form action=$cgiurl METHOD=POST><input type=hidden name=selname value=$username><input type=hidden name=adm value=$adm><input type=hidden name=psd value=$psd><input type=hidden name=menu value=kills><input type=submit onclick="return del_reset()"  value=刪除$rtitle的全部數據></form>
<p class=pt10 align=center>
<form action=$cgiurl METHOD=POST><input type=hidden name=selname value=$username><input type=hidden name=adm value=$adm><input type=hidden name=psd value=$psd><input type=hidden name=menu value=qlid>
<select name=mon>
<option value=1>刪除 1 個月以前的文章</option>
<option value=2>刪除 2 個月以前的文章</option>
<option value=3>刪除 3 個月以前的文章</option>
<option value=6>刪除 6 個月以前的文章</option>
<option value=9>刪除 9 個月以前的文章</option>
<option value=12>刪除 12 個月以前的文章</option>
</select>
<input type=submit onclick="return mon_reset()" value='確定'>
</form>
<table cellspacing=4 cellpadding=3><tr><td class=pt9 bgcolor=#FFF5E1><b>論壇名稱：</b><td class=pt9 align=left bgcolor=#FFF5E1><font color=#FF0000>$rtitle</font></tr>
<tr><td class=pt9 bgcolor=#FFF5E1><b>現任版主：</b><td class=pt9 align=left bgcolor=#FFF5E1>

<form action=$cgiurl METHOD="POST">
<input type="hidden" name="username" value="$username">
<input type="hidden" name="adm" value="$adm">
<input type="hidden" name="psd" value="$psd">
<input name="menu" type="hidden" value="ckbz">
<INPUT name=bzname size=8 value=$rname> <input type=submit value='更改'></tr>
</form>
<tr><td class=pt9 bgcolor=#FFF5E1><b>密碼：</b><td class=pt9 align=left bgcolor=#FFF5E1><font color=#FF0000>$mmymm</font></tr>
<tr><td class=pt9 bgcolor=#FFF5E1><b>信箱：</b><td class=pt9 align=left bgcolor=#FFF5E1><font color=#FF0000><a href=mailto:$rmail>$rmail</a></font></tr>
<tr><td class=pt9 bgcolor=#FFF5E1><b>個人主頁：</b><td class=pt9 align=left bgcolor=#FFF5E1><font color=#FF0000><a href=$rhome target=_blank>$rhome</a></font>
<tr><td class=pt9 bgcolor=#FFF5E1><b>申請時間：</b><td class=pt9 align=left bgcolor=#FFF5E1><font color=#FF0000>$rtime.</font></table>
<br>
<div align=center><center><table border=1 borderColorDark=#ffffff borderColorLight=#008000 cellPadding=0 cellSpacing=0 width=60%><tbody><tr><td align=middle width=100%>本頁面使用CGI程序更新，程序制作：<a href=http://meowfly.myweb.hinet.net target=_blank>飛喵喵</a><br>中文化 :<a href=http://meowfly.myweb.hinet.net target=_blank><font color=ff0000>飛喵喵</a></font></td></tr></tbody></table></div>
<br>[ <a href=javascript:history.back()> 返 回 </a> ]
EOF
   exit;
}else{
&errorview("對不起，此ID沒有註冊！");exit;
}
}
#########
sub bbslb{
&send_html;
print <<EOF;
<html>
<head>
<style type="text/css">TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<style>input{font-size:9pt;color:#000080;background-color:#FFFFFF;padding-top:3px}<!--body,table a{text-decoration:none}a:hover{color:red;text-decoration:underline}--></style>
<body background=$imagurl/bei.gif>
<title>註冊論壇管理</title>
</head>
<body background="$imagurl/bei.gif">
</body>
<h2 align="center">註冊論壇管理</h2>
<div align=center><center>
<a href=$cgiurl?adm=$adm&psd=$psd>返回管理選單</a><br>
<form name="reg" action="$cgiurl">
請輸入論壇的ID：<input type=text name="username" size=12>
<input type="hidden" name="adm" value="$adm">
<input type="hidden" name="psd" value="$psd">
<input name="menu" type="hidden" value="ckbz">
<input type=submit value="確定">
</form>
</center></div>
EOF
open(ROOM,"$list");
@lines=<ROOM>;
close(ROOM);
$size=@lines;
&send_html;
$ii=0;
$j=$size;
while ($j>0) {
$j=$j-$perpage;
$ii++;
}
print <<EOF;

EOF
foreach $line (@lines){
$line=~ s/\n//g;
$jms ="data/list.cgi";
open(TMP,"$jms");
@line=<TMP>;
close(TMP);
}
open(TITLES,"$filepath/list/bbs");
@hastitles=<TITLES>;
close(TITLES);
$bbsdx=@hastitles;
print <<EOF;
<br>
<div align="center"><center>
<table border="1" width="80%" bordercolorlight="#008000" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF">
</tr>
<tr>
<td background=$imagurl/tablebg.gif width="70%" align="center"><font color=ffffff>討論區</font></td>
<td background=$imagurl/tablebg.gif width="10%" align="center"><font color=ffffff>論題數</font></td>
<td background=$imagurl/tablebg.gif width="15%" align="center"><font color=ffffff>版主</font></td>
<td background=$imagurl/tablebg.gif width="5%" align="center"><font color=ffffff>資料</font></td>
</tr>
EOF
$chgcolor==0;
if($page eq ""){$page=$ii;}
$pages=$page-1;
$pages=$page*$perpage-$perpage;
for($i=$pages; $i<$pages+$perpage; $i++) {
$line=@lines[$i];
$line=~ s/\n//g;
if($line ne ""){
($username1)=split(/\t/,$line);
unless(-f "$filepath/list/$username1.cgi"){
open(TMP,">$filepath/list/$username1.cgi");
close(TMP);
chmod(0666,"$filepath/list/$username1.cgi");
}
open(TITLES,"$filepath/list/$username1.cgi");
@a=<TITLES>;
close(TITLES);
foreach $m (@a){
$m=~ s/\n//g;
if($m ne ""){
($rname,$rpass,$rmail,$rhome,$rtitle,$yhq,$rtime,$htmlt,$htmlw,$jj)=split(/\t/,$m);
}
unless(-f "$filepath/list/$username1/bbs"){
open(TMP,">$filepath/list/$username1/bbs");
close(TMP);
chmod(0666,$filepath/list/$username1/bbs);
}
$bbsbook  ="$filepath/list/$username1/bbs";
open(TITLES,"$bbsbook");
@hastitles=<TITLES>;
close(TITLES);
$hastitle=@hastitles;
$wzs=$hastitle;
$rqzs=$hastitle*3;
if($chgcolor==0){
$chgcolor=0;
print <<EOF;
<tr>
<td>　<a href=bbs.cgi?id=$username1 target=_blank>$rtitle</a><br>$jj</td>
<td align="center"><font color=#FF0000>$wzs</font></td>
<td align="center"><a href="mailto:$rmail">$rname</a></td>
<td>
<form action=$cgiurl METHOD="POST">
<input type="hidden" name="username" value="$username1">
<input type="hidden" name="adm" value="$adm">
<input type="hidden" name="psd" value="$psd">
<input name="menu" type="hidden" value="ckbz">
<input type=submit value="查看">
</td></form>
</tr>
EOF
}
}
}
}
print <<EOF;
<tr>
<td align="center" width="100%" colspan="5" bgcolor="#FFF5E1">免費論壇服務由<font color=#cc0033>
</font><font color=#ff6633><b><font Helvetica, sans-serif><a href=$zyurl>$zyname</a></font></b></font><font color=#cc0033>
</font>提供：<b><a href="http://meowfly.myweb.hinet.net" target="_blank">飛喵喵</a><br>中文化 :<a href="http://meowfly.myweb.hinet.net" target="_blank"><font color=ff0000>飛喵喵</a></font></td></tr>
<tr>
<td colspan="5">
EOF
#$i=1;
$j=$size;
while ($j>0) {
print "<a href=$cgiurl?menu=bbslb&adm=$adm&psd=$psd&page=$ii>" if ($page != $ii);
print "[$ii]";
print "</a>" if ($page != $ii);
$j=$j-$perpage;
$ii--;
}
print <<EOF;
</td>
</tr>
</table>
</center></div>
</body>
</html>
EOF
exit;
}
##########
sub qlid{
$oldmon=$mon-$FORM{'mon'};
if($oldmon <1){$year=$year-1;$oldmon=$oldmon+12}
if($oldmon <10){$oldmon="0".$oldmon;}
open (GUEST2,"$filepath/list/$selname/bbs") ;
@lines2=<GUEST2>;
close(GUEST2);
open (GUEST2,">$filepath/list/$selname/bbs") ;
foreach $usersays2 (@lines2) {
$usersays2=~ s/\n//g;
($rd_time2)=split(/\t/,$usersays2);
if($rd_time2 > "$year$oldmon"."00000000"){
print GUEST2 "$usersays2\n";
}else{
unlink("$filepath/list/$selname/$usersays2");
unlink("$filepath/list/$selname/$usersays2"."b");
$delno++;
}
}
close(GUEST);
if($delno eq ""){$delno=0};
&send_html;
     print <<EOF;
<html><head>
</head>
<style type="text/css">TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<style>input{font-size:9pt;color:#000080;background-color:#FFFFFF;padding-top:3px}<!--body,table a{text-decoration:none}a:hover{color:red;text-decoration:underline}--></style>
<body background=$imagurl/bei.gif>
<center>
<br><br>
<h2>已經成功將 $year 年 $oldmon 份以前的文章刪除了！</h2>（共刪除 <font color=#FF0000><b>$delno</b></font> 篇文章）<br>
<p align=center><a href=$cgiurl?adm=$adm&psd=$psd>返回管理選單</p></a>
</body></html>
EOF
exit;
}
###############
sub club{
&send_html;
print <<EOF;
<html>
<head>
<style type="text/css">TD{FONT-SIZE:9pt}A{FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{FONT-SIZE:9pt;TEXT-DECORATION:underline}</style>
<style>input{font-size:9pt;color:#000080;background-color:#FFFFFF;padding-top:3px}<!--body,table a{text-decoration:none}a:hover{color:red;text-decoration:underline}--></style>
<body background=$imagurl/bei.gif>
<title>飛喵喵版面設置</title>
</head>
<body background="$imagurl/bei.gif">
</body>
<h2 align="center">飛喵喵版面設置</h2>
<center><a href=$cgiurl?adm=$adm&psd=$psd>返回管理選單</a><br>
EOF
open(ROOM,"$list");
@lines=<ROOM>;
close(ROOM);
$size=@lines;
&send_html;
$ii=0;
$j=$size;
while ($j>0) {
$j=$j-$perpage;
$ii++;
}
print <<EOF;

EOF
foreach $line (@lines){
$line=~ s/\n//g;
$jms ="data/list.cgi";
open(TMP,"$jms");
@line=<TMP>;
close(TMP);
}
open(TITLES,"$filepath/list/bbs");
@hastitles=<TITLES>;
close(TITLES);
$bbsdx=@hastitles;
print <<EOF;
<br>
<div align="center"><center>
<form action=$cgiurl METHOD="POST">
<input type="hidden" name="adm" value="$adm">
<input type="hidden" name="psd" value="$psd">
<input name="menu" type="hidden" value="bmadd">
<span style="font-size: 9pt">添加論壇到飛喵喵版面，請輸入論壇的ID <input type="text" name=username size=5> <input type="submit" value=添加></form>
</form>
<table border="1" width="80%" bordercolorlight="#008000" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF">
</tr>
<tr>
<td background=$imagurl/tablebg.gif width="70%" align="center"><font color=ffffff>討論區</font></td>
<td background=$imagurl/tablebg.gif width="10%" align="center"><font color=ffffff>論題數</font></td>
<td background=$imagurl/tablebg.gif width="15%" align="center"><font color=ffffff>版主</font></td>
<td background=$imagurl/tablebg.gif width="5%" align="center"><font color=ffffff>請求</font></td>
</tr>
EOF
$chgcolor==0;
if($page eq ""){$page=$ii;}
$pages=$page-1;
$pages=$page*$perpage-$perpage;
for($i=$pages; $i<$pages+$perpage; $i++) {
$line=@lines[$i];
$line=~ s/\n//g;
if($line ne ""){
($username1)=split(/\t/,$line);
open(TITLES,"$filepath/list/$username1.cgi");
@a=<TITLES>;
close(TITLES);
foreach $m (@a){
$m=~ s/\n//g;
if($m ne ""){
($rname,$rpass,$rmail,$rhome,$rtitle,$yhq,$rtime,$htmlt,$htmlw,$jj)=split(/\t/,$m);
}
unless(-f "$filepath/list/$username1/bbs"){
open(TMP,">$filepath/list/$username1/bbs");
close(TMP);
chmod(0666,$filepath/list/$username1/bbs);
}
$bbsbook  ="$filepath/list/$username1/bbs";
open(TITLES,"$bbsbook");
@hastitles=<TITLES>;
close(TITLES);
$hastitle=@hastitles;
$wzs=$hastitle;
$rqzs=$hastitle*3;
if($chgcolor==0){
$chgcolor=0;
print <<EOF;
<tr>
<td>　<a href=bbs.cgi?id=$username1 target=_blank>$rtitle</a><br>$jj</td>
<td align="center"><font color=#FF0000>$wzs</font></td>
<td align="center"><a href="mailto:$rmail">$rname</a></td>
<td>
<table border="0" width="100%">
  <tr>
    <td width="100%">
<form action=$cgiurl METHOD="POST">
<input type="hidden" name="username" value="$username1">
<input type="hidden" name="adm" value="$adm">
<input type="hidden" name="psd" value="$psd">
<input name="menu" type="hidden" value="clubok">
<input type=submit value="拉前">
    </td></form>
  </tr>
  <tr>
    <td width="100%">
<form action=$cgiurl METHOD="POST">
<input type="hidden" name="username" value="$username1">
<input type="hidden" name="adm" value="$adm">
<input type="hidden" name="psd" value="$psd">
<input name="menu" type="hidden" value="bmdel">
<input type=submit value="刪除">
    </td></form>
  </tr>
</table>
</td>
</tr>
EOF
}
}
}
}
print <<EOF;
<tr>
<td align="center" width="100%" colspan="5" bgcolor="#FFF5E1">免費論壇服務由yuzi 設計<font color=#cc0033>
</font><font color=#ff6633><b><font Helvetica, sans-serif><a href=$zyurl>$zyname</a></font></b></font><font color=#cc0033>
</font>飛喵喵空服網提供修正 :<a href="http://skyhi.hypermart.net" target="_blank"><font color=ff0000>飛喵喵空服網</a></font></td></tr>
<tr>
<td colspan="5">
EOF
#$i=1;
$j=$size;
while ($j>0) {
print "<a href=$cgiurl?menu=bbslb&adm=$adm&psd=$psd&page=$ii>" if ($page != $ii);
print "[$ii]";
print "</a>" if ($page != $ii);
$j=$j-$perpage;
$ii--;
}
print <<EOF;
</td>
</tr>
</table>
</center></div>
</body>
</html>
EOF
exit;
}

sub clubok{
open (GUEST,"$filepath/data/list.cgi") ;
@lines=<GUEST>;
close(GUEST);
open (GUEST,">$filepath/data/list.cgi") ;
print GUEST "$username\n";
foreach $usersays (@lines) {
$usersays=~ s/\n//g;
($rd_time)=split(/\t/,$usersays);
if($username ne $rd_time){
print GUEST "$usersays\n";
}
}
close(GUEST);
print "Content-type: text/html\n\n";
print <<EOF;
<html><META HTTP-EQUIV=Refresh CONTENT="0;url=$cgiurl?menu=club&adm=$adm&psd=$psd"></html>
EOF
exit;
}
sub money{
open (GUEST,"$filepath/guest/2$selname.cgi") ;
$line=<GUEST>;
close(GUEST);
($lys,$oldlys)=split(/\t/,$line);
open (GUEST,">$filepath/guest/2$selname.cgi") ;
print GUEST "$lys"."\t"."$lys"."\t"."$money"."\t"."$charm";
close(GUEST);
print "Content-type: text/html\n\n";
print <<EOF;
<html><META HTTP-EQUIV=Refresh CONTENT="0;url=$cgiurl?menu=ckyh&adm=$adm&psd=$psd&username=$selname"></html>
EOF
exit;
}


sub bmdel{
open (GUEST,"$filepath/data/list.cgi") ;
@lines=<GUEST>;
close(GUEST);
open (GUEST,">$filepath/data/list.cgi") ;
foreach $usersays (@lines) {
$usersays=~ s/\n//g;
($rd_time)=split(/\t/,$usersays);
if($username ne $rd_time){
print GUEST "$usersays\n";
}
}
close(GUEST);
print "Location: $cgiurl?menu=club&adm=$adm&psd=$psd\n\n";
exit;
}
sub bmadd{
unless ( -e "$filepath/list/$username.cgi"){&errorview("對不起，您輸入的論壇ID錯誤，此ID不存在！");exit;}
open (GUEST,">>$filepath/data/list.cgi") ;
print GUEST "$username\n";
close(GUEST);
print "Location: $cgiurl?menu=club&adm=$adm&psd=$psd\n\n";
exit;
}
######################### END OF SCRIPT #########################
