From a4b87a2e9b3198a80a0cfe516797aee0fe7d1107 Mon Sep 17 00:00:00 2001 From: hecht Date: Thu, 1 Sep 2011 10:35:48 +0000 Subject: [PATCH] the design functions now include the settings-config file to prevent possible issues. the message functions now inclode the designfunctions to get the nickname in the right color due to a generic implementation. --- ag/include/designfunctions.inc.php | 19 +++++++++++-------- ag/include/messagefunctions.inc.php | 16 ++-------------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/ag/include/designfunctions.inc.php b/ag/include/designfunctions.inc.php index e80cac8..595eec9 100644 --- a/ag/include/designfunctions.inc.php +++ b/ag/include/designfunctions.inc.php @@ -7,6 +7,7 @@ */ include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/usergroup.inc.php'); +include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/config/settings.inc.php'); // Diese Funktion muss in ein Darstellungspackage hinein und muss noch verlegt werden, Gestaltung in css-Datei @@ -27,14 +28,16 @@ function displayUserNameByID($userid, $showClanTags = TRUE){ $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(isUserInGroup($groups, admin)){ - $color = 'style="color:'.$GLOBALS['COLOR_GM'].'"'; - } else if(isUserInGroup($groups, entwickler)){ - $color = 'style="color:'.$GLOBALS['COLOR_DEVELOPER'].'"'; - } else if(isUserInGroup($groups, designer)){ - $color = 'style="color:'.$GLOBALS['COLOR_CREATIVE'].'"'; - } else if(isUserInGroup($groups, Werbung_an)){ - $color = 'style="color:'.$GLOBALS['COLOR_SUPPORTER'].'"'; + if(isUserInGroup($usergroups, Werbung_an)){ + if(isUserInGroup($groups, admin)){ + $color = 'style="color:'.$GLOBALS['COLOR_GM'].'"'; + } else if(isUserInGroup($groups, entwickler)){ + $color = 'style="color:'.$GLOBALS['COLOR_DEVELOPER'].'"'; + } else if(isUserInGroup($groups, designer)){ + $color = 'style="color:'.$GLOBALS['COLOR_CREATIVE'].'"'; + } else { + $color = 'style="color:'.$GLOBALS['COLOR_SUPPORTER'].'"'; + } } else{ $color = ''; } diff --git a/ag/include/messagefunctions.inc.php b/ag/include/messagefunctions.inc.php index 8c6de92..fec141e 100644 --- a/ag/include/messagefunctions.inc.php +++ b/ag/include/messagefunctions.inc.php @@ -18,6 +18,7 @@ include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/config/db.inc.php'); include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/parse.inc.php'); +include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/designfunctions.inc.php'); include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/bann.inc.php'); function sendMessage($von, $besitzer, $betreff, $text){ @@ -54,20 +55,7 @@ function sendChatMessage($user,$text, $usergroups){ // Nun pruefen, ob der User ein spammer ist becomeSpammer($user['id'],$user['nickname'],$text); - // Faerbe den Spieler nur ein wenn Werbung auf Hardcore steht - if(isUserInGroup($usergroups, Werbung_an)){ - if(isUserInGroup($usergroups, admin)){ - $nick = ''.encodeNoHTMLNoBB($user['nickname']).''; - } else if(isUserInGroup($usergroups, entwickler)){ - $nick = ''.encodeNoHTMLNoBB($user['nickname']).''; - } else if(isUserInGroup($usergroups, designer)){ - $nick = ''.encodeNoHTMLNoBB($user['nickname']).''; - } else { - $nick = ''.encodeNoHTMLNoBB($user['nickname']).''; - } - } else { - $nick = encodeNoHTMLNoBB($user['nickname']); - } + $nick = displayUserNameByID($user['id']); if($text != '' && !is_null($text)){ mysql_query('INSERT ag_chat SET nachricht=\''.$text.'\', user=\''.$nick.'\'');