[Release] REVCMS Hot-Rooms

vRory

Unemployed.
May 4, 2011
447
69
Hello Devbest,

Yes another release this time better :)

This was imported from ubercms and edited a slight

Screenshot:
314b2ae80c7e48cb89566a3.png

6b4f625367534d3094bc64f.png

9e9221461fb4405384ad1c3.png

I haven't tested this out to see if it gets the most popular as phx is down :(!

HOW TO INSTALL
1. Under <title>{hotelName} - Community</title> ADD THESE LINES

PHP:
<link rel="stylesheet" href="{url}/web-gallery/styles/rooms.css" type="text/css">
 
<script type="text/javascript" src="{url}/web-gallery/js/rooms.js"></script>

2. LOCATE
PHP:
<script type="text/javascript">
                                    var activeHabbosHabblet = new ActiveHabbosHabblet();
                                    document.observe("dom:loaded", function() { activeHabbosHabblet.generateRandomImages(); });
                                </script>
                            </div>
                        </div>

3. AFTER THE TWO </DIV> TAGS ADD THIS CODE
PHP:
<?php
///////////////////////////////////////////////////////////////////
// #Converted by vRory from Devbest                           //
// #            From reflectionhotel.info                          //
/////////////////////////////////////////////////////////////////
$eo = 'even';
 
function GenerateRoomOccupancy($usersNow, $usersMax)
{
    $num = 1;
    $percentage = intval(($usersNow / $usersMax) * 100);
 
    if ($percentage <= 0)
    {
        $num = 1;
    }
    else if ($percentage < 35)
    {
        $num = 2;
    }
    else if ($percentage < 75)
    {
        $num = 3;
    }
    else if ($percentage < 100)
    {
        $num = 4;
    }
    else if ($percentage >= 100)
    {
        $num = 5;
    }
 
    return 'room-occupancy-' . $num;
}
 
?>
<div class="habblet-container "> 
<div class="cbb clearfix red ">
 
<h2 class="title">Hot Rooms</h2>
 
<style type="text/css">
.room-occupancy-1 { background-image: url('{web-gallery}/images/rooms/room_icon_1.gif') !important; }
.room-occupancy-2 { background-image: url('{web-gallery}/images/rooms/room_icon_2.gif') !important; }
.room-occupancy-3 { background-image: url('{web-gallery}/images/rooms/room_icon_3.gif') !important; }
.room-occupancy-4 { background-image: url('{web-gallery}/images/rooms/room_icon_4.gif') !important; }
.room-occupancy-5 { background-image: url('{web-gallery}/images/rooms/room_icon_5.gif') !important; }
</style>
 
<div id="rooms-habblet-list-container-h124" class="recommendedrooms-lite-habblet-list-container">
<ul class="habblet-list">
 
<?php
 
$get = mysql_query("SELECT * FROM rooms WHERE roomtype = 'private' ORDER BY users_now DESC LIMIT 5")or die(mysql_error());
 
while ($room = mysql_fetch_assoc($get))
{
    if ($eo == 'even')
    {
        $eo = 'odd';
    }
    else
    {
        $eo = 'even';
    }
 
    echo '<li class="' . $eo . '">
    <span class="clearfix enter-room-link ' . GenerateRoomOccupancy($room['users_now'], $room['users_max']) . '" title="Go There" roomid="' . $room['id'] . '">
    <span class="room-enter">Enter room</span>
    <span class="room-name">' . ($room['caption']) . '</span>
    <span class="room-description">' . ($room['description']) . '</span>       
    <span class="room-owner">Owner: <a href="/home/' . ($room['owner']) . '">' . ($room['owner']) . '</a></span>
    </span>
    </li>';
}
 
?>
 
<div id="room-more-data-h124" style="display: none">
<ul class="habblet-list room-more-data">
 
<?php
 
$get = mysql_query("SELECT * FROM rooms WHERE roomtype = 'private' ORDER BY users_now DESC LIMIT 6,10")or die(mysql_error());
 
while ($room = mysql_fetch_assoc($get))
{
    if ($eo == 'even')
    {
        $eo = 'odd';
    }
    else
    {
        $eo = 'even';
    }
 
    echo '<li class="' . $eo . '">
    <span class="clearfix enter-room-link ' . GenerateRoomOccupancy($room['users_now'], $room['users_max']) . '" title="Go There" roomid="' . $room['id'] . '">
    <span class="room-enter">Enter room</span> <br>
    <span class="room-name">' . ($room['caption']) . '</span> <br>
    <span class="room-description">' . ($room['description']) . '</span>       
    <span class="room-owner">Owner: <a href="/home/' . ($room['owner']) . '">' . ($room['owner']) . '</a></span>
    </span>
    </li>';
}
 
?>
 
</ul>
</div>
 
<div class="clearfix">
<a href="#" class="room-toggle-more-data" id="room-toggle-more-data-h124">More Rooms!</a>
</div>
 
</div>
 
<script type="text/javascript">
L10N.put("show.more", "Show more rooms");
L10N.put("show.less", "Show less rooms");
var roomListHabblet_h124 = new RoomListHabblet("rooms-habblet-list-container-h124", "room-toggle-more-data-h124", "room-more-data-h124");
</script>
 
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
 
   
<br /><br>
4. change {web-gallery} to where ever your /styles/ /js/ /images/ are located

also check out the quick-menu i released :

THEN WALLAA! Your done enjoy!
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Nice release, if I were to do this myself for Rev I'd add it into the template system and use Revs engine for the queries (just an idea for you), but thanks for sharing!
 

vRory

Unemployed.
May 4, 2011
447
69
Nice release, if I were to do this myself for Rev I'd add it into the template system and use Revs engine for the queries (just an idea for you), but thanks for sharing!
Hey. is this the class.engine cause i'm going to do that sir, just didn't want to add it somewhere it didn't belong.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Hey. is this the class.engine cause i'm going to do that sir, just didn't want to add it somewhere it didn't belong.

class.engine.php is the actual engine, I wouldn't add it there but for the queries you would use that (global $engine; to call it).

You could put it in app/tpl/class.forms.php (where the news are coded and loaded), also don't forget to do their interfaces! (app/tpl/interfaces/interface.html.php).
 

Users who are viewing this thread

Top