how to make random vip users only show...

Cronus

Cerberus Founder/Developer
Jul 19, 2013
449
25
Hello,

How do I make it so that this script


PHP:
<?php
                        $GetUsers = mysql_query("SELECT * FROM users WHERE vip = '1' ORDER BY RAND() LIMIT 3");
                        while($Users = mysql_fetch_assoc($GetUsers))
                        {
                            echo "<div class=\"ContentBox\"><div class=\"BoxHeader\" id=\"blue\">{$Users['name']}</div><div class=\"BoxContent\"><p>";
                            $GetUsers = mysql_query("SELECT username,motto,last_online,online,look FROM users WHERE vip = '1' ORDER BY RAND() LIMIT 3");
                            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=\"{url}/avatar.php?figure={$Users['look']}&direction=2&head_direction=3&gesture=sml&size=2\">"
                                    ."<p style=\"margin-left:80px;margin-top:20px;\"><strong>{$Users['username']}</strong><br>{$Users['motto']}</p>"
                                    ."<p style=\"float:right;margin-top:-30px;margin-right:5px;\">{$OnlineStatus}</p><br><br><br>";
                            }
                            echo "</p></div></div>";
                        }
                    ?>


Only shows users not the owners or any staff..
 

Sean

‫‫‫‫‫‫  ‫  Don't Worry, Be Happy
Dec 12, 2011
1,121
405
PHP:
<?php
                        $GetUsers = mysql_query("SELECT * FROM users WHERE vip = '1' AND rank = '1' ORDER BY RAND() LIMIT 3");
                        while($Users = mysql_fetch_assoc($GetUsers))
                        {
                            echo "<div class=\"ContentBox\"><div class=\"BoxHeader\" id=\"blue\">{$Users['name']}</div><div class=\"BoxContent\"><p>";
                            $GetUsers = mysql_query("SELECT username,motto,last_online,online,look FROM users WHERE vip = '1' ORDER BY RAND() LIMIT 3");
                            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=\"{url}/avatar.php?figure={$Users['look']}&direction=2&head_direction=3&gesture=sml&size=2\">"
                                    ."<p style=\"margin-left:80px;margin-top:20px;\"><strong>{$Users['username']}</strong><br>{$Users['motto']}</p>"
                                    ."<p style=\"float:right;margin-top:-30px;margin-right:5px;\">{$OnlineStatus}</p><br><br><br>";
                            }
                            echo "</p></div></div>";
                        }
                    ?>
 

Find

Posting Freak
Jun 21, 2012
597
189
PHP:
<?php
                        $GetUsers = mysql_query("SELECT * FROM users WHERE vip = '1' AND rank < '3' ORDER BY RAND() LIMIT 3");
                        while($Users = mysql_fetch_assoc($GetUsers))
                        {
                            echo "<div class=\"ContentBox\"><div class=\"BoxHeader\" id=\"blue\">{$Users['name']}</div><div class=\"BoxContent\"><p>";
                            $GetUsers = mysql_query("SELECT username,motto,last_online,online,look FROM users WHERE vip = '1' ORDER BY RAND() LIMIT 3");
                            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=\"{url}/avatar.php?figure={$Users['look']}&direction=2&head_direction=3&gesture=sml&size=2\">"
                                    ."<p style=\"margin-left:80px;margin-top:20px;\"><strong>{$Users['username']}</strong><br>{$Users['motto']}</p>"
                                    ."<p style=\"float:right;margin-top:-30px;margin-right:5px;\">{$OnlineStatus}</p><br><br><br>";
                            }
                            echo "</p></div></div>";
                        }
                    ?>

EDIT: fk im late
 

Users who are viewing this thread

Top