<?php
if (isset($_GET[userid])) {
?>
<?php
include("get.Com.user.php");

} else {

if ($_GET["showby"] == "pycoins") {
$show_users_by = mysql_query("SELECT * FROM `pytox_community` ORDER BY `coins` DESC");
} else if ($_GET["showby"] == "status") {
$show_users_by = mysql_query("SELECT * FROM `pytox_community` ORDER BY `status` DESC");
} else {
$show_users_by = mysql_query("SELECT * FROM `pytox_community` ORDER BY `bruger` ASC");
}
?>
<strong>Brugerlisten:</strong>
<br />
[<i> 
<?php
$users_at_all = mysql_query("SELECT * FROM `pytox_community` ORDER BY `id` DESC"); 

$antal = mysql_num_rows($users_at_all);

if ($antal == "0") {
$textantal = "ingen";
$besked = "beskeder";
} else {
$textantal = $antal;

	if ($textantal == "1") {
$besked = "bruger";
	} else if ($textantal >= "2") {
$besked = "brugere";
	}
}

?>
Der er i øjeblikket <?php print $textantal." ".$besked;?> i communityet.</i> ]
<br />
<br />
Vis efter:
<br />
<a href="?site=Com.users">Navn</a> - <a href="?site=Com.users&amp;showby=pycoins">Pycoins</a> - <a href="?site=Com.users&amp;showby=status" style="color:#F00;">Status</a>
<br />
<br />
<br />
<div align="center">
<table class="blackborder" cellpadding="1" cellspacing="0" style="width:400px;">
 <tr>
  <td align="left">
<strong>Brugernavn</strong>
  </td>
  <td align="right">
<strong>Status</strong>
  </td>
<?php
while($db_users_show = mysql_fetch_array($show_users_by)) {
?>
 </tr>
<?php
if ($_COOKIE["user"] == $db_users_show["bruger"]) {

$style = "class=\"myuser\"";
$message = " <- Dette er din bruger!";

} else {

$style = "";
$message = "";

}


if ($i == 0) {
$i = 1;
$bgcolor = "#EEE";
} else if ($i == 1) {
$i = 2;
$bgcolor = "#CCC";
} else if ($i == 2) {
$i = 0;
$bgcolor = "#FFF";
} else {
$i = 1;
$bgcolor = "#EEE";
}

print "<tr><td style=\"background-color:".$bgcolor.";\" align=\"left\"><a href=\"?site=Com.users&amp;userid=".$db_users_show[id]."\" ".$style.">".$db_users_show[bruger]."".$message."</a></td>";
?>
<?php
if ($db_users_show['status'] == 1) {
?>
  <td align="right" style="background-color:<?=$bgcolor?>;color:#063;font-weight:bold;">
Online
<?php
} else {
?>
  <td align="right" style="background-color:<?=$bgcolor?>;color:#F00;">
Offline
<?php
}
?>
 </tr>
<?php
}
?>
</table>
</div>
<?php
}
?>