How to make a button visible if your a gang member (Help Please)

Ben144

Member
Jan 31, 2017
76
5
Hey,

I am using FluxRP an i have created a simple button where the button is only visible to gang members only, meaning the user must be part of a gang to see the button, just like the gangs page but the button is not appearing .

PHP:
            <?php
$gangID = filter($_GET['id']);
$topstatsurl = $url."/ganglb";
if (isset($_GET['id']))//We have an ID, search.
{
    $gangID = filter_var($_GET['id'], FILTER_VALIDATE_INT); //Filter id for only intgers
    if (mysql_num_rows(mysql_query('SELECT * FROM `rp_gangs` WHERE `id` = '.$gangID.' LIMIT 1')) == 1) //check if result exists
    {
        echo '<li id="tab-register-now">
                    <a href="{url}/gangs" style="z-index: 1;float: right;background-color: #ff0000;padding: 9px 9px;color: #000;text-decoration: none;margin-right: 100px;margin-top: 50px;font-size: 15px;font-weight: bold;border-radius: 10px;"><b>Staff Only</b><i></i></a>   </li>
            ';
    }
}
else
{
    $getInfo = mysql_query("SELECT id,gang_id FROM rp_stats WHERE id = '".$_SESSION['user']['id']."'");
    $OurInfo = mysql_fetch_array($getInfo);

    if ($OurInfo['gang_id'] != 0)
        $gangID = $OurInfo['gang_id'];
    else
    {
        //die("Didn't choose a gang, and your not in a gang, set one up in game with :gangid");
        header("Location: ".$topstatsurl);
        exit;
        die();
    }
}

$getGangRanks = mysql_query("SELECT * FROM `rp_gangs_ranks` WHERE `gangid` = '".$gangID."' ORDER BY `rankid` DESC") or die(mysql_error());
$getGangMemebers = mysql_query("SELECT * FROM `rp_stats` WHERE `gang_id` = '".$gangID."' ORDER BY `gang_rank` DESC") or die(mysql_error());

?>

Any help appreciated and thanks in advance.
 

Users who are viewing this thread

Top