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

Multiple arrays inside data
Hi,

Simple question. I have a column called "array" in my database, and inserted in

Undefined index on my form
ok im getting Undefined index on this line.. print_r($_REQUEST['form']);

below is the full sc

Question about GD library
I am trying to make an image that shows a random quote from my database.


However I want t

Change image filetype on upload?
Hi,
I've got a form which uploads an image to the server.
Is it possible to change the image t

Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I wou

BackButton Behaviour in AJAX
I have an ASPX Page AJAX Enabled!The page has a gridView and a DDL for filtering on it. The Gridview

Just wondering what you think about my site
I am new to phpfreaks i just seen this form and thought it would be cool to see what other thought a

Session
I am having a little trouble with a session. Not sure if it is my browser or what. I know I do not

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

Prevention Help
How can I use PHP or any other language (feel free to move this thread) to prevent users doing scree

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