All my management tabs are showing the same color (orange)?

Status
Not open for further replies.

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
Why is this happening..



(db rank settings)
(management tabs)


My staff.php
PHP:
<?php
    include_once 'includes/header.php';
?>
<title><?= $config['hotelName'] ?>: <?= $lang["Sstaff"] ?></title>
<div class="center">
    <div style="width: 600px;"class="columleft">
        <style>.staff-offline{text-indent:-9999px;width:0px;position:absolute;margin-top:6px;margin-left:7px;height:0px;border:5px solid #F37373;box-shadow:0px 0px 0px 1px rgba(0,0,0,0.2);border-radius:50%;}.staff-online{text-indent:-9999px;width:0px;position:absolute;margin-top:6px;margin-left:7px;height:0px;border:5px solid #73F375;box-shadow:0px 0px 0px 1px rgba(0,0,0,0.2);border-radius:50%;}</style>
        <?php
            $getRanks = DB::Query("SELECT id,name,badgeid FROM ranks WHERE id in (9,8,7,6,5,4,3,2)  ORDER BY id DESC");
            while ($Ranks = DB::Fetch($getRanks))
            { 
                echo '
                <div class="box">
                <div class="title">' . $Ranks['name'] . '</div>
                <div class="mainBox" style="float;left">
                <div class="boxHeader"></div>
                ';
                $getMembers = DB::Query("SELECT id,username,motto,look,online FROM users WHERE rank = '" . filter(DB::Escape($Ranks['id'])) . "'");
                echo '';
                if (DB::NumRows($getMembers) > 0)
                {
                    while ($member = DB::Fetch($getMembers))
                    {
                        $username = filter(DB::Escape($member['username']));
                        $motto = filter(DB::Escape($member['motto']));
                        $look = filter(DB::Escape($member['look']));
                        $online = filter(DB::Escape($member['online']));
                        if($online == 1){ $OnlineStatus = "online"; } else { $OnlineStatus = "offline"; }
                        echo '
                        <a href="/home/'.$username.'"><div style="pointer;float: left;padding-top: 20px;border-radius: 5px;border: 1px solid rgba(0, 0, 0, 0.2);border-bottom: 2px solid rgba(0, 0, 0, 0.2);width: 275px;margin-bottom: 5px;margin-left: 5px;margin-right: 5px;">
                        <div id="column" style="border: 2px dotted rgba(0, 0, 0, 0.2);margin-top: -10px;margin-left: 10px;margin-right: 10px;margin-bottom: 10px;float: left;height:55px;width: 55px;border-radius: 555px;-moz-border-radius: 555px;-webkit-border-radius: 555px;background:url(https://avatar-retro.com/habbo-imaging/avatarimage?figure='.$look.'&head_direction=3&amp;action=wav) no-repeat;background-position: 50% 10%;"></div>
                        <b  style="font-size: 16px;">' .$username . ' </b> <span class="staff-'.$OnlineStatus.'">0</span>
                        <img src="'.$config['badgeURL'].'' . $Ranks['badgeid'] . '.gif" style="margin-right:5px;" align="right">
                        </a>
                        <br>  <img src="/system/content/theme/brain/style/images/icons/motto.png"> <i style="font-size: 12px;">' .$motto . '</i>
                        <BR>
                        </div>
                        ';
                    }
                }
                else
                {
                    echo $lang["Snostaff"];
                }
                echo '
                </div>
                </div>';
            }
        ?>
    </div>
    <div style="width: 370px;" class="columright">
        <div class="box">
            <div class="black title">
                <?= $lang["Sthestaff"] ?>
            </div>
            <div class="mainBox" style="float;left">
                <div class="boxHeader"></div>
            <?= $lang["Sthestafftext"] ?></div>
        </div>
    </div>
    <?php
        include_once 'includes/footer.php';
    ?>
</body>
</html>
 

griimnak

You're a slave to the money then you die
Jul 20, 2013
956
797
Why is this happening..



(db rank settings)
(management tabs)


My staff.php
PHP:
<?php
    include_once 'includes/header.php';
?>
<title><?= $config['hotelName'] ?>: <?= $lang["Sstaff"] ?></title>
<div class="center">
    <div style="width: 600px;"class="columleft">
        <style>.staff-offline{text-indent:-9999px;width:0px;position:absolute;margin-top:6px;margin-left:7px;height:0px;border:5px solid #F37373;box-shadow:0px 0px 0px 1px rgba(0,0,0,0.2);border-radius:50%;}.staff-online{text-indent:-9999px;width:0px;position:absolute;margin-top:6px;margin-left:7px;height:0px;border:5px solid #73F375;box-shadow:0px 0px 0px 1px rgba(0,0,0,0.2);border-radius:50%;}</style>
        <?php
            $getRanks = DB::Query("SELECT id,name,badgeid FROM ranks WHERE id in (9,8,7,6,5,4,3,2)  ORDER BY id DESC");
            while ($Ranks = DB::Fetch($getRanks))
            {
                echo '
                <div class="box">
                <div class="title">' . $Ranks['name'] . '</div>
                <div class="mainBox" style="float;left">
                <div class="boxHeader"></div>
                ';
                $getMembers = DB::Query("SELECT id,username,motto,look,online FROM users WHERE rank = '" . filter(DB::Escape($Ranks['id'])) . "'");
                echo '';
                if (DB::NumRows($getMembers) > 0)
                {
                    while ($member = DB::Fetch($getMembers))
                    {
                        $username = filter(DB::Escape($member['username']));
                        $motto = filter(DB::Escape($member['motto']));
                        $look = filter(DB::Escape($member['look']));
                        $online = filter(DB::Escape($member['online']));
                        if($online == 1){ $OnlineStatus = "online"; } else { $OnlineStatus = "offline"; }
                        echo '
                        <a href="/home/'.$username.'"><div style="pointer;float: left;padding-top: 20px;border-radius: 5px;border: 1px solid rgba(0, 0, 0, 0.2);border-bottom: 2px solid rgba(0, 0, 0, 0.2);width: 275px;margin-bottom: 5px;margin-left: 5px;margin-right: 5px;">
                        <div id="column" style="border: 2px dotted rgba(0, 0, 0, 0.2);margin-top: -10px;margin-left: 10px;margin-right: 10px;margin-bottom: 10px;float: left;height:55px;width: 55px;border-radius: 555px;-moz-border-radius: 555px;-webkit-border-radius: 555px;background:url(https://avatar-retro.com/habbo-imaging/avatarimage?figure='.$look.'&head_direction=3&amp;action=wav) no-repeat;background-position: 50% 10%;"></div>
                        <b  style="font-size: 16px;">' .$username . ' </b> <span class="staff-'.$OnlineStatus.'">0</span>
                        <img src="'.$config['badgeURL'].'' . $Ranks['badgeid'] . '.gif" style="margin-right:5px;" align="right">
                        </a>
                        <br>  <img src="/system/content/theme/brain/style/images/icons/motto.png"> <i style="font-size: 12px;">' .$motto . '</i>
                        <BR>
                        </div>
                        ';
                    }
                }
                else
                {
                    echo $lang["Snostaff"];
                }
                echo '
                </div>
                </div>';
            }
        ?>
    </div>
    <div style="width: 370px;" class="columright">
        <div class="box">
            <div class="black title">
                <?= $lang["Sthestaff"] ?>
            </div>
            <div class="mainBox" style="float;left">
                <div class="boxHeader"></div>
            <?= $lang["Sthestafftext"] ?></div>
        </div>
    </div>
    <?php
        include_once 'includes/footer.php';
    ?>
</body>
</html>
I'm assuming that db is made from another cms because i just read the code and I can't find anything that messes with tab_colour

What you're essentially trying to do is grab the tab color value, then have the background-color from within the tab's stylesheet change based upon what the php says.
 

Haid

Member
Dec 20, 2011
363
448
Why is this happening..
You're calling each rank but not giving it a unique class for the title.
Code:
<div class="title">

You're using BrainCMS so you have black, green, blue, lblue, red, purple and yellow available.
You want to change line 14 to
Code:
<div class="' . $Ranks['tab_colour'] . ' title">' . $Ranks['name'] . '</div>
Then change your tab_colour values in the database to the colours I gave you above.
 
Last edited:

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
You're calling each rank but not giving it a unique class for the title.
Code:
<div class="title">

You're using BrainCMS so you have black, green, blue, lblue, red, purple and yellow available.
You want to change line 14 to
Code:
<div class="' . $Ranks['tab_colour'] . ' title">' . $Ranks['name'] . '</div>
Then change your tab_colour values in the database to the colours I gave you above.

Yes I just figured that out took me an HOUR haha but .. there still is an error..

Notice
: Undefined index: tab_colour in C:\inetpub\wwwroot\system\content\theme\brain\pages\staff.phpon line 18

DB doesn't seem to be reading "tab_colour"...
 

Kodys

lmao
Oct 24, 2016
36
17
Change the $getRanks to
PHP:
$getRanks = DB::Query("SELECT id,name,badgeid,tab_colour FROM ranks WHERE id in (9,8,7,6,5,4,3,2)  ORDER BY id DESC");
 
  • Like
Reactions: Sly

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
Change the $getRanks to
PHP:
$getRanks = DB::Query("SELECT id,name,badgeid,tab_colour FROM ranks WHERE id in (9,8,7,6,5,4,3,2)  ORDER BY id DESC");
You're calling each rank but not giving it a unique class for the title.
Code:
<div class="title">

You're using BrainCMS so you have black, green, blue, lblue, red, purple and yellow available.
You want to change line 14 to
Code:
<div class="' . $Ranks['tab_colour'] . ' title">' . $Ranks['name'] . '</div>
Then change your tab_colour values in the database to the colours I gave you above.

Thankyou to both of you. Worked
 
Status
Not open for further replies.

Users who are viewing this thread

Top