Jump to content
MakeWebGames

Recommended Posts

Posted

At the moment i have it so that Admins are red, Donators are yellow and non donators gray

But i would like to add into it a colour for mods---blue

When i just add this

{if($r['user_level'] ==5){ $r['username'] = "<a title='Moderator' href='viewuser.php?u={$r['userid']}'><font color=blue>{$r['username']}</font>";}

before the first user level if statement it doesnt show the HOF no more

Is there an easier way/ or a way to make it so i can have seperate colours for mods

Any help is greatly appreciated

Thanks :-)

 

This is the functioning code

function hof_level()
{
global $db,$ir,$c,$userid, $myf;
print "Showing the 20 users with the highest levels

<table width=75% cellspacing=1 class='table2'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Level</th>  </tr>";
$q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY level DESC,userid ASC LIMIT 20");
$p=0;
while($r=$db->fetch_row($q))
{
if($r['user_level'] ==2){ $r['username'] = "<a title='Admin' href='viewuser.php?u={$r['userid']}'><font color=red>{$r['username']}</font>";}
{$d="";
if($r['donatordays']) { $r['username'] = "[url='viewuser.php?u={$r[']<font color='yellow'>[b]{$r['username']}[/b][/url][/b]</font>"; }
}
$p++;
if($r['userid'] == $userid) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; }
print "<tr> <td>$t$p$et</td> <td>[url='viewuser.php?u={$r[']<a href='gangs.php?action=view&ID={$r['gang']}'>[b][{$r['gangPREF']}][/b][/url][url='viewuser.php?u={$r[']&nbsp<font color='gray'>[b]{$r['username']}[/b][/url]</td><td>$t{$r['level']}$et</td> </tr>";
}
print "</table>";
}
Posted

Re: HOF-- User level Colours

 

At the moment i have it so that Admins are red, Donators are yellow and non donators gray

But i would like to add into it a colour for mods---blue

When i just add this

{if($r['user_level'] ==5){ $r['username'] = "<a title='Moderator' href='viewuser.php?u={$r['userid']}'><font color=blue>{$r['username']}</font>";}

before the first user level if statement it doesnt show the HOF no more

Is there an easier way/ or a way to make it so i can have seperate colours for mods

Any help is greatly appreciated

Thanks :-)

 

This is the functioning code

function hof_level()
{
global $db,$ir,$c,$userid, $myf;
print "Showing the 20 users with the highest levels

<table width=75% cellspacing=1 class='table2'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Level</th>  </tr>";
$q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY level DESC,userid ASC LIMIT 20");
$p=0;
while($r=$db->fetch_row($q))
{
if($r['user_level'] ==2){ $r['username'] = "<a title='Admin' href='viewuser.php?u={$r['userid']}'><font color=red>{$r['username']}</font>";}
{$d="";
if($r['donatordays']) { $r['username'] = "[url='viewuser.php?u={$r[']<font color='yellow'>[b]{$r['username']}[/b][/url][/b]</font>"; }
}
$p++;
if($r['userid'] == $userid) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; }
print "<tr> <td>$t$p$et</td> <td>[url='viewuser.php?u={$r[']<a href='gangs.php?action=view&ID={$r['gang']}'>[b][{$r['gangPREF']}][/b][/url][url='viewuser.php?u={$r[']&nbsp<font color='gray'>[b]{$r['username']}[/b][/url]</td><td>$t{$r['level']}$et</td> </tr>";
}
print "</table>";
}

 

Find this line:

if($r['donatordays']) { $r['username'] = "[url='viewuser.php?u={$r[']<font color='yellow'>[b]{$r['username']}[/b][/url][/b]</font>"; }

 

add under

if ($r['user_level'] == 5) 
{
  $r['username'] = "<a title='Moderator' href='viewuser.php?u={$r['userid']}'><font color=blue>{$r['username']}</font>";
}
Posted

Re: HOF-- User level Colours

 

Are you sure user level 5, is Moderator on your game?

Yes

if($r['user_level'] == 1) { $userl="Mobster"; } else if($r['user_level'] == 2) { $userl="Owner"; } else if ($r['user_level'] == 3) { $userl="Admin"; } else if($r['user_level'] == 0) { $userl="NPC"; } else if($r['user_level'] == 5) { $userl="Moderator"; } else {$userl="Faker"; }
Posted

Re: HOF-- User level Colours

I haven't tested this but it looks like it will work. Add this somewhere, maybe global_func..

 

function formatName($id) {

$id = abs(@intval($id);  
$result = mysql_query(sprintf("SELECT id,username,donatordays,user_level FROM users WHERE u.userid = '%u'", $id));
$result = mysql_fetch_assoc($result);

switch($result[user_level]) {
	case 1: $staffType="Player"; break;
	case 2: $staffType="Admin"; break;
	case 3: $staffType="Assistant"; break;
}

return '[url="?page=profile&ID='.$result[id].'"]<span class="'.$staffType.'">'.$result[username].'</span>[/url]';

}

 

Then to use it...

echo formatName($r[id]);

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...