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.

main
hecht 13 years ago
parent f7310250f9
commit a4b87a2e9b

@ -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 = '';
}

@ -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 = '<span style="color:lime">'.encodeNoHTMLNoBB($user['nickname']).'</span>';
} else if(isUserInGroup($usergroups, entwickler)){
$nick = '<span style="color:#44BFFF">'.encodeNoHTMLNoBB($user['nickname']).'</span>';
} else if(isUserInGroup($usergroups, designer)){
$nick = '<span style="color:#F70000">'.encodeNoHTMLNoBB($user['nickname']).'</span>';
} else {
$nick = '<span style="color:gold">'.encodeNoHTMLNoBB($user['nickname']).'</span>';
}
} else {
$nick = encodeNoHTMLNoBB($user['nickname']);
}
$nick = displayUserNameByID($user['id']);
if($text != '' && !is_null($text)){
mysql_query('INSERT ag_chat SET nachricht=\''.$text.'\', user=\''.$nick.'\'');

Loading…
Cancel
Save