@ -77,16 +77,24 @@ function getChatMessages($userid, $messageid = 0, $asc = true, $limit = 25){
$minid = $messageid;
$minid = $messageid;
}
}
$result = db_query('SELECT *, Minute(zeit) as m, Hour(zeit) as h FROM ag_chat WHERE id > '.$minid.' ORDER BY ID '.($asc?' ASC':'DESC').' LIMIT '.$limit);
$result = db_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)) {
while ($row = mysql_fetch_assoc($result)) {
$h = $row['h'];
$h = $row['h'];
if($h < 10 ) { $ h = '0' . $ h ; }
if($h < 10 ) { $ h = '0' . $ h ; }
$m = $row['m'];
$m = $row['m'];
if($m < 10 ) { $ m = '0' . $ m ; }
if($m < 10 ) { $ m = '0' . $ m ; }
$resultstring .= '< div > '.$h.':'.$m.' '.$row['user'].': '.$row['nachricht'].'< / div > ';
if(!$asc) {
$resultstring = '< div > '.$h.':'.$m.' '.$row['user'].': '.$row['nachricht'].'< / div > '.$resultstring;
} else {
$resultstring .= '< div > '.$h.':'.$m.' '.$row['user'].': '.$row['nachricht'].'< / div > ';
}
}
}
if(isSpammer($userid)){
if(isSpammer($userid)){
$resultstring.= '< div style = "color:red" > SPAM-BLOCKIERUNG!!< / div > ';
if(!$asc) {
$resultstring = '< div style = "color:red" > SPAM-BLOCKIERUNG!!< / div > '.$resultstring;
} else {
$resultstring.= '< div style = "color:red" > SPAM-BLOCKIERUNG!!< / div > ';
}
}
}
return $maxid.';'.$resultstring;
return $maxid.';'.$resultstring;
}
}