|
楼主 |
发表于 2008-6-2 14:02:24
|
显示全部楼层
来自 中国–四川–宜宾
回复: 论坛个性签名引用PS3排行榜数据!
Post by baili1258
top10.php
貌似不支持中文ID,是不是要修改那里?
到中文iD的位置。会显示空白。。。没有名字 [php]
<style type="text/css">
<!--
body,td,th {
border-Left-Color: #151515;
border-Bottom-Width: 1px;
border-Bottom-Style: solid;
border-Right-Width: 1px;
border-Top-Style: solid;
border-Right-Color: #2E2E40;
border-Top: #151515 1px solid;
border-Top-Width: 1px;
border-Bottom-Color: #2E2E40;
border-Top-Color: #151515;
border-Width: 1px 1px 0px 1px;
border-Left: #151515 1px solid;
border-Right: #2E2E40 1px solid;
border-Style: solid;
border-Left-Style: solid;
border-Right-Style: solid;
border-Bottom: #2E2E40 1px solid;
border-Left-Width: 1px;
font-family: Tahoma;
color: #666666;
font-size:12px;
}
body {
background-color: #000000;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
a:link {
color: #cc0000;
text-decoration: none;
}
a:visited {
color: #CC0000;
text-decoration: none;
}
a:hover {
color: #6699ff;
text-decoration: none;
}
a:active {
color: #990000;
text-decoration: none;
}
-->
</style>
<?php
/*
*Ryan Kelley
*ryan(at)staticsoldiers.net
*/
include("config.php");
if(empty($dbport))
$dbport = 3306;
if($dbtype=="mysql")
{
$plrData = array();
$conn = mysql_connect($dbhost.":".$dbport,$dbuser,$dbpass) or die(mysql_error());
mysql_query("SET NAMES UTF8");
mysql_select_db($dbname,$conn) or die(mysql_error());
$query = "select plrid,uniqueid,rank,skill from ".$dbtblprefix."plr where allowrank=1 order by skill desc limit 15";
$result = mysql_query($query);
for($i=0;$row = mysql_fetch_array($result);$i++)
{
for($j=0;$j<4;$j++)
{
$plrData[$i][$j] = $row[$j];
}
}
print("<table width=\"100%\" align=\"center\" cellpadding=\"5\"><tr><td colspan=\"8\" style=\"background: #000000 url(images/bar2.jpg) repeat-x\" align=\"center\"><font size=\"+1\" color=\"#cc0000\">宜宾ST混战服务器1#和2#综合排名榜</font></td></tr><tr>
<td style=\"background: #050505\" align=\"center\">排名</td><td style=\"background: #050505\">名字</td><td style=\"background: #050505\">杀人数</td><td style=\"background: #050505\">死亡数</td><td style=\"background: #050505\">杀亡比</td><td style=\"background: #050505\">暴头率</td><td style=\"background: #050505\">总在线时间</td><td style=\"background: #050505\">综合得分</td></tr>");
for($i=0;$plrData[$i][0]!=null;$i++)
{
$query = "select uniqueid from ".$dbtblprefix."plr where plrid=".$plrData[$i][0];
$ans = mysql_fetch_array(mysql_query($query));
$plrData[$i][4] = $ans[0];
$query = "select kills,deaths,onlinetime,killsperdeath,headshotkillspct from ".$dbtblprefix."c_plr_data where plrid=".$plrData[$i][0];
$ans = mysql_fetch_array(mysql_query($query));
$plrData[$i][5] = $ans[0];
$plrData[$i][6] = $ans[1];
$plrData[$i][7] = $ans[2];
$plrData[$i][8] = $ans[3];
$plrData[$i][9] = $ans[4];
print("
<tr>
<td style=\"background: #000000 url(images/bar2.jpg) repeat-x\" align=\"center\">".$plrData[$i][2]."</td>
<td style=\"background: #000000 url(images/bar2.jpg) repeat-x\"><a href=\"rank.php?id=".$plrData[$i][0]."\" target=\"_parent\">".$plrData[$i][4]."</a></td>
<td style=\"background: #000000 url(images/bar2.jpg) repeat-x\">".$plrData[$i][5]."</td>
<td style=\"background: #000000 url(images/bar2.jpg) repeat-x\">".$plrData[$i][6]."</td>
<td style=\"background: #000000 url(images/bar2.jpg) repeat-x\">".$plrData[$i][8]."</td>
<td style=\"background: #000000 url(images/bar2.jpg) repeat-x\">".$plrData[$i][9]."%</td>
<td style=\"background: #000000 url(images/bar2.jpg) repeat-x\">".myTime($plrData[$i][7])."</td>
<td style=\"background: #000000 url(images/bar2.jpg) repeat-x\">".$plrData[$i][3]."</td>
</tr>");
}
print("<tr><td colspan=\"8\" style=\"background: #000000 url(images/bar2.jpg) repeat-x\" align=\"center\">输入/rank查看个人排名,输入/stats查看服务器内其他在线玩家的排名。</td></tr>");
print("<tr><td colspan=\"8\" style=\"background: #000000 url(images/bar2.jpg) repeat-x\" align=\"center\">输入/kd查看杀亡率排行,输入/hs查看暴头率排行,输入/top100查看排名前100名玩家。</td></tr></table>");
print("<tr><td colspan=\"8\" style=\"background: #000000 url(images/bar2.jpg) repeat-x\" align=\"center\">请访问我们的主页Http://www.yb-st.cn以获得更详细的排名数据!QQ群:3272640 管理员QQ:971300010</td></tr>");
}
mysql_close($conn);
function myTime($time)
{
if($time >= 3600)
{
for($hour=0;$time>=3600;$hour++)
{
$time -= 3600;
}
}
else
{
$hour = "0";
}
if($time >=60 )
{
for($min=0;$time>=60;$min++)
{
$time -= 60;
}
}
else
{
$min = "00";
}
$sec = $time;
return "$hour:$min:$sec";
}
?>
[/php]
这是我的TOP15,你看看吧,可以正常显示中文名称! |
|