Файл: region_clean/umnik1.php
Строк: 113
<?
#######################################
## Mod By KoT (borispol) [76-75-072] ##
#######################################
require_once 'inc.php';
$um = mysql_query("Select user from users where id='2' LIMIT 1;");
$y = mysql_fetch_array($um);
$umnik = $y['user'];
$uid = 2;
$uus = $umnik;
$aqq = mysql_query("Select * from vopros where klu4 = '1'");
$bqq = mysql_fetch_array($aqq);
$answq = $bqq['answer'];
$a = mysql_query("Select * from vopros where klu4 = '1'");
$b = mysql_fetch_array($a);
$nom = $b['number'];
$vr = $b['time'];
$answ = $b['answer'];
$p = intval($p);
if (time() >= $vr) {
if ($nom == 5) {
$st = time();
$st = $st + 240;
mysql_query("Update vopros set time = '".$st."' WHERE klu4 = '1'");
$r = mysql_query("Select count(*) as num from bots");
$a = mysql_fetch_array($r);
$num = $a['num'];
$rnd = mt_rand(1,$num);
$qu = mysql_query("Select * from bots where number='".$rnd."'");
$re = mysql_fetch_array($qu);
$answ = $re['answer'];
$tran = $re['tran'];
$nom = 0;
$vr = $st;
$otv = utf_to_win($answ);
$i = strlen($otv);
$vp = $re['vopros']." (<b>$i букв</b>)";
$rs = "<b>Вопрос: </b>";
mysql_query("Update vopros set number = '".$nom."', question = '".$vp."', answer = '".$answ."', tran = '".$tran."' WHERE klu4 ='1'");
$a = mysql_query("Select posts from users where id='".$uid."'");
$b = mysql_fetch_array($a);
$p = $b['posts'];
$p++;
$st = getmicrotime();
mysql_query("Update users set posts='".$p."', onl='".$st."', room='0' where id ='".$uid."'");
$today = date("H:i");
$rnd = mt_rand(0,99999999);
mysql_query("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$rs."".$vp."', id='".$st."', towhom='', hid='0', usid='".$uid."', komu=''");
} else {
$victint = $set['victint'];
$st = time();
$st = $st + $victint;
if ($victint == 10) $interval = "10 секунд";
elseif ($victint == 30) $interval = "30 секунд";
elseif ($victint == 60) $interval = "минуту";
else $interval = "2 минуты";
mysql_query("Update vopros set time = '".$st."' WHERE klu4 = '1'");
$r = mysql_query("Select count(*) as num from bots");
$a = mysql_fetch_array($r);
$num = $a['num'];
$rnd = mt_rand(1,$num);
$qu = mysql_query("Select * from bots where number='".$rnd."'");
$re = mysql_fetch_array($qu);
$answ = " ";
$tran = " ";
$nom = 5;
$vr = $st;
mysql_query("Update vopros set number = '".$nom."', answer = '".$answ."', tran = '".$tran."' WHERE klu4 ='1'");
$a = mysql_query("Select posts from users where id='".$uid."'");
$b = mysql_fetch_array($a);
$p = $b['posts'];
$p++;
$st = getmicrotime();
mysql_query("Update users set posts='".$p."', onl='".$st."', room='0' where id ='".$uid."'");
$otvet1 = mysql_query("Select * from vopros where , answer = '".$otvet."' klu4 = '1'");
$vp = "Никто не сказал мне правильный ответ: <b>".$answq."</b>. Продолжаем через ".$interval.".";
$today = date("H:i");
$rnd = mt_rand(0,99999999);
mysql_query ("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$vp."', id='".$st."', towhom='', hid='0', usid='".$uid."', komu=''");
}
} elseif ((($vr-time()) < 180) and ($nom == 0)) {
$nom = 1;
mysql_query("Update vopros set number = '".$nom."', answer = '".$answ."' WHERE klu4 ='1'");
$a = mysql_query("Select posts from users where id='".$uid."'");
$b = mysql_fetch_array($a);
$p = $b['posts'];
$p++;
$st = getmicrotime();
mysql_query("Update users set posts='".$p."', onl='".$st."', room='0' where id ='".$uid."'");
$v = utf_to_win($answ);
$v = substr($v,0,1);
$v = win_to_utf($v);
$vp = "<b>Подсказка:</b> $v...";
$today = date ("H:i");
$rnd = mt_rand(0,99999999);
mysql_query("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$vp."', id='".$st."', towhom='', hid='0', usid='".$uid."', komu=''");
} elseif ((($vr-time()) < 90) and ($nom < 2)) {
$nom = 2;
mysql_query("Update vopros set number = '".$nom."', answer = '".$answ."' WHERE klu4 ='1'");
$a = mysql_query("Select posts from users where id='".$uid."'");
$b = mysql_fetch_array($a);
$p = $b['posts'];
$p++;
$st = getmicrotime();
mysql_query("Update users set posts='".$p."', onl='".$st."', room='0' where id ='".$uid."'");
$v = utf_to_win($answ);
$i = strlen($v)/3;
if ($i < 2) $i = 2;
$v = substr($v,0,$i);
$v = win_to_utf($v);
$vp = "<b>Подсказка:</b> $v...";
$today = date("H:i");
$rnd = mt_rand(0,99999999);
mysql_query ("Insert into room0 set klu4= '".$rnd."', time='".$today."', who='".$uus."', message='".$vp."', id='".$st."', towhom='', hid='0', usid='".$uid."', komu=''");
}
?>