Domzelan
15.04.2005, 08:22
This script shows us online status, pladge_id - is number how i can take "name" for pledge_id from Pladge table?
<?
include("config.php");
mssql_connect($mssql_server,$mssql_user,$mssql_pas s);
mssql_select_db($mssql_db);
$result=mssql_query("
select
char_name, pledge_id, builder,
class, use_time,
PK, Duel, align
from user_data
where login>logout AND LOGOUT>0 AND LOGIN>0 AND account_id>=1
order by char_name
");
$online_users=array();
for($x=0;$online_users[$x]=mssql_fetch_assoc($result);$x++){
$online_users[$x]['use_time_h']=round($online_users[$x]['use_time']/3600,1)."h";
};
unset($online_users[count($online_users)-1]);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Expires" CONTENT="Fri, Jan 01 1900 00:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=windows-1251">
<META http-equiv="content-language" content="en">
<META name="author" content="">
<META HTTP-EQUIV="Reply-to" CONTENT="@.com">
<META name="generator" content="PHPEd 3.1">
<META NAME="description" CONTENT="">
<META name="keywords" content="">
<META NAME="Creation_Date" CONTENT="08/15/2000">
<META name="revisit-after" content="15 days">
<title>Online</title>
</head>
<body>
<table border="1" align=center size=5>
<tr>
<td colspan="5">LineAgeII Server Online:</td>
</tr>
<tr>
<td>Nick</td>
<td>Clan</td>
<td>Class</td>
<td>Total in game</td>
<td>PvP/PK</td>
</tr>
<?for($x=0;$x<count($online_users);$x++)
{?>
<tr>
<td style="color:<?=$online_users[$x]["align"]?"#FF8080":"#8080FF"?>"><?=$online_users[$x]["char_name"]?>
</td>
<td><?=$online_users[$x]["pledge_id"]?></td>
<td><?=$class_list[$online_users[$x]["class"]]?></td>
<td><?=$online_users[$x]["use_time_h"]?></td>
<td><?=$online_users[$x]["Duel"]?>/<?=$online_users[$x]["PK"]?></td>
</tr>
<?}?>
<tr>
<td colspan="3">Total Online:</td>
<td><?=count($online_users)?></td>
</tr>
</table>
</body>
</html>
<?
include("config.php");
mssql_connect($mssql_server,$mssql_user,$mssql_pas s);
mssql_select_db($mssql_db);
$result=mssql_query("
select
char_name, pledge_id, builder,
class, use_time,
PK, Duel, align
from user_data
where login>logout AND LOGOUT>0 AND LOGIN>0 AND account_id>=1
order by char_name
");
$online_users=array();
for($x=0;$online_users[$x]=mssql_fetch_assoc($result);$x++){
$online_users[$x]['use_time_h']=round($online_users[$x]['use_time']/3600,1)."h";
};
unset($online_users[count($online_users)-1]);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Expires" CONTENT="Fri, Jan 01 1900 00:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=windows-1251">
<META http-equiv="content-language" content="en">
<META name="author" content="">
<META HTTP-EQUIV="Reply-to" CONTENT="@.com">
<META name="generator" content="PHPEd 3.1">
<META NAME="description" CONTENT="">
<META name="keywords" content="">
<META NAME="Creation_Date" CONTENT="08/15/2000">
<META name="revisit-after" content="15 days">
<title>Online</title>
</head>
<body>
<table border="1" align=center size=5>
<tr>
<td colspan="5">LineAgeII Server Online:</td>
</tr>
<tr>
<td>Nick</td>
<td>Clan</td>
<td>Class</td>
<td>Total in game</td>
<td>PvP/PK</td>
</tr>
<?for($x=0;$x<count($online_users);$x++)
{?>
<tr>
<td style="color:<?=$online_users[$x]["align"]?"#FF8080":"#8080FF"?>"><?=$online_users[$x]["char_name"]?>
</td>
<td><?=$online_users[$x]["pledge_id"]?></td>
<td><?=$class_list[$online_users[$x]["class"]]?></td>
<td><?=$online_users[$x]["use_time_h"]?></td>
<td><?=$online_users[$x]["Duel"]?>/<?=$online_users[$x]["PK"]?></td>
</tr>
<?}?>
<tr>
<td colspan="3">Total Online:</td>
<td><?=count($online_users)?></td>
</tr>
</table>
</body>
</html>