Help with usergroups? prolly really quick


Posted on 16th Feb 2014 07:03 pm by admin

So were coding our own forums for a game system we made an we have the users level setup but now I need to make it do user groups. See the groups are defined by numbers:

0 - banned
1 - registered
2 - donator
3 - mod
4 - admin
5 - owner

I have this setup to define ranks
$rankstring = "<b><font color='#336699'>";

$row=update_lastVisit($_SESSION["user"][0]);

$x = 1;

while ( $whosonline = mysql_fetch_array( $res ) ) {
if ( $x != 1 ) {
echo ", ";
}
echo "<a href="member.php?id=$whosonline[id]">$rankstring$whosonline[name]</b></font></a></strike>";
$x++;
}

I need to know how to make it MySql read the row for the level and if there in that group then make their name that color. Like for admins something like

if user level is 5 then $rankstring = "html code for admin color";
and have that set ONLY admins as that color and not the other groups. How would I do it like that? The row that the usergroups are read from is 5 if that helps. Can someone help quickly?

No comments posted yet

Your Answer:

Login to answer
340 Like 41 Dislike
Previous forums Next forums
Other forums

Undefined offset when using a flat file with pipe symbols
Hi, I've got a flat file/text file which I'm currently using as a member database for my site (not a

Need understanding of this bit of code
Code: <?php
// WHERE clause filters
$arrSQLFilters = array();

//

Help With editting and deleting form
So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.png
This table

EXplanation help
Hey all,

I am still fairly new to PHP programming and I am trying to put together a page wher

Basic Question Regarding PHP Includes
Hi

Just starting out with PHP.

Working on a site that uses some basic includes, these

Php If in MySql query (hiding labels if a field is empty)
Okay, I've been trying to do this for a while, and I'm finally going to ask for help so I can get th

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
what is wrong with this

Code: [Select]<?php
if ($_SERVER['HTTP_REFERER'])
{

getAlexaRank($url) function not working
I have made a function to get alexa rank
the site is here: http://mytestsite.rack111.com/1

Probably a simple error...
I'm getting the error -- Parse error: syntax error, unexpected '{' in /home/content/c/s/t/csteffen24

Session problem?!?
Hello All! I am very new to the php world but I am working on fixing things that a previous programm

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash