Online list
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
<?
$UPDATE_DB = 1;
include("_include-config.php");
if(! check_login()) {
header("Location: login.php");
exit;
}
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
?>
$UPDATE_DB = 1;
include("_include-config.php");
if(! check_login()) {
header("Location: login.php");
exit;
}
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
?>
<html>
<head>
<title>GunFire.nl | Join and rule the game!</title>
<link rel="stylesheet" type="text/css" href="css-v1.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<table width=100%>
<tr><td class="subTitle"><b>Online Users</b></td></tr><b><tr><td class="maintxt" align="center">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?
$dbres = mysql_query("SELECT * FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login`");
while ($aant = mysql_fetch_array($dbres)) {
$playername = $aant["login"];
echo " <a href=\"profile.php?x=".$playername."\">".$playername."</a> - ";
}
print <<<ENDHTML
</form></td></tr>
<form action="list.php" method="get">
<table width=30% align="center">
<tr><td class="subTitle" align="center"><b>Find Player</b></td></tr>
<tr><td class="mainTxt" align="center"><input type="hidden" name="s" value="search"><input type="text" name="q" value=""><input type="submit" value="Find!"></td></tr>
</table>
</form>
ENDHTML;
?>
$dbres = mysql_query("SELECT * FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login`");
while ($aant = mysql_fetch_array($dbres)) {
$playername = $aant["login"];
echo " <a href=\"profile.php?x=".$playername."\">".$playername."</a> - ";
}
print <<<ENDHTML
</form></td></tr>
<form action="list.php" method="get">
<table width=30% align="center">
<tr><td class="subTitle" align="center"><b>Find Player</b></td></tr>
<tr><td class="mainTxt" align="center"><input type="hidden" name="s" value="search"><input type="text" name="q" value=""><input type="submit" value="Find!"></td></tr>
</table>
</form>
ENDHTML;
?>
</table>
In een andere online lijst die ik heb staat een regel code die de members met het level 225 rood weergeeft en tussen [].
$username = ($info->level == 225) ? "<b><font color=red>[$username]<b><img src=\"images/250.gif\" height=\"10\" border=\"0\">" : $username;
Nou wil ik dat deze regel code in het bovenstaande script verwerkt wordt, zodat ook daar de members die 225 als level hebben rood worden. Kan iemand me helpen?
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?
$dbres = mysql_query("SELECT * FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login`");
while ($aant = mysql_fetch_array($dbres)) {
$level = $aant['level'];
$playername = ($level == 225) ? "<b><font color=red>[$playername]<b><img src=\"images/250.gif\" height=\"10\" border=\"0\">" : $playername;
echo " <a href=\"profile.php?x=".$playername."\">".$playername."</a> - ";
}
print <<<ENDHTML
</form></td></tr>
<form action="list.php" method="get">
<table width=30% align="center">
<tr><td class="subTitle" align="center"><b>Find Player</b></td></tr>
<tr><td class="mainTxt" align="center"><input type="hidden" name="s" value="search"><input type="text" name="q" value=""><input type="submit" value="Find!"></td></tr>
</table>
</form>
ENDHTML;
?>
$dbres = mysql_query("SELECT * FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login`");
while ($aant = mysql_fetch_array($dbres)) {
$level = $aant['level'];
$playername = ($level == 225) ? "<b><font color=red>[$playername]<b><img src=\"images/250.gif\" height=\"10\" border=\"0\">" : $playername;
echo " <a href=\"profile.php?x=".$playername."\">".$playername."</a> - ";
}
print <<<ENDHTML
</form></td></tr>
<form action="list.php" method="get">
<table width=30% align="center">
<tr><td class="subTitle" align="center"><b>Find Player</b></td></tr>
<tr><td class="mainTxt" align="center"><input type="hidden" name="s" value="search"><input type="text" name="q" value=""><input type="submit" value="Find!"></td></tr>
</table>
</form>
ENDHTML;
?>
Gewijzigd op 18/12/2005 11:55:00 door Jan Koehoorn
Je krijgt dus de opmaak in de link, dat moet eruit en er moet alleen $playername staan. Alleen moet hij wel de opmaak behouden.???
"Alleen moet hij wel de opmaak behouden" staan nogal haaks op elkaar :-)
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?
$dbres = mysql_query("SELECT * FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login`");
while ($aant = mysql_fetch_array($dbres)) {
$level = $aant['level'];
$playerlink = $playername;
$playername = ($level == 225) ? "<b><font color=red>[$playername]<b><img src=\"images/250.gif\" height=\"10\" border=\"0\">" : $playername;
echo " <a href=\"profile.php?x=".$playerlink."\">".$playername."</a> - ";
}
print <<<ENDHTML
</form></td></tr>
<form action="list.php" method="get">
<table width=30% align="center">
<tr><td class="subTitle" align="center"><b>Find Player</b></td></tr>
<tr><td class="mainTxt" align="center"><input type="hidden" name="s" value="search"><input type="text" name="q" value=""><input type="submit" value="Find!"></td></tr>
</table>
</form>
ENDHTML;
?>
$dbres = mysql_query("SELECT * FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login`");
while ($aant = mysql_fetch_array($dbres)) {
$level = $aant['level'];
$playerlink = $playername;
$playername = ($level == 225) ? "<b><font color=red>[$playername]<b><img src=\"images/250.gif\" height=\"10\" border=\"0\">" : $playername;
echo " <a href=\"profile.php?x=".$playerlink."\">".$playername."</a> - ";
}
print <<<ENDHTML
</form></td></tr>
<form action="list.php" method="get">
<table width=30% align="center">
<tr><td class="subTitle" align="center"><b>Find Player</b></td></tr>
<tr><td class="mainTxt" align="center"><input type="hidden" name="s" value="search"><input type="text" name="q" value=""><input type="submit" value="Find!"></td></tr>
</table>
</form>
ENDHTML;
?>
hij doet het, hardstikke bedankt ;)
*Criminals* ^^ (telt dat nog steeds?)