Файл: vsime.com/chat/inc/shutnik.php
Строк: 15
<?
$shutnik_last = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `chat` WHERE `id_room` = '$room[id]' AND `shutnik` = '1' AND `type` = 'post' ORDER BY id DESC LIMIT 1"));
if ($shutnik_last==NULL || $shutnik_last['time']<time()-$config['shutnik_new'])
{
$k_vopr = mysqli_result("SELECT COUNT(*) FROM `chat_shutnik`");
$shutnik = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `chat_shutnik` LIMIT ".rand(0,$k_vopr).",1"));
mysqli_query($dbi, "INSERT INTO `chat` (`shutnik`, `time`, `message`, `id_room`, `type`) values('1', '$time', '$shutnik[anek]', '$room[id]', 'post')");
}
?>