';
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);
$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 .= '
'.$h.':'.$m.' '.$row['user'].': '.$row['nachricht'].'
';
}
if(isSpammer($userid)){
$resultstring.= 'SPAM-BLOCKIERUNG!!
';
}
return $maxid.';'.$resultstring;
}
// + offset in Minuten
function insertUserTickerMessage($userid, $message, $offset = 0){
if($offset == 0){
$timestamp = 'now()';
} else{
$timestamp = '\''.date('Y-m-d H:i:s', time() + $offset * 60).'\'';
}
for($msgid = 0; $msgid < 100000; $msgid += mt_rand(1,1000)){
$sql = 'INSERT INTO user_ticker(userid, date, msgid, text) values('.$userid.', '.$timestamp.', '.$msgid.', \''.$message.'\')';
mysql_query($sql);
if(mysql_affected_rows() == 1){
// echo 'MYSQL success: '.$sql;
return;
}
}
// echo 'MYSQL-Error: '.$sql;
}
function insertClanTickerMessage($clanid, $message, $offset = 0){
if($offset == 0){
$timestamp = 'now()';
} else{
$timestamp = '\''.date('Y-m-d H:i:s', time() + $offset * 60).'\'';
}
for($msgid = 0; $msgid < 100000; $msgid += mt_rand(1,1000)){
$sql = 'INSERT INTO clan_ticker(clanid, date, msgid, text) values('.$clanid.', now(), '.$msgid.', \''.$message.'\')';
mysql_query($sql);
if(mysql_affected_rows() == 1){
// echo 'MYSQL success: '.$sql;
return;
}
}
// echo 'MYSQL-Error: '.$sql;
}
//$test = "Dies ist eine [b]beliebige[/b] Nachricht mit einem auktionslink [a]testlink.html[/a]";
//echo decodeMessage($test).'
';
//$test = 'Test';
//echo encodeMessage($test).'
';
function sendInviteToClanMessage($leaderid, $userid) {
}
?>