Файл: bot.php
Строк: 11
<?php
$bot = mysql_result(mysql_query("SELECT * FROM `users` WHERE `sex` = '1' ORDER BY RAND() LIMIT 1"), 0);
$bot2 = mysql_result(mysql_query("SELECT * FROM `users` WHERE `sex` = '2' ORDER BY RAND() LIMIT 1"), 0);
$loh = mysql_result(mysql_query("SELECT `sex` FROM `users` WHERE `id` = '".$_SESSION['id']."' AND `act` = '0'"), 0);
$rand = rand(60, 300);
$b_rand = rand(4, 10);
$text1 = mysql_fetch_array(mysql_query("SELECT * FROM `text1` ORDER BY RAND() LIMIT 1"));
$text2 = mysql_fetch_array(mysql_query("SELECT * FROM `text2` ORDER BY RAND() LIMIT 1"));
if (mysql_num_rows(mysql_query("SELECT * FROM `mail` WHERE `out` = '".$_SESSION['id']."' AND `time` > '".(time() - ($rand))."' ORDER BY `id` DESC LIMIT 1")) == 0){
if ($loh == '2')
{
if ($_SESSION['id'] > 0)
mysql_query("INSERT INTO `mail` (`in`, `out`, `msg`, `time`, `n`) VALUES ('".$bot."', '".$_SESSION['id']."', '".$text2['text']."', '".time()."', '1')");
}
if ($loh == '1')
{
if ($_SESSION['id'] > 0)
mysql_query("INSERT INTO `mail` (`in`, `out`, `msg`, `time`, `n`) VALUES ('".$bot2."', '".$_SESSION['id']."', '".$text1['text']."', '".time()."', '1')");
}
}
?>