Файл: vsime.com/system/start/comm.php
Строк: 117
<?
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='/comm/?act=user&id=$user[id]'>Мои сообщества</a> n";
$ank = $user;
include(H.'comm/count_user.php');
echo ":<br />n";
$count_results_comm = mysqli_result("SELECT COUNT(*) FROM `comm_users` WHERE `id_user` = '$ank[id]' AND `activate` = '1' AND `invite` = '0'");
if (!$count_results_comm)
{
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";
$query_comm = mysqli_query($dbi, "SELECT * FROM `comm_users` WHERE `id_user` = '$ank[id]' AND `activate` = '1' AND `invite` = '0' ORDER BY `last_time` DESC LIMIT $limit");
if ($count_results_comm)
{
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";
}
while($post_comm = mysqli_fetch_array($query_comm))
{
$comm = mysqli_query($dbi, "SELECT * FROM `comm` WHERE `id` = '$post_comm[id_comm]'");
$comm = mysqli_fetch_array($comm);
echo "<a href='/comm/?act=comm&id=$comm[id]'>".hsc($comm['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";
echo "<img src='/i/site/comm.png' /> <a href='/comm/?act=user&id=$user[id]'>Мои сообщества</a> ";
$ank = $user;
include(H.'comm/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_comm = intval($_POST["lim_$post[id]"]);
if (in_array($limit_comm, array(0,1,2,3,4,5,6,7,8,9,10)))$limit_comm = $limit_comm; else $limit_comm = 1;
mysqli_query($dbi, "UPDATE `start_user` SET `limit` = '$limit_comm' 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/comm.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/comm.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";
}
?>