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){ function displayUserNameByID($userid, $showClanTags = TRUE){
if($userid === null){return '';} 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)); $user_info = mysql_fetch_assoc(mysql_query($sql));
if($user_info['gm'] != 'nein'){ if(isUserInGroup(groups, admin)){
if($user_info['gm'] == 'ja'){ $color = 'style="color:'.$GLOBALS['COLOR_GM'].'"';
$color = 'style="color:'.$GLOBALS['COLOR_GM'].'"'; } else if(isUserInGroup(groups, entwickler)){
} else if($user_info['gm'] == 'et'){ $color = 'style="color:'.$GLOBALS['COLOR_DEVELOPER'].'"';
$color = 'style="color:'.$GLOBALS['COLOR_DEVELOPER'].'"'; } else if(isUserInGroup(groups, designer)){
} else if($user_info['gm'] == 'ka'){ $color = 'style="color:'.$GLOBALS['COLOR_CREATIVE'].'"';
$color = 'style="color:'.$GLOBALS['COLOR_CREATIVE'].'"'; } else if(isUserInGroup(groups, Werbung_an)){
}
} else if($user_info['ads'] == 1){
$color = 'style="color:'.$GLOBALS['COLOR_SUPPORTER'].'"'; $color = 'style="color:'.$GLOBALS['COLOR_SUPPORTER'].'"';
} else{ } else{
$color = ''; $color = '';

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

Loading…
Cancel
Save