📄 online_user.pl
字号:
####################################################
sub online_user {
unless(-e "$homedir/temp/$info.txt"){
open(DATA,">$homedir/temp/$info.txt") || &error("无法打开文件$info.txt");
print DATA $now_sec."=".$room."\n";
close(DATA);
chmod 0666,"$homedir/temp/$info.txt";
}
$reload*=2;
open(TEMP,"<$homedir/temp/$info.txt")||&error("你已不在$title中");
@dt = <TEMP>;
close(TEMP);
($date,$room,$last)= split(/=/, @dt[0]);
$userinfo ="&username=$username&usersex=$usersex&userpassword=$userpassword&userlevel=$userlevel&room=$room&id=$id";
$userinfo=~s/\n//g ;
open(paSS,"<$homedir/createroom.txt") || &error("无法打开文件$homedir/createroom.txt");
@pass = <paSS>;
close(paSS);
chomp(@pass);
open (DATA,">$homedir/createroom.txt")|| &error("无法打开文件$homedir/createroom.txt");
foreach $pass_line (@pass) {
($chkroom,$chkusername,$chknow_sec,$chkclose) = split(/=/, $pass_line);
if ($chkroom eq $room){
$userdata=$room."=".$chkusername."=".$now_sec."=".$chkclose."\n";
} else {
$userdata=$chkroom."=".$chkusername."=".$chknow_sec."=".$chkclose."\n";
}
print DATA $userdata ;
}
close (DATA);
chmod 0666,"$homedir/createroom.txt";
open(ONLINE,"$homedir/online.txt") || &error("无法打开文件$homedir/online.txt");
@online = <ONLINE>;
close(ONLINE);
print "<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\n<title>online_user</title>\n";
print "<META HTTP-EQUIV=REFRESH CONTENT=\"$reload;URL=$fullurl?job=online_user$userinfo\">\n";
if ($userlevel>=$level_who) {
print qq~
<SCRIPT language=javascript><!--
function cxcg(w){
parent.type.document.forms.frmtalk.towho.value=w;
parent.type.document.forms.frmtalk.says1.focus();}
if (navigator.appName.indexOf("Internet Explorer") != -1)
document.onmousedown = noSourceExplorer;
function noSourceExplorer(){
if (event.button == 2 | event.button == 3){
document.location.reload();
}
document.onmousedown=noSourceExplorer
}
//--></SCRIPT>
~;
}
$user_total=@online;
print qq~
<LINK REL=stylesheet HREF="$homeurl/styles.css" TYPE="text/css">
</head> <body bgcolor=$onlineback text=$saysword link=$link_color alink=$alink_color vlink=$vlink_color OnLoad="if(parent.frames.length==0)top.location='$fullurl';">
房间:<font color=$text_color1>$room</font><br>在线:<font color=$text_color1>$user_total</font>
~;
print "<table width=100%> <tr><td align=center><td align=center><a href=\"$fullurl?job=online_user$userinfo\");\" onclick=cxcg(\"大家\") >对大家说</a></td></tr></table>\n";
foreach $online_line (@online) {
($mark,$chkuserip,$chkusername,$chkuserlevel,$chkusersex,$chktime,$chksec,$chkkickout,$chkkickoutway,$markend,$last)=split(/‖/,$online_line);
if ($chkusersex eq "♀") {$sexcolor="$girlcolor";}
elsif($chkusersex eq "♂") {$sexcolor="$boycolor";}
elsif($chkusersex eq "⊙") {$sexcolor="$nosexcolor";}
if (($mark eq "online") && ($markend eq "end")) {
if (($temp ne "$chkuserip‖$chkusername‖$chkuserlevel") && ($chkkickout ne "kickouted")) {
print "$chkusersex<a href=\"$fullurl?job=online_user$userinfo\");\" onclick=cxcg(\"$chkusername\") ><font color=$sexcolor>$chkusername</font></a><br>\n";
}
$temp="$chkuserip‖$chkusername‖$chkuserlevel";
}
}
print "</table><center></body></html>\n";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -