';
mysql_query($sql);
return mysql_affected_rows() != 0;
}
function colorize($text){
$sum = md5($text);
return ''.$text.'';
}
// Der Text MUSS schon vorher überprüft werden!
function sendChatMessage($user,$text, $usergroups){
// $text = urldecode($text);
// echo $text.'
';
// So nun erstmal sehen ob der user eine spamstrafe besitzt!!
if(isSpammer($user['id'])){
return;
}
$text = encodeNoHTMLWithBB($text);
// Nun pruefen, ob der User ein spammer ist
becomeSpammer($user['id'],$user['nickname'],$text);
if(strpos($user['nickname'], 'anon_') === 0) {
$nick = $user['nickname'];
} else {
$nick = displayUserNameByID($user['id']);
}
if($text != '' && !is_null($text)){
mysql_query('INSERT ag_chat SET nachricht=\''.$text.'\', user=\''.$nick.'\'');
}
}
function getChatMessages($userid, $messageid = 0, $limit = 25){
if(!is_numeric($messageid)){
$messageid = 0;
}
$row = mysql_fetch_row(mysql_query('Select max(id) from ag_chat'));
$maxid = $row[0];
$minid = $maxid - $limit;
if($messageid > $minid){
$minid = $messageid;
}
$result = mysql_query('SELECT *, Minute(zeit) as m, Hour(zeit) as h FROM ag_chat WHERE id > '.$minid.' ORDER BY ID ASC LIMIT '.$limit);
while ($row = mysql_fetch_assoc($result)) {
$h = $row['h'];
if($h < 10){ $h = '0'.$h;}
$m = $row['m'];
if($m < 10){ $m = '0'.$m;}
$resultstring .= '