Codigo PHP
Código PHP:
<?php if($hid == "h120"){ ?>
<head>
<div class="habblet-container minimail" id="mail">
<div class="cbb clearfix blue ">
<?php
$i = 0;
$getem = mysql_query("SELECT * FROM rooms ORDER BY score DESC LIMIT 5") or die(mysql_error());
while ($row = mysql_fetch_assoc($getem)) {
$i++;
if(IsEven($i)){
$even = "odd";
} else {
$even = "even";
}
$roomcount = $row['users_now'] / $row['users_max'] * 100;
if($roomcount == 99 || $roomcount > 99){
$rl = 5;
} elseif($roomcount > 65){
$rl = 4;
} elseif($roomcount > 32){
$rl = 3;
} elseif($roomcount > 0){
$rl = 2;
} elseif($roomcount < 1){
$rl = 1;
}
printf("<li class=\"%s\">
<span class=\"clearfix enter-room-link room-occupancy-%s\" title=\"Go to room\" roomid=\"%s\">
<span class=\"room-enter\">Betreten</span>
<span class=\"room-name\">%s</span>
<span class=\"room-description\">%s</span>
<span class=\"room-owner\">Besitzer: <a href=\"".$path."/home/%s\">%s</a></span>
</span>
</li>", $even, $rl, $row['id'], HoloText($row['caption']), FilterText($row['description']), $row['owner'], $row['owner']);
}
?>
</ul>
<div id="room-more-data-h120" style="display: none">
<ul class="habblet-list room-more-data">
<?php
$i = 0;
$getem = mysql_query("SELECT * FROM rooms ORDER BY score DESC LIMIT 15 OFFSET 5") or die(mysql_error());
while ($row = mysql_fetch_assoc($getem)) {
$i++;
if(IsEven($i)){
$even = "odd";
} else {
$even = "even";
}
$get_owner = mysql_query("SELECT username FROM users WHERE id = '".$row['owner']."'");
$owner = mysql_fetch_assoc($get_owner);
$roomcount = $row['users_now'] / $row['users_max'] * 100;
if($roomcount == 99 || $roomcount > 99){
$rl = 5;
} elseif($roomcount > 65){
$rl = 4;
} elseif($roomcount > 32){
$rl = 3;
} elseif($roomcount > 0){
$rl = 2;
} elseif($roomcount < 1){
$rl = 1;
}
echo("<li class=\"%s\">
<span class=\"clearfix enter-room-link room-occupancy-%s\" title=\"Go to room\" roomid=\"%s\">
<span class=\"room-enter\">Betreten</span>
<span class=\"room-name\">%s</span>
<span class=\"room-description\">%s</span>
<span class=\"room-owner\">Besitzer: <a href=\"".$path."/home/%s\">%s</a></span>
</span>
</li>", $even, $rl, $row['id'], HoloText($row['caption']), FilterText($row['description']), $row['owner'], $row['owner']);
}
?>
<?php } ?>