Phoenix PHP > My Rooms (home)
PHP Code:
<?php
$userrooms = mysql_query("SELECT * FROM rooms WHERE owner = '".$username."' ORDER BY RAND() LIMIT 3");
$color = 'odd';
if(mysql_num_rows($userrooms) == 0)
{
echo '<div class="RoomBox" id="even"><strong>'.$lang['no_rooms'].'</strong></div>';
}
while($userroom = mysql_fetch_array($userrooms))
{
?>
<div class="RoomBox" id="<?php echo $color; ?>">Room name: <strong><?php echo $userroom['caption']; ?></strong><br /><?php echo $lang['room_visitors']; ?>: <strong><?php echo $userroom['users_now']; ?></strong> <br> <?php echo $lang['room_rating']; ?>: <strong><?php echo $userroom['score']; ?></strong>
</div>
<?php
if($color == 'odd')
$color='even';
else
$color='odd';
}
?>
Basically this stops having a long list of Rooms - Instead it will show 3 random rooms you own.
Re: Phoenix PHP > My Rooms (home)
Re: Phoenix PHP > My Rooms (home)
Quote:
Originally Posted by
Subway
Show pic please <3
If you had 20 rooms; only 3 rooms would be shown out of the 20 and if you reload a different set of rooms will be shown out of your 20 rooms.
Re: Phoenix PHP > My Rooms (home)
I know, I wan pic, to much to ask for Mr.Ripper? >:(
Re: Phoenix PHP > My Rooms (home)
Quote:
Originally Posted by
Subway
I know, I wan pic, to much to ask for Mr.Ripper? >:(
http://i51.tinypic.com/2d2dcad.png
It will work something like this; although I'm only using 2 rooms. ;)
Re: Phoenix PHP > My Rooms (home)
Re: Phoenix PHP > My Rooms (home)
Quite nice thanks, but would be better for 5 random rooms so il edit it :)
Re: Phoenix PHP > My Rooms (home)
Re: Phoenix PHP > My Rooms (home)
Quote:
Originally Posted by
jamieturner
Quite nice thanks, but would be better for 5 random rooms so il edit it :)
Just change the LIMIT to 5.
PHP Code:
<?php
$userrooms = mysql_query("SELECT * FROM rooms WHERE owner = '".$username."' ORDER BY RAND() LIMIT 5");
$color = 'odd';
if(mysql_num_rows($userrooms) == 0)
{
echo '<div class="RoomBox" id="even"><strong>'.$lang['no_rooms'].'</strong></div>';
}
while($userroom = mysql_fetch_array($userrooms))
{
?>
<div class="RoomBox" id="<?php echo $color; ?>">Room name: <strong><?php echo $userroom['caption']; ?></strong><br /><?php echo $lang['room_visitors']; ?>: <strong><?php echo $userroom['users_now']; ?></strong> <br> <?php echo $lang['room_rating']; ?>: <strong><?php echo $userroom['score']; ?></strong>
</div>
<?php
if($color == 'odd')
$color='even';
else
$color='odd';
}
?>
Re: Phoenix PHP > My Rooms (home)
Thank's man.
The limit is easy for change kk
Thank's again ;p
Re: Phoenix PHP > My Rooms (home)
Nice release! I really liked it and added it to my hotel, though it would be a lot better with 5 random rooms instead of 3. But i guess people can change that by themselve! Again, nice release, and you earned yourself a like for this!