Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012
    Location
    United Kingdom
    Posts
    4
    Tokens
    112
    Habbo
    :Pringles,

    Exclamation radiPanel Staff Emails Help!

    Hey!

    I need a bit of assistance with my radiPanel staff emails page.

    As you all know, it shows up all of the contacts on your panel in their usergroups, but i would like my usergroups to be in heirachy order, meaning i would love my staff emails list to be in a paritcular ID order.

    Admin - admin.addUsergroup?id=5
    Radio Manager - admin.addUsergroup?id=4
    Senior Presenter - admin.addUsergroup?id=11
    Radio Presenter - admin.addUsergroup?id=2
    Regular User - admin.addUsergroup?id=1

    And here is the code of the radiPanel emails page which i would like ordered by ID number, and not just generically.

    Code:
    <?php
    
    	if( !preg_match( "/index.php/i", $_SERVER['PHP_SELF'] ) ) { die(); }
    
    ?>
    <div class="box">
    
    	<div class="square title">
    		<strong>Staff Contact Details</strong>
    	</div>
    
    	<?php
    		
    		$query = $db->query( "SELECT * FROM users ORDER BY displaygroup DESC" );
    
    		$j = "a";
    
    		while( $array = $db->assoc( $query ) ) {
    			
    			$query2 = $db->query( "SELECT * FROM usergroups WHERE id = '{$array['displaygroup']}'" );
    			$array2 = $db->assoc( $query2 );
    
    			echo "<div class=\"row {$j}\">";
    
    			echo "<span style=\"float: right;\">";
    			echo $array['email'] ? $array['email'] : 'N/A';
    			echo "</span>";
    
    			echo "<span style=\"font-weight: bold; color: #{$array2['colour']};\">";
    			echo $array['username'];
    			echo "</span> ";
    			
    			echo "(" . ( $array['habbo'] ? $array['habbo'] : 'N/A' ) . ")";
    
    			echo "</div>";
    
    			$j++;
    
    			if( $j == "c" ) {
    
    				$j = "a";
    
    			}
    
    		}
    
    	?>
    
    </div>

  2. #2
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    225
    Tokens
    1,698
    Habbo
    Slopure

    Latest Awards:

    Default

    I believe you do not need to code that, you can go into admin on radipanel, and go to manage user groups, and you can change ranking order by clicking the green arrows.

    Former HabboxLive DJ - 2011

  3. #3
    Join Date
    May 2012
    Location
    United Kingdom
    Posts
    4
    Tokens
    112
    Habbo
    :Pringles,

    Default

    @Gumy15; All that does is move about the menu order, it doesn't do anything for the staff email page, any new groups show up right at the top. The only groups in order is infact the groups which matthew gall coded himself into the panel.
    Last edited by xxMATTGxx; 31-07-2012 at 09:14 AM.

  4. #4
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    The whole thing needs a cleanup from looking at that code. Why on earth would you put the query in the loop like that? Such a terrible idea and a waste of resources. You could just have one single query at the top and loop through that rather than potentially executing hundreds of stupid queries. Something like this:

    Code:
    SELECT * FROM users INNER JOIN usersgroups ON users.displaygroup = usergroups.id ORDER BY users.displaygroup DESC;
    (also why do we need to do select * we don't appear to be using that many fields from each table)

    Although without access to the schema I can't validate the accuracy of the query so I don't recommend you use it.

    Anyway, you could get the ordering sorted by adding some kind of displayorder field in the usergroups table which specifies the order in which you want them to be displayed. Then you'd change the query to order by the display order rather than the group id. Although that would not be possible with the current code you posted as it first fetches the users than does the silly thing where it fetches the usergroup information over and over. You'd need to implement the kind of query I posted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •