RevCMS Staff Page (Hidden Rank)

Relivid

Jamie - Relivid
Jun 29, 2011
139
25
<?php if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) >= 4)
How do i add a hidden rank? e.g. rank 13... (highest rank)
 

Legion

Gaming Lord
Staff member
Nov 23, 2011
1,808
679
PHP:
<?php
                            $GetRanks = mysql_query("SELECT id,name FROM ranks WHERE id = 4 ORDER BY id DESC");
                            while($Ranks = mysql_fetch_assoc($GetRanks))
                            {
                                echo "<div class=\"habblet-container \"><div class=\"cbb clearfix blue \"><h2 class=\"title\">{$Ranks['name']}s</h2><div style=\"padding:5px\"><p>";
                                $GetUsers = mysql_query("SELECT username,motto,rank,last_online,online,look FROM users WHERE rank = {$Ranks['id']}");
                                while($Users = mysql_fetch_assoc($GetUsers))
                                {
                                    if($Users['online'] == 1){ $OnlineStatus = "<font color=\"darkgreen\"><b>Online</b></font>"; } else { $OnlineStatus = "<font color=\"darkred\"><b>Offline</b></font>"; }
                                    echo "<img style=\"position:absolute;\" src=\"http://www.habbo.com/habbo-imaging/avatarimage?figure={$Users['look']}&action=wav&direction=2&head_direction=3&gesture=srp&size=l\">"
                                        ."<p style=\"margin-left:80px;margin-top:20px;\">Username: <strong>{$Users['username']}</strong><br>Motto: <strong>{$Users['motto']}</strong><br><small>Last Online: ". date("D, d F Y H:i (P)", $Users['last_online']) ."</small></p>"
                                        ."<p style=\"float:right;margin-top:-30px;margin-right:5px;\">{$OnlineStatus}</p><br><br><br>";
                                }
                                echo "</div></div></div>";
                            }
                        ?>

Just add that for all ranks you want on the staff list just change
Code:
<?php
                            $GetRanks = mysql_query("SELECT id,name FROM ranks WHERE id = 4 ORDER BY id DESC");
                            while($Ranks = mysql_fetch_assoc($GetRanks))
?>
to the rank
 

Gajeel

Well-Known Member
Oct 4, 2011
2,411
413
PHP:
<?php if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) >= 4)
Change that to this one...
PHP:
<?php if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) >= '13' AND id < '1')
That will fetch all ranks from rank 2 up to 13, except 1.
 

Legion

Gaming Lord
Staff member
Nov 23, 2011
1,808
679
PHP:
<?php if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) >= 4)
Change that to this one...
PHP:
<?php if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) >= '13' AND id < '1')
That will fetch all ranks from rank 2 up to 13, except 1.
No, he wanted all ranks but 2-12, Not 13
 

Users who are viewing this thread

Top