Файл: vsime.com/system/start/my_games.php
Строк: 112
<?
if (isset($start_page))
{
if (isset($settings))$limit = 10;
else $limit = $post['limit'];
if ($limit > 0)
{
echo "<div class='blbot'>n";
if (isset($settings))
{
echo "<span class='right'>n";
echo "<a href='?act=start&up=$post[id]&mdp=$mdp'>$config[code_up]</a> <a href='?act=start&down=$post[id]&mdp=$mdp'>$config[code_down]</a> <a href='?act=start&delete=$post[id]'>$config[code_delete]</a> <a href='?act=start&edit=$post[id]'>$config[code_edit]</a>n";
echo "</span>n";
}
echo "<a href='/my_games/'>Мои Игры</a> n";
$ank = $user;
include(H.'my_games/count_user.php');
echo ":<br />n";
$query_games = mysqli_query($dbi, "SELECT * FROM `user_games` WHERE `id_user` = '$user[id]' ORDER BY `last_time` DESC LIMIT $limit");
if (!mysqli_num_rows($query_games))
{
if (isset($settings))
{
$count = mysqli_result("SELECT COUNT(*) FROM `start_user` WHERE `id_start` = '$post[id]'");
if ($count > 0)echo "<span style='font-size: 11px;'>Стоит у ".sklon_text($count, array('человека','человек','человек'))."<br />n";
}
}
echo "</div>n";
if (mysqli_num_rows($query_games))
{
echo "<div class='list'>n";
while($post_games = mysqli_fetch_array($query_games))
{
$game = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `games` WHERE `id` = '$post_games[id_game]'"));
echo "<a href='/my_games/?play_game=$post_games[id]'>".hsc($game['name'])."</a><br />n";
}
if (isset($settings))
{
$count = mysqli_result("SELECT COUNT(*) FROM `start_user` WHERE `id_start` = '$post[id]'");
if ($count > 0)echo "<span style='font-size: 11px;'>Стоит у ".sklon_text($count, array('человека','человек','человек'))."<br />n";
}
echo "</div>n";
}
} else {
echo "<div class='list'>n";
if (isset($settings))
{
echo "<span class='right'>n";
echo "<a href='?act=start&up=$post[id]&mdp=$mdp'>$config[code_up]</a> <a href='?act=start&down=$post[id]&mdp=$mdp'>$config[code_down]</a> <a href='?act=start&delete=$post[id]'>$config[code_delete]</a> <a href='?act=start&edit=$post[id]'>$config[code_edit]</a>n";
echo "</span>n";
}
echo "<img src='/i/site/games.png' /> <a href='/my_games'>Мои Игры</a> ";
$ank = $user;
include(H.'my_games/count_user.php');
echo "<br />n";
if (isset($settings))
{
$count = mysqli_result("SELECT COUNT(*) FROM `start_user` WHERE `id_start` = '$post[id]'");
if ($count > 0)echo "<span style='font-size: 11px;'>Стоит у ".sklon_text($count, array('человека','человек','человек'))."<br />n";
}
echo "</div>n";
}
} elseif (isset($submited)) {
if (isset($_POST["lim_$post[id]"]))
{
$limit_games = intval($_POST["lim_$post[id]"]);
if (in_array($limit_games, array(0,1,2,3,4,5,6,7,8,9,10)))$limit_games = $limit_games; else $limit_games = 1;
mysqli_query($dbi, "UPDATE `start_user` SET `limit` = '$limit_games' WHERE `id` = '$post[id]'");
}
} elseif (isset($settings_user)) {
echo "<div class='$div'>n";
if ($div=='list')
{
echo "<span class='right'>n";
echo "<a href='?act=settings&add=$post[id]&mdp=$mdp'>$config[code_add]</a>n";
echo "</span>n";
}
echo "<img src='/i/site/games.png' /> Мои Игры<br />n";
echo "<div>n";
echo "Показывает последние несколько онлайн игр, в которые вы заходили. Количество можно менять в настройках.n";
echo "</div>n";
echo "</div>n";
} elseif (isset($add)) {
mysqli_query($dbi, "INSERT INTO `start_user` SET `id_user` = '$user[id]', `id_start` = '$start[id]', `pos` = '$pos', `limit` = '5'");
} else {
echo "<div class='list'>n";
echo "<span class='right'>n";
echo "<a href='?act=settings&up=$post[id]&mdp=$mdp'>$config[code_up]</a> <a href='?act=settings&down=$post[id]&mdp=$mdp'>$config[code_down]</a> <a href='?act=settings&delete=$post[id]&mdp=$mdp'>$config[code_delete]</a>n";
echo "</span>n";
echo "<img src='/i/site/games.png' /> Мои Игры<br />n";
echo "<div >n";
echo "Сколько игр показывать на стартовой странице? <input name='lim_$post[id]' value='$post[limit]' size='2' /><br />n";
echo "<span class='grey small'>Укажите число от 0 до 10 (0 - не показывать ни одной игры).</span>n";
echo "</div>n";
echo "</div>n";
}
?>