📄 chat.cgi
字号:
foreach $_ (@lines) {
if(/<!--yuzi-->/){
print CHAT "<!--yuzi-->\n";
print CHAT $newmsg."<br>\n";
}else{
print CHAT $_;
}
}
close(CHAT);
&deleteuser;
if($rhome eq ""){
®
exit;
}else{
&send_html;
print <<EOF;
<html>
<head>
<script>
top.location.href="$rhome";
</script>
</head>
<body>
</body>
</html>
EOF
exit;
}
}
sub kickout{
$kickok=0;
if($psd ne $delpsd){
&send_html;
print <<EOF;
<html>
<head></head>
<body bgcolor=F4C9A2>
<center><h2>$title</h2><br>
你无权踢人
<form>
<p align=center><input type=button value="确 定" onclick="window.close();"></p>
</form></center>
</body>
</html>
EOF
exit;
}
open(ONLINE,"$manyfile")|| die $!;
@online=<ONLINE>;
close(ONLINE);
foreach $user (@online) {
$user =~ s/\n//g;
if ($user ne "") {
($nuser,$ntime,$nip)=split(/\t/,$user);
if($bekick eq $nuser){
$kickok=1;
$kickip=$nip;
$kickuser=$nuser;
}
}
}
if($kickok==1){
open(ONLINE,">$manyfile")|| die $!;
foreach $user (@online) {
$user =~ s/\n//g;
if ($user ne "") {
($nuser,$ntime,$nip)=split(/\t/,$user);
if($bekick ne $nuser){
print ONLINE $user."\n";
}
}
}
close(ONLINE);
open(KICK,"$tirenfile")||die $!;
@kick=<KICK>;
close(KICK);
open(KICK,">$tirenfile")||die $!;
print KICK $kickuser."\t".$kickip."\t".$this_call_time."\n";
foreach $kick (@kick){
$kick=~ s/\n//g;
($kname,$kip,$ktime)=split(/\t/,$kick);
if($ktime > ($this_call_time-30)){
print KICK $kick."\n";
}
}
close(KICK);
open(CHAT,"$chatfile")|| die $!;
@lines=<CHAT>;
close(CHAT);
$newmsg="【公告】来自$kickip的<b>$kickuser</b>被$username一脚踢出了聊天室!<font size=1>$thistime</font>";
open(CHAT,">$chatfile")|| die $!;
for ($i=0;$i<=22;$i++) {
$_ = @lines[$i];
if(/<!--yuzi-->/){
print CHAT "<!--yuzi-->\n";
print CHAT $newmsg."<br>\n";
}else{
print CHAT $_;
}
}
close(CHAT);
}
&send_html;
print <<EOF;
<html>
<head></head>
<body bgcolor=F4C9A2>
<center><h2>$title</h2><br>
已经将$kickuser踢出!
<form>
<p align=center><input type=button value="确 定" onclick="window.close();"></p>
</form></center>
</body>
</html>
EOF
exit;
}
sub chkkick{
open(KICK,"$tirenfile")||die $!;
@kick=<KICK>;
close(KICK);
foreach $kick (@kick){
$kick=~ s/\n//g;
($kname,$kip,$ktime)=split(/\t/,$kick);
if(($host eq $kip)||($username eq $kname)){
if($ktime > ($this_call_time-30)){
&send_html;
print <<EOF;
<html>
<head></head>
<body bgcolor=ff0000>
<center><h2><br>对不起</h2><br><br><br><br>
您被禁止进入$title!</center>
</body>
</html>
EOF
exit;
}
}
}
}
sub killhtm{
&send_html;
print <<EOF;
<html>
<head>
<STYLE type=text/css>BODY{FONT-SIZE: 9pt}</STYLE>
<META HTTP-EQUIV="Refresh" CONTENT="30; url=$cgiurl?a_method=killhtm&id=$id">
</head>
<body bgcolor=F4C9A2>
<div align=center><center>
<h2>$title<br>踢人</h2>
<form name=killhtm action="$cgiurl"><br>
<input type=hidden name="id" value=$id>
<input type=hidden name="a_method" value=kickout>
<input type=hidden name="username" value=$username>
请选择被踢的对象<br><br>
EOF
open(ONLINE,"$manyfile")|| die $!;
@online=<ONLINE>;
close(ONLINE);
foreach $user (@online) {
$user =~ s/\n//g;
if ($user ne "") {
($nuser,$ntime,$nip)=split(/\t/,$user);
print "<input type=radio value=$nuser name=bekick>$nuser<br>\n";
}
}
print <<EOF;
<br><br>请输入密码<br><input type=password name="psd" size=10><br><input type=submit value="确 定">
</form>
</center></div>
</body>
</html>
EOF
exit;
}
sub reg{
open(ONLINE,"$manyfile")|| die $!;
@online=<ONLINE>;
close(ONLINE);
$online=@online;
&send_html;
print <<EOF;
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
.p12 { font-family: "宋体"; font-size: 12pt; line-height: 25pt}
.p9 { font-size: 9pt; line-height: 18pt}
body { font-family: "宋体"; font-size: 9pt; line-height: 18pt}
br { font-family: "宋体"; font-size: 9pt; line-height: 15pt}
</style>
</head>
<body bgcolor="F4C9A2" text=FFFFFF>
<center>
<form NAME="reguser" ACTION="$cgiurl" METHOD="POST">
<input type=hidden name=id value=$id>
<input type=hidden name=a_method value=getin>
<dl>
<div align="center">
<center>
<table border="0" cellPadding="0" cellSpacing="0" width="532">
<tbody>
<tr>
<td width="251" align="right"><font color="000000"><font class="p9" face="宋体">
昵称: <input name="username" maxLength=10 size="11"></font></font></td>
<td width="277"><font color="000000"><font class="p9" face="宋体">
密码: <input name="userpsd" maxLength=10 type="password" value size="15"></font></font></td>
</tr>
<tr>
<td width="251" align="right"><font class="p9" face="宋体" color="000000">
性别: <input CHECKED name="sex" type="radio" value="boy">先生<input name="sex" type="radio" value="girl">小姐</font></td>
<td width="277"><font class="p9" face="宋体" color="000000">
房间: </font><font color="000000"><select>
<option>$title($online人)</option>
EOF
foreach $user (@online) {
$user =~ s/\n//g;
if ($user ne "") {
($nuser,$ntime,$nip)=split(/\t/,$user);
print "<option>$nuser</option>\n";
}
}
print <<EOF;
</select>
</font></td></tr>
</tbody>
</table>
<font color="000000"><p>
<input type=submit value=进入>
<input name="B2" type="reset" value="取消">
</font>
</center>
</div>
</dl>
</form>
</body>
</html>
EOF
exit;
}
######################### END OF SCRIPT #########################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -