Phoenix PHP > My Rooms (home)

Results 1 to 11 of 11
  1. #1
    Grand Master Predict is offline
    Grand MasterRank
    Aug 2008 Join Date
    760Posts

    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.


  2. #2
    sexiess is a sin. Subway is offline
    Grand MasterRank
    Jun 2010 Join Date
    2,491Posts

    Re: Phoenix PHP > My Rooms (home)

    Show pic please <3

  3. #3
    Grand Master Predict is offline
    Grand MasterRank
    Aug 2008 Join Date
    760Posts

    Re: Phoenix PHP > My Rooms (home)

    Quote Originally Posted by Subway View Post
    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.

  4. #4
    sexiess is a sin. Subway is offline
    Grand MasterRank
    Jun 2010 Join Date
    2,491Posts

    Re: Phoenix PHP > My Rooms (home)

    I know, I wan pic, to much to ask for Mr.Ripper? >:(

  5. #5
    Grand Master Predict is offline
    Grand MasterRank
    Aug 2008 Join Date
    760Posts

    Re: Phoenix PHP > My Rooms (home)

    Quote Originally Posted by Subway View Post
    I know, I wan pic, to much to ask for Mr.Ripper? >:(

    It will work something like this; although I'm only using 2 rooms. ;)

  6. #6
    sexiess is a sin. Subway is offline
    Grand MasterRank
    Jun 2010 Join Date
    2,491Posts

    Re: Phoenix PHP > My Rooms (home)

    Ty look's sexi.

  7. #7
    Sorcerer Supreme jamieturner is offline
    Member +Rank
    Oct 2010 Join Date
    United KingdomLocation
    359Posts

    Re: Phoenix PHP > My Rooms (home)

    Quite nice thanks, but would be better for 5 random rooms so il edit it :)

  8. #8
    Member RageStefan is offline
    MemberRank
    Jun 2011 Join Date
    The NetherlandsLocation
    63Posts

    Re: Phoenix PHP > My Rooms (home)

    looks good ;)

  9. #9
    Grand Master Predict is offline
    Grand MasterRank
    Aug 2008 Join Date
    760Posts

    Re: Phoenix PHP > My Rooms (home)

    Quote Originally Posted by jamieturner View Post
    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'
            } 
            
    ?>

  10. #10
    Banned rafa95123 is offline
    BannedRank
    May 2009 Join Date
    /home/RaphaLocation
    564Posts

    Re: Phoenix PHP > My Rooms (home)

    Thank's man.
    The limit is easy for change kk

    Thank's again ;p

  11. #11
    Newbie Vegar is offline
    MemberRank
    Feb 2011 Join Date
    NorwayLocation
    19Posts

    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!



Advertisement