Файл: vxas.ru/chat/inc/shutnik.php
Строк: 18
<?
$shutnik_last = mysql_fetch_assoc(mysql_query("SELECT * FROM `chat_post` WHERE `room` = '".mysql_real_escape_string($room[id])."' AND `shutnik` = '1' ORDER BY id DESC LIMIT 1"));
if ($shutnik_last==NULL || $shutnik_last['time']<time()-$set['shutnik_new'])
{
$k_vopr=mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_shutnik`"),0);
$shutnik = mysql_fetch_assoc(mysql_query("SELECT * FROM `chat_shutnik` LIMIT ".rand(0,$k_vopr).",1"));
mysql_query("INSERT INTO `chat_post` (`shutnik`, `time`, `msg`, `room`, `privat`) values('1', '".mysql_real_escape_string($time)."', '".mysql_real_escape_string($shutnik[anek])."', '".mysql_real_escape_string($room[id])."', '0')");
}
?>