fix for user groups!

main
hecht 13 years ago
parent 9813e7c62f
commit 395bba9500

@ -19,17 +19,18 @@ function displayUserLink($userid, $username = NULL, $clanpre = NULL, $clansu = N
function displayUserNameByID($userid, $showClanTags = TRUE){
if($userid === null){return '';}
$sql = 'select nickname, user.id as userid, clan.clanz_pre, clan.clanz_suff, ads, gm from user left join clan on user.clan = clan.id where user.id = '.$userid;
$groups = getUserGroups($userid);
$sql = 'select nickname, user.id as userid, clan.clanz_pre, clan.clanz_suff from user left join clan on user.clan = clan.id where user.id = '.$userid;
$user_info = mysql_fetch_assoc(mysql_query($sql));
if($user_info['gm'] != 'nein'){
if($user_info['gm'] == 'ja'){
if(isUserInGroup(groups, admin)){
$color = 'style="color:'.$GLOBALS['COLOR_GM'].'"';
} else if($user_info['gm'] == 'et'){
} else if(isUserInGroup(groups, entwickler)){
$color = 'style="color:'.$GLOBALS['COLOR_DEVELOPER'].'"';
} else if($user_info['gm'] == 'ka'){
} else if(isUserInGroup(groups, designer)){
$color = 'style="color:'.$GLOBALS['COLOR_CREATIVE'].'"';
}
} else if($user_info['ads'] == 1){
} else if(isUserInGroup(groups, Werbung_an)){
$color = 'style="color:'.$GLOBALS['COLOR_SUPPORTER'].'"';
} else{
$color = '';

@ -45,7 +45,7 @@ function getUserGroups($user) {
return $groups;
}
function isUserInGroup($usergrouparray, $group) {
function isUserInGroup(array $usergrouparray, $group) {
for($i = 0; $i < count($usergrouparray); $i++) {
if($usergrouparray[$i]['gruppen_id'] == $group) {
return true;

Loading…
Cancel
Save