Файл: adm_panel/chydo.php
Строк: 52
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
$temp_set=$set;
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
user_access('adm_mysql',null,'index.php?'.SID);
//adm_check();
$set['title']='Игра Поймай чудо';
include_once '../sys/inc/thead.php';
title();
if (isset($_GET['go']))
{
$num = rand(999, 99999);
$chydo = '
[url=/pages/chydo.php?kod='.$num.'][img]/images/chudo.gif[/img]
Поймай меня![/url]';
$p= mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `chydo` != '0' LIMIT 1"));
$msg = ''.$p['msg'].'';
//$msg = preg_replace('/'.$chydo.'/', '', $msg);
$msg = strtr($msg, array('[url=/pages/chydo.php?kod='.$p['chydo'].'][img]/images/chudo.gif[/img]
Поймай меня![/url]'=>'[url=/pages/chydo.php][b]Тут было чудо [/b] [img]/images/chudo.gif[/img][/url]', '[url=/pages/chydo.php?kod='.$p['chydo'].'][img]/images/chudo.gif[/img]
Поймай меня![/url]'=>'[url=/pages/chydo.php][b]Тут было чудо [/b] [img]/images/chudo.gif[/img][/url]'));
mysql_query("UPDATE `forum_p` SET `msg` = '$msg', `chydo` = '0' WHERE `id` = '$p[id]'");
$post= mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id_forum` != '14' order by rand() LIMIT 1"));
$msg = ''.$post['msg'].' '.$chydo.'';
//Выполняем функцию запуска игры
mysql_query("UPDATE `forum_p` SET `msg` = '$msg', `chydo`= '$num' WHERE `id` = '$post[id]'");
}
err();
aut();
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `chydo` > '0'"),0)>0){
$post= mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `chydo` > '0' LIMIT 1"));
$them = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '".$post['id_them']."' ORDER BY `time` DESC LIMIT 1"));
echo'Сейчас чудо в теме: <br />';
echo "-<a href='/forum/$them[id_forum]/$them[id_razdel]/$them[id]/'>$them[name]</a> </a><br />n";
echo'Сообщение: <br />';
echo "<div class='cit'>".$post['msg']."</div>n";
echo " <a href="?go">Перезагрузить</a>";
} else {
echo "Игра не запущена.<br /> <a href="?go">Запустить</a>";
}
echo "<div class='foot'>n";
echo "<a href='/adm_panel/'>В админку</a><br />n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
?>