<?php
/*===================================================+
|| # HoloCMS - Website and Content Management System
|+===================================================+
|| # Copyright © 2008 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|+===================================================+
|| # HoloCMS is provided "as is" and comes without
|| # warrenty of any kind. HoloCMS is free software!
|+===================================================*/

$allow_guests = true;

include('../core.php');
include('../includes/session.php');

$hid = FilterText($_GET['hid']);
$first = FilterText($_GET['first']);
?>
<?php if($hid == "h120"){ ?>
<head>
<link rel="stylesheet" href="../web-gallery/v2/styles/rooms.css" type="text/css" />
<script src="../web-gallery/static/js/rooms.js" type="text/javascript"></script>
<script src="../web-gallery/static/js/rooms.js" type="text/javascript"></script>
</head>
<script type="text/javascript">
L10N.put("show.more", "Show more rooms");
L10N.put("show.less", "Show fewer rooms");
var roomListHabblet_h120 = new RoomListHabblet("rooms-habblet-list-container-h120", "room-toggle-more-data-h120", "room-more-data-h120");
</script>
<?php }elseif($hid == "h122"){ ?>
<head>
<script src="../web-gallery/static/js/moredata.js" type="text/javascript"></script>
</head>
<div id="hotgroups-habblet-list-container" class="habblet-list-container groups-list">
    <ul class="habblet-list two-cols clearfix">
<?php
$i = 0;
$j = 1;
$getem = mysql_query("SELECT * FROM groups ORDER BY views DESC LIMIT 10") or die(mysql_error());

while ($row = mysql_fetch_assoc($getem)) {
        $i++;

        if(IsEven($i)){
            $left = "right";
        } else {
            $left = "left";
			$j++;
        }
		
        if(IsEven($j)){
            $even = "even";
        } else {
            $even = "odd";
        }

        printf("<li class=\"%s %s\" style=\"background-image: url(./habbo-imaging/badge.php?badge=%s)\">
                <a class=\"item\" href=\"./group_profile.php?id=%s\"><span class=\"index\">%s.</span> %s</a>
            </li>\n", $even, $left, $row['badge'], $row['id'], $i, HoloText($row['name']));
}
?>
</ul>
    <div id="hotgroups-list-hidden-h122" style="display: none">
    <ul class="habblet-list two-cols clearfix">
<?php
$i = 10;
$j = 1;
$getem = mysql_query("SELECT * FROM groups ORDER BY views DESC LIMIT 40 OFFSET 10") or die(mysql_error());

while ($row = mysql_fetch_assoc($getem)) {
        $i++;

        if(IsEven($i)){
            $left = "left";
        } else {
            $left = "right";
			$j++;
        }
		
        if(IsEven($j)){
            $even = "odd";
        } else {
            $even = "even";
        }

        printf("<li class=\"%s %s\" style=\"background-image: url(./habbo-imaging/badge.php?badge=%s)\">
                <a class=\"item\" href=\"./group_profile.php?id=%s\"><span class=\"index\">%s.</span> %s</a>
           </li>\n", $even, $left, $row['badge'], $row['id'], $i, HoloText($row['name'])); 
}
?>
</ul>
</div>
    <div class="clearfix">
        <a href="#" class="hotgroups-toggle-more-data secondary" id="hotgroups-toggle-more-data-h122">Mostrami altri gruppi</a>
    </div>
<script type="text/javascript">
L10N.put("show.more.groups", "Guarda altri risultati");
L10N.put("show.less.groups", "Guarda altri risultati");
var hotGroupsMoreDataHelper = new MoreDataHelper("hotgroups-toggle-more-data-h122", "hotgroups-list-hidden-h122","groups");
</script>
</div>
<?php } ?>