users.php
ik had graag dat bij online admins rood zijn
mod groen en users blauw
hoe doe ik dat in de volgende script:
<center>
<br />
<table bgcolor=#737373 width=75% border=2 bordercolor=#000000>
<tr>
<td background="images/tableback2.gif"><div class=text>
<div align="center"><b>Users OnLine</b></div></td>
</tr>
<tr>
<td><div class=text>
<font color="#FFFFFF"><font></h1>
Code (php)
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
<?php
$ctime = time();
$osel = mysql_query("select * from players");
while ($online = mysql_fetch_array($osel)) {
$span = ($ctime - $online[lpv]);
if ($span <= 180) {
print "<a href=view.php?view=$online[id]>$online[user]($online[id]) ";
}
}
?>
$ctime = time();
$osel = mysql_query("select * from players");
while ($online = mysql_fetch_array($osel)) {
$span = ($ctime - $online[lpv]);
if ($span <= 180) {
print "<a href=view.php?view=$online[id]>$online[user]($online[id]) ";
}
}
?>
database:
CREATE TABLE `players` (
`id` int(11) NOT NULL auto_increment,
`user` varchar(15) NOT NULL default '',
`email` varchar(60) NOT NULL default '',
`password` varchar(15) NOT NULL default '',
`active` int(10) NOT NULL default '0',
`password_reset` varchar(100) NOT NULL default '',
`status` varchar(10) NOT NULL default 'Member',
`rank` varchar(15) NOT NULL default 'Scum',
`level` varchar(15) NOT NULL default '1',
`rank_points` int(11) NOT NULL default '0',
`cash` int(13) NOT NULL default '1000',
`hp` int(3) NOT NULL default '100',
`bank` int(13) NOT NULL default '0',
`page` varchar(100) NOT NULL default 'Never logged in',
`lpv` bigint(20) NOT NULL default '0',
`ip` varchar(50) NOT NULL default '',
`family` varchar(25) NOT NULL default 'None',
`ownings` int(2) NOT NULL default '0',
`bullets` int(11) NOT NULL default '0',
`weapon` varchar(20) NOT NULL default 'None',
`protection` varchar(20) NOT NULL default 'None',
`profile` text NOT NULL default '',
`pic` varchar(100) NOT NULL default 'http://www.nitrix.ekinsol.com/images/no-pic.jpg',
UNIQUE KEY `id` (`id`),
KEY `user` (`user`),
FULLTEXT KEY `user_2` (`user`),
FULLTEXT KEY `ip` (`ip`),
FULLTEXT KEY `profile` (`profile`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
bij de database veranderd ik zelf de status in bij level in admin,mod,of member
Hoe dat moet kun je mooi zelf gaan uitzoeken :)
het is toch php hulp of niet dan????
hint:
'ORDER BY ranks' in je query zetten;
echo "<font color='blue'>Moderator JAN</font>";
}