Jump to content
MakeWebGames

Recommended Posts

Posted

Re: user_level colours

does anyone know how this would be modified so the user_level 2 have red name and user_level 3 has purple and user_level 4 has orange and user_level 5 has pink

If you user a function to print out your usernames (Such as using Username($userid) instead of just using $ir['username']) this is very easy and just involves modifying the function, But if your not there are other ways you could attempt to do it globally on your game such as in the globals checking like this....

if($r['user_level'] == 2) {
$r['username'] = "<span style="color:red">".$r['username']."</span>";
} else {
$r['username'] = $r['username'];
}

No idea if this will work but i suppose its worth a try... I use $r because i beleive Mccode uses that on most pages (Viewuser and so on).

Report back if it works :)

Posted

Re: user_level colours

 

does anyone know how this would be modified so the user_level 2 have red name and user_level 3 has purple and user_level 4 has orange and user_level 5 has pink

If you user a function to print out your usernames (Such as using Username($userid) instead of just using $ir['username']) this is very easy and just involves modifying the function, But if your not there are other ways you could attempt to do it globally on your game such as in the globals checking like this....

 

if($r['user_level'] == 2) {
$r['username'] = "<span style="color:red">".$r['username']."</span>";
} else {
$r['username'] = $r['username'];
}

 

No idea if this will work but i suppose its worth a try... I use $r because i beleive Mccode uses that on most pages (Viewuser and so on).

Report back if it works :)

that didnt work this is how my current one looks like

 

   echo sprintf("Name: %s [%s] %s 
", ($r['donatordays']) ? '<span style="color: blue;">'.stripslashes($r['username']).'</span>' : stripslashes($r['username']), number_format($r['userid']), ($r['donatordays']) ? '[img=donator.gif]' : '');
Posted

Re: user_level colours

 

	function formattedName($userid) { 

	$result = mysql_query(sprintf("SELECT `username`,`userid`,`user_level`,`donatordays` FROM `users` WHERE `userid` = %u;",$userid));
	if(mysql_num_rows($result)) { 

		$player = mysql_fetch_array($result,MYSQL_ASSOC);
		$type = 'player';
		if($player['donatordays'] > 0) { $type = 'donator'; }
		if($player['user_level'] == 2) { $type = 'admin'; }
		elseif($player['user_level'] == 5) { $type = 'assistant'; }

		return '[url="viewuser?u='.$player['userid'].'"]'.$player['username'].'[/url]';

	} else { return false; }

}

 

You just need to add the CSS classes :)

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...