?? temp.cgi
字號:
$ver="4.132";
($sec,$min,$hour,$mday,$mon,$year)= 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;
$thistime=$year."-".$mon."-".$mday.".".$hour.":".$min.":".$sec;
$lasttime=$year."-".$mon."-".$mday;
$ftime="$year$mon$mday$hour$min$sec";
if($ENV{'HTTP_X_FORWARDED_FOR'}){$from="$ENV{'HTTP_X_FORWARDED_FOR'}";}else{$from=$ENV{'REMOTE_ADDR'};}
$ImgurlDir="$imagurl/img";
sub GetCookies {
foreach(split(/; /,$ENV{'HTTP_COOKIE'})){($cookie,$value)=split(/=/);$Cookies{$cookie}=$value;}
if($ftime-$Cookies{nowtime} < 3){print "Set-Cookie:nowtime=$ftime\n";print "Content-type: text/html\n\n<SCRIPT>document.cookie=\"nowtime=\"+\"1\";</SCRIPT><meta HTTP-EQUIV=REFRESH CONTENT=0>Loading...";exit;}
print "Set-Cookie:nowtime=$ftime\n";
if($Cookies{bgcolor}){($color,$bgcolor4,$bgcolor0,$bgcolor,$bgcolor1,$bgcolor2,$bgcolor3)=split(/_/,$Cookies{bgcolor});}
}
sub origin {
if($ENV{'HTTP_REFERER'} eq ""){&errorview("來源錯誤!");}
$origin=$ENV{'HTTP_REFERER'};
$origin=~s/\http:\/\///isg;
($origin)=split(/\//,$origin);
if($origin ne $urlorigin && $origin ne $ENV{'HTTP_HOST'}){&errorview("來源錯誤<br>請到社區管理-->社區變量設置-->把主機的域名設置成<br>$origin");}
}
sub win{
print "Content-type: text/html\n\n";
print <<EOF;
<html>
<head>
<meta http-equiv=Content-Type content=text/html;charset=gb2312>
<meta http-equiv=refresh content=2;url=$cgiurl?menu=listtitle&id=$id>
</head>
<table cellpadding=0 cellspacing=0 border=0 width=95% align=center height=85%>
<tr align=center valign=middle>
<td>
<table cellpadding=10 cellspacing=0 border=0 width=80% align=center>
<tr>
<td valign=middle align=center bgcolor=$bgcolor2>謝謝$username,您的信息已成功發出!<br><br>請等待系統將自動返回...
<br><br>
(<a href=$cgiurl?menu=listtitle&id=$id>如果您不愿意等待,請點擊這里返回</a>)
</td></tr></table></td></tr>
</table>
</html>
EOF
if($userpsd ne ""){&cookie;}
exit;
}
sub cookie{
if($FORM{'xuansave'} eq "1"){$savechecked=1;$savetime="expires=\"+expireDate.toGMTString()+\";";}
print <<EOF;
<SCRIPT>
expireDate=new Date;
expireDate.setYear(expireDate.getYear()+1);
document.cookie="username="+"$username"+";$savetime";
document.cookie="password="+"$userpsd"+";$savetime";
document.cookie="xuansave="+"$savechecked"+";$savetime";
</SCRIPT>
EOF
}
sub ybbcode {
my $ThePost = shift;
$ThePost=~s/(\[URL\])(http|https|ftp):\/\/([^;`'"]+?)(\[\/URL\])/<A HREF=$2:\/\/$3 TARGET=_blank>$3<\/A>/isg;
$ThePost=~s/(\[URL=)(http|https|ftp):\/\/([^;`'"]+?)(])(\[IMG\]http:\/\/)([^;`'"=]+?)(\[\/IMG\])(\[\/URL\])/<A HREF=$2:\/\/$3 TARGET=_blank><IMG border=0 SRC=http:\/\/$6 onload=\"javascript:if(this.width>screen.width-366)this.width=screen.width-366\"><\/A>/isg;
$ThePost=~s/(\[URL=)(http|https|ftp):\/\/([^;`'"]+?)(])(.+?)(\[\/URL\])/<A HREF=$2:\/\/$3 TARGET=_blank>$5<\/A>/isg;
$ThePost=~s/(\[EMAIL\])(\S+\@\S+?)(\[\/EMAIL\])/<A HREF=mailto:$2>$2<\/A>/isg;
$ThePost=~s/(\[IMG\]http:\/\/)([^;'"=]+?)(\[\/IMG\])/<A HREF=http:\/\/$2 TARGET=_blank><IMG border=0 title=新窗口瀏覽 SRC=http:\/\/$2 onload=\"javascript:if(this.width>screen.width-366)this.width=screen.width-366\"><\/A>/isg;
$ThePost =~ s/(\[sound\])\s*(http|https|ftp):\/\/(\S+?)\.(wav|midi|mid)\s*(\[\/sound\])/<img src=$imagurl\/mid.gif><bgsound src=$2:\/\/$3\.$4>/isg;
$ThePost=~s/\[font=([^.:;`'"=]+?)\]\s*(.*?)\s*\[\/font\]/<font face=$1>$2<\/font>/isg;
$ThePost=~s/\[color=([^.:;`'"=]+?)\]/<font color=$1>/isg;
$ThePost=~s/\[\/color\]/<\/font>/isg;
$ThePost=~s/\[size=([^.:;`'"=]+?)\]/<font size=$1>/isg;
$ThePost=~s/\[\/size\]/<\/font>/isg;
$ThePost=~s/(\[QUOTE\])(.+?)(\[\/QUOTE\])/<BLOCKQUOTE><table cellpadding=0 cellspacing=0 WIDTH=90% bgcolor=#000000 align=center><tr><td><table width=100% cellpadding=5 cellspacing=1><TR><TD BGCOLOR=ffffff>$2<\/td><\/tr><\/table><\/td><\/tr><\/table><\/BLOCKQUOTE>/isg;
$ThePost=~s,(\[code\])(.+?)(\[/code\]),<BLOCKQUOTE>code:<table cellpadding=0 cellspacing=0 WIDTH=90% bgcolor=#000000 align=center><tr><td><table width=100% cellpadding=5 cellspacing=1><TR><TD BGCOLOR=ffffff>$2<\/td><\/tr><\/table><\/td><\/tr><\/table><\/BLOCKQUOTE>,isg;
$ThePost=~s/(\[i\])(.+?)(\[\/i\])/<i>$2<\/i>/isg;
$ThePost=~s/(\[b\])(.+?)(\[\/b\])/<b>$2<\/b>/isg;
$ThePost=~s/(\[u\])(.+?)(\[\/u\])/<u>$2<\/u>/isg;
$ThePost=~s/(\[strike\])(.+?)(\[\/strike\])/<strike>$2<\/strike>/isg;
$ThePost=~s/(\[center\])(.+?)(\[\/center\])/<center>$2<\/center>/isg;
$ThePost=~s/(\[marquee\])(.+?)(\[\/marquee\])/<marquee>$2<\/marquee>/isg;
if($FORM{'html'} eq 1){$ThePost =~s/\<br>//isg;$ThePost ="<SCRIPT>function runEx(){var winEx = window.open('', '', 'resizable,scrollbars'); winEx.document.open('text\/html', 'replace');winEx.document.write(unescape(event.srcElement.parentElement.children[2].value));}<\/SCRIPT>HTML代碼如下:<BR><TEXTAREA style=WIDTH:100% name=textfield rows=10>$ThePost<\/TEXTAREA><INPUT onclick=runEx() type=button value=運行此代碼>";}
return ($ThePost);
}
sub unybbcode {
my $ThePost = shift;
$ThePost=~s/(<A HREF=)(http|https|ftp)(:\/\/)(\S+)( TARGET=_blank>)(.+?)(<\/A>)/\[URL=$2:\/\/$4\]$6\[\/URL\]/isg;
$ThePost=~s/(<A HREF=)(http|https|ftp)(:\/\/)(\S+)( TARGET=_blank>)<IMG border=0 SRC=http:\/\/([^;'"=]+?) onload=\"javascript:if\(this.width\>screen.width-366\)this.width=screen.width-366\">(<\/A>)/\[URL=$2:\/\/$4\]\[IMG\]http:\/\/$6\[\/IMG\]\[\/URL\]/isg;
$ThePost=~s/(<A HREF=mailto:)(\S+)(>)(\S+)(<\/A>)/\[EMAIL\]$2\[\/EMAIL\]/isg;
$ThePost=~s/(<i>)(.+?)(<\/i>)/\[i\]$2\[\/i\]/isg;
$ThePost=~s/(<b>)(.+?)(<\/b>)/\[b\]$2\[\/b\]/isg;
$ThePost=~s/(<u>)(.+?)(<\/u>)/\[b\]$2\[\/u\]/isg;
$ThePost=~s/(<strike>)(.+?)(<\/strike>)/\[strike\]$2\[\/strike\]/isg;
$ThePost=~s/<BLOCKQUOTE><table cellpadding=0 cellspacing=0 WIDTH=90% bgcolor=#000000 align=center><tr><td><table width=100% cellpadding=5 cellspacing=1><TR><TD BGCOLOR=ffffff>(.+?)<\/td><\/tr><\/table><\/td><\/tr><\/table><\/BLOCKQUOTE>/\[QUOTE\]$1\[\/QUOTE\]/isg;
$ThePost=~s,<BLOCKQUOTE>code:<table cellpadding=0 cellspacing=0 WIDTH=90% bgcolor=#000000 align=center><tr><td><table width=100% cellpadding=5 cellspacing=1><TR><TD BGCOLOR=ffffff>(.+?)<\/td><\/tr><\/table><\/td><\/tr><\/table><\/BLOCKQUOTE>,\[code\]$1\[/code\],isg;
$ThePost=~s/<IMG border=0 title=新窗口瀏覽 SRC=http:\/\/([^;'"=]+?) onload=\"javascript:if\(this.width\>screen.width-366\)this.width=screen.width-366\">/\[IMG\]http:\/\/$1\[\/IMG\]/isg;
$ThePost=~s/<IMG border=0 SRC=http:\/\/([^;'"=]+?) onload=\"javascript:if\(this.width\>screen.width-366\)this.width=screen.width-366\">/\[IMG\]http:\/\/$1\[\/IMG\]/isg;
$ThePost=~s/<IMG border=0 SRC=http:\/\/([^;'"=]+?)>/\[IMG\]http:\/\/$1\[\/IMG\]/isg;
$ThePost=~s/(<center>)(.+?)(<\/center>)/\[CENTER\]$2\[\/CENTER\]/isg;
$ThePost=~s/(<MARQUEE>)(.+?)(<\/MARQUEE>)/\[MARQUEE\]$2\[\/MARQUEE\]/isg;
$ThePost=~s/(<font color=)(.+?)(>)(.+?)(<\/font>)/\[COLOR=$2]$4\[\/COLOR\]/isg;
$ThePost=~s/(<font face=)(.+?)(>)(.+?)(<\/font>)/\[FONT=$2]$4\[\/FONT\]/isg;
$ThePost=~s/(<font size=)(.+?)(>)(.+?)(<\/font>)/\[SIZE=$2]$4\[\/SIZE\]/isg;
$ThePost=~s/<img src=$imagurl\/mid.gif><bgsound src=(\S+?)>/\[sound\]$1\[\/sound\]/isg;
return ($ThePost);
}
sub smilies {
my $ThePost = shift;
$ThePost=~s/\:\)/<IMG border=0 SRC=$imagurl\/regular_smile.gif onload='javascript:if\(this.width>screen.width-300\)this.width=screen.width-300'>/isg;
$ThePost=~s/\:d/<IMG border=0 SRC=$imagurl\/teeth_smile.gif onload='javascript:if\(this.width>screen.width-300\)this.width=screen.width-300'>/isg;
$ThePost=~s/\:o/<IMG border=0 SRC=$imagurl\/omg_smile.gif onload='javascript:if\(this.width>screen.width-300\)this.width=screen.width-300'>/isg;
$ThePost=~s/\:p/<IMG border=0 SRC=$imagurl\/tounge_smile.gif onload='javascript:if\(this.width>screen.width-300\)this.width=screen.width-300'>/isg;
$ThePost=~s/\;\)/<IMG border=0 SRC=$imagurl\/wink_smile.gif onload='javascript:if\(this.width>screen.width-300\)this.width=screen.width-300'>/isg;
$ThePost=~s/\:\(/<IMG border=0 SRC=$imagurl\/sad_smile.gif onload='javascript:if\(this.width>screen.width-300\)this.width=screen.width-300'>/isg;
$ThePost=~s/\:s/<IMG border=0 SRC=$imagurl\/confused_smile.gif onload='javascript:if\(this.width>screen.width-300\)this.width=screen.width-300'>/isg;
$ThePost=~s/\:\|/<IMG border=0 SRC=$imagurl\/whatchutalkingabout_smile.gif onload='javascript:if\(this.width>screen.width-300\)this.width=screen.width-300'>/isg;
$ThePost=~s/\:\[/<IMG border=0 SRC=$imagurl\/angel_smile.gif onload='javascript:if\(this.width>screen.width-300\)this.width=screen.width-300'>/isg;
return ($ThePost);
}
sub repeat{
open(TMP,"$filepath/data/repeat");
$repeat=<TMP>;
close(TMP);
if($repeat eq $year.$mon.$mday.$hour.$min.$username){&errorview("為防止有人用程序灌水,本BBS限制一個人兩次發帖間隔必須大于30秒!");exit;}
open(TMP,">$filepath/data/repeat");
print TMP $year.$mon.$mday.$hour.$min.$username;
close(TMP);
}
sub errorview {&css;print "<BODY background=$imagurl/bg.gif><TITLE>出錯提示</TITLE><br><br><br><br><br><br><br><br><center><TABLE cellSpacing=0 borderColorDark=#ffffff bgColor=$bgcolor2 borderColorLight=#000000 border=1 width=275><TBODY><TR><TD width=350><TABLE cellSpacing=0 cellPadding=2 width=281 bgColor=$bgcolor0 border=0><TBODY><TR><TD width=342><FONT color=$bgcolor4>¤ 出錯提示</FONT></TD><TD width=18><TABLE cellSpacing=0 borderColorDark=#ffffff cellPadding=0 bgColor=e0e0e0 borderColorLight=#666666 border=1><TBODY><TR><TD><B><font color=808080>×</font></B></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><TABLE cellPadding=4 width=283 border=0><TBODY><TR><TD vAlign=top align=center width=47><FONT size=7 face=Wingdings color=ff0000>L</FONT></TD><TD width=210 align=center><P><font style=font-size:9pt>$_[0]</font></P></TD></TR><TR><TD vAlign=top align=center colSpan=2 width=269><input onclick=javascript:history.back() type=submit value=' 確 定 '></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></HTML>";exit;}
sub okview {print "Content-type: text/html\n\n";print "<html><head><META http-equiv=Content-Type content=text/html; charset=gb2312></head><body><script>alert('$_[0]');history.back();</script><script language=javascript>window.close();</script>";exit;}
sub css {
print "Content-type: text/html\n\n";
print <<EOF;
<HTML><HEAD><meta http-equiv=Content-Type content=text/html; charset=gb2312><link href=$imagurl/bbs.css rel=stylesheet><link REL="SHORTCUT ICON" href=$imagurl/ybb.ico><script src=$imagurl/bbs.js></script></HEAD><body topmargin=0 bgcolor=$bgcolor5 text=$bgcolor6 link=$bgcolor7 vlink=$bgcolor8 alink=$bgcolor9>
EOF
}
sub sendmail{
open (OUTMAIL,"| $mailprg -t");
print OUTMAIL "To: $sendto\n";
print OUTMAIL "From: $adminmail\n";
print OUTMAIL "Subject: $subject\n";
print OUTMAIL "$message";
close(OUTMAIL);
}
sub monitor{
if($Cookies{username} eq ""){&errorview("對不起,您當前的身份是訪客,請先登陸!");}
open (FILE, "$filepath/data/rank");
@rank = <FILE>;
close(FILE);
foreach $ranks (@rank) {
chomp($ranks);
if ($ranks eq $Cookies{username}){$rankss="ok";}}
if($rankss ne ok && $Cookies{username} ne $admname && $Cookies{username} ne $bzmc && $Cookies{username} ne $fbzmc && $Cookies{username} ne $fbzmc2){&errorview("對不起,您沒有此項操作的權限!");}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -