[UberCMS] Hotrooms Fix!

Results 1 to 10 of 10
  1. #1
    Apprentice V4ULT is offline
    MemberRank
    Dec 2010 Join Date
    23Posts

    [UberCMS] Hotrooms Fix!

    Hello!

    Heres another fix that I found:

    inc > tpl > comp-hotrooms.tpl:

    Code:
    <?php
    
    $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('http://images.habbo.com/habboweb/%web_build%/web-gallery/v2/images/rooms/room_icon_1.gif') !important; }
    .room-occupancy-2 { background-image: url('http://images.habbo.com/habboweb/%web_build%/web-gallery/v2/images/rooms/room_icon_2.gif') !important; }
    .room-occupancy-3 { background-image: url('http://images.habbo.com/habboweb/%web_build%/web-gallery/v2/images/rooms/room_icon_3.gif') !important; }
    .room-occupancy-4 { background-image: url('http://images.habbo.com/habboweb/%web_build%/web-gallery/v2/images/rooms/room_icon_4.gif') !important; }
    .room-occupancy-5 { background-image: url('http://images.habbo.com/habboweb/%web_build%/web-gallery/v2/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 = dbquery("SELECT * FROM rooms WHERE roomtype = 'private' ORDER BY users_now DESC LIMIT 5");
    
    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="Ga erheen" roomid="' . $room['id'] . '"> 
    	<span class="room-enter">Enter room</span> 
    	<span class="room-name">' . clean($room['caption']) . '</span> 
    	<span class="room-description">' . clean($room['description']) . '</span>              
    	<span class="room-owner">Owner: <a href="%www%/home/' . uberUsers::name2id($room['owner']) . '/id">' . clean($room['owner']) . '</a></span> 
    	</span> 
    	</li>';
    }
    
    ?>
    
    <div id="room-more-data-h124" style="display: none"> 
    <ul class="habblet-list room-more-data"> 
    
    <?php
    
    $get = dbquery("SELECT * FROM rooms WHERE roomtype = 'private' ORDER BY users_now DESC LIMIT 5,10");
    
    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="Ga erheen" roomid="' . $room['id'] . '"> 
    	<span class="room-enter">Enter room</span> 
    	<span class="room-name">' . clean($room['caption']) . '</span> 
    	<span class="room-description">' . clean($room['description']) . '</span>              
    	<span class="room-owner">Owner: <a href="%www%/home/' . uberUsers::name2id($room['owner']) . '/id">' . clean($room['owner']) . '</a></span> 
    	</span> 
    	</li>';
    }
    
    ?>
    
    </ul> 
    </div> 
    
    <div class="clearfix"> 
    <a href="#" class="room-toggle-more-data" id="room-toggle-more-data-h124">Toon meer kamers</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>
    Replace your entire 'comp-hotrooms.tpl' with that code and it should be fine. :)

    Peace,
    V4ULT


  2. #2
    C# | C++ Emerica is offline
    MemberRank
    Oct 2010 Join Date
    GermanyLocation
    437Posts

    Re: [UberCMS] Hotrooms Fix!

    nice :)

    Thank you

  3. #3
    Banned PEjump2 is offline
    BannedRank
    Jan 2010 Join Date
    The NetherlandsLocation
    2,838Posts

    Re: [UberCMS] Hotrooms Fix!

    Uhh what exactly have you changed? It just looks like the orginal one to me?

  4. #4
    Apprentice V4ULT is offline
    MemberRank
    Dec 2010 Join Date
    23Posts

    Re: [UberCMS] Hotrooms Fix!

    Quote Originally Posted by PEjump2 View Post
    Uhh what exactly have you changed? It just looks like the orginal one to me?
    On the normal Uber is all squashed and also the rooms don't show, this fixes it.

  5. #5
    Valued Member Munches is offline
    MemberRank
    Oct 2010 Join Date
    139Posts

    Re: [UberCMS] Hotrooms Fix!

    Nice if it works...

  6. #6
    What about no. Davidaap is offline
    MemberRank
    Nov 2009 Join Date
    773Posts

    Re: [UberCMS] Hotrooms Fix!

    Quote Originally Posted by V4ULT View Post
    On the normal Uber is all squashed and also the rooms don't show, this fixes it.
    LOL, i never have that problem...

  7. #7
    Banned PEjump2 is offline
    BannedRank
    Jan 2010 Join Date
    The NetherlandsLocation
    2,838Posts

    Re: [UberCMS] Hotrooms Fix!

    Quote Originally Posted by V4ULT View Post
    On the normal Uber is all squashed and also the rooms don't show, this fixes it.
    I don't see any differences with the orginal? And never seen that bug, you properly just didn't update you'r damn web build newb :P

  8. #8
    The one and only! Hejula is offline
    MemberRank
    Nov 2008 Join Date
    4,128Posts

    Re: [UberCMS] Hotrooms Fix!

    Quote Originally Posted by PEjump2 View Post
    I don't see any differences with the orginal? And never seen that bug, you properly just didn't update you'r damn web build newb :P
    Dude, this problem occurs in certain releases of uberCMS. So this IS a valid fix. You are obviously comparing it to the source code of a working one.

    OT: Thanks for this.

  9. #9
    Apprentice V4ULT is offline
    MemberRank
    Dec 2010 Join Date
    23Posts

    Re: [UberCMS] Hotrooms Fix!

    Quote Originally Posted by Hejula View Post
    Dude, this problem occurs in certain releases of uberCMS. So this IS a valid fix. You are obviously comparing it to the source code of a working one.

    OT: Thanks for this.
    Correct. No problem. :P

  10. #10
    Account Upgraded | Title Enabled! salah-salah is offline
    MemberRank
    Jan 2009 Join Date
    UndergroundLocation
    716Posts

    Re: [UberCMS] Hotrooms Fix!

    Nice ;)



Advertisement