⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chat-displaycount.pl

📁 java开发的聊天室
💻 PL
字号:
sub displaycount
{
opendir (MEMBERDIR, "$memberspath"); 
@members = readdir(MEMBERDIR);
closedir (MEMBERDIR);
   $found = 0;  
   $match = 0;
   	@myid;
	@mycount;
	@mydate;
	@mytime;
	$i=0;
$tempren=0;
foreach $member(@members)
{
$temps=substr($member,length($member)-length($extcount),length($member));
if (($temps eq $extcount)&&($member ne $extcount))
{	
$tempren+=1;
open (CHECKPROFILE, "$memberspath/$member");
	@profile = <CHECKPROFILE>;
	close (CHECKPROFILE);
	@profilestats = split (/|/, $profile[0]);
if($profilestats[1] ne "")
{	$tempcount=int($profilestats[4]*$logincishu/100+$profilestats[5]*$shijianfu/100+$profilestats[6]*$saycishu/100)-$profilestats[7]*$kickfu-$profilestats[8]*$privatefu;
	$mycount[$i]=$tempcount;
	$myid[$i]=$profilestats[1];
	$mydate[$i]=$profilestats[12];
	$i=$i+1;
}
}			
}
	$a=0;
	$b=0;
	$c=0;
	for ($a=0;$a<$i;$a++)
	{
		for($b=0;$b<$a;$b++)
		{
			if ($mycount[$a]>$mycount[$b])
			{
				$tempcount=$mycount[$a];
				$mycount[$a]=$mycount[$b];
				$mycount[$b]=$tempcount;
				$tempid=$myid[$a];
				$myid[$a]=$myid[$b];
				$myid[$b]=$tempid;
				$tempdate=$mydate[$a];
				$mydate[$a]=$mydate[$b];
				$mydate[$b]=$tempdate;
			}
		}
	}

	print "<html><head>";
	print "<LINK REL=stylesheet HREF='$cssurl' TYPE='text/css'>";
	print "<title>$mytitle$myversion</title></head><body bgcolor=$funcback text=yellow>\n";
	$mycount=1;
	print "<center><h1>冰花雪夜光荣榜</h1>";
&menuti;
$temprows=$displaynumber/2+2;
print "<table border=1>	<tr bgcolor=#008080><TD bgcolor=red rowspan=$temprows>&nbsp;</TD>
<td align=center>名次</td><td align=center>用户名称</td><td align=center>累计得分</td><td align=center>上次登陆时间</td>
<td align=center>名次</td><td align=center>用户名称</td><td align=center>累计得分</td><td align=center>上次登陆时间</td>
<TD bgcolor=red  rowspan=$temprows>&nbsp;</TD>
</tr>\n";

$rowcount=2; 			#每行显示人数
for ($i=0;$i<($displaynumber/2);$i++)
{
	print "<tr>";
	for ($j=0;$j<=$rowcount;$j++)
	{
		$tempi=$i;
		$tempii=$tempi+1;
		$tempiii=$tempii+($displaynumber/2);
		if ($tempii eq 1) {$temp4="<img src=$gifhead$firstgif height=15>";} else {$temp4=$tempii}
		print "<TD align=center bgcolor=#008080>$temp4</TD><td>&nbsp;$myid[$tempi]</td><TD>&nbsp;$mycount[$tempi]</TD><TD>&nbsp;$mydate[$tempi]</TD>" if ($j eq 0);
		print "<TD align=center bgcolor=#008080>$tempiii</TD><td>&nbsp;$myid[$tempi+$displaynumber/2]</td><TD>&nbsp;$mycount[$tempi+$displaynumber/2]</TD><TD>&nbsp;$mydate[$tempi+$displaynumber/2]</TD>" if ($j eq 1);		
	}
	print "</tr>";
}

	print "<tr bgcolor=#008080><td colspan=8 align=center>(注册帐号总数:<font color=red>$tempren</font>个)不想当将军的士兵不是好士兵!</td></tr>";
	print "</table>\n";
	print "</center>";
	print "</body></html>";

}
1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -