Файл: index.php
Строк: 171
<?
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';
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';
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
$ank = get_user($ank['id']);
include_once 'sys/inc/icons.php'; // Иконки главного меню
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
$ank = get_user($ank['id']);
include_once 'sys/inc/thead.php';
title();
err();
if (!$set['web'])
{
if (isset($user)){
echo "<div class="bzx4">
<img src='/style/themes/default/img/userz.png' alt='*'> <a href='/info.php?id=$user[id]' class = 'open' color = '#fff;'>Моя страница</a> <a href="exit.php" class = 'open'>Выход</a></div>";
}else{
echo "<center><div class="auts4"><font color'red'>На сайте: ".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > ".(time()-600).""), 0)." Online</font> +".mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > ".(time()-600)." AND `pereh` > '0'"), 0)." гостей</center></div><div class="bzx4" ><img src='/style/themes/default/img/userz.png' alt='*'> <a href='aut.php' class = 'open'>Вход</a> <a href='/reg.php' class = 'open'>Регистрация</a></div>";
}
echo "</div>";
if (isset($user)){
if (isset($user) && $ank['id'] != $user['id']) {
}
else
{echo "<div class='nav2'>";
echo avatar($ank['id'], true, 128, false);
echo "<br/><a href="/avatar.php/"> <img src='/style/themes/default/111.png' alt='*' /> Добавить фото</a>";
echo "<br/>";
echo "<a href="/user/money/index.php"><img src='/style/themes/default/333.png' alt='*' />Мой кошелёк</a>";
echo " <br/><a href="/user/info/settings.php"><img src='/style/themes/default/222.png' alt='*' /> Настройки</a>";
echo "</div></div>";
}
echo "</div>";
}else{
/*include_once 'sys/inc/news_main.php'; // новости */
}
if (isset($user)){
include_once 'sys/inc/main_menu.php'; // главное меню
}else{
?>
<div class="nav1">
<?
$s1 = mysql_query("SELECT * FROM `gallery_foto` WHERE `avatar` = '1' ORDER BY `rating` DESC LIMIT 6");
?>
<div style="display: block; text-align: center; padding: 3px; padding-bottom: 10px; max-width: 450px; margin: auto; position: relative;"><?
while ($photo = mysql_fetch_assoc($s1))
{
$num++;
?><div style="display: inline-block; position: relative; top: <?=($num % 2 ? 0 : 15)?>px; margin-left: -8px;"><img style="border: 0px solid #f7f7f7;" src="/foto/foto50/<?=$photo['id']?>.jpg" /></div><?
}
?>
</div>
</div>
<?
echo '</span><div class="main_menu">
<b>Новое в дневниках</b>
</div>
';
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes` "),0);
$q=mysql_query("SELECT * FROM `notes` ORDER BY `id` DESC LIMIT 5");
if ($k_post==0)
{
echo " <div class='mess'>n";
echo "Никто не создавал дневникn";
echo " </div>n";
}
while ($post = mysql_fetch_assoc($q))
{
if ($num==0)
{
$num=1;
}elseif ($num==1)
{
$num=0;}
$k_n= mysql_result(mysql_query("SELECT COUNT(*) FROM `notes` WHERE `id` = $post[id] AND `time` > '$ftime'",$db), 0);
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
echo '<div class="mess">';
echo " <b><a href='info.php?id=" . $ank['id'] . "'> ".group($ank['id'])." " . $ank['nick'] . "</a></b> >>> <a href='plugins/notes/list.php?id=$post[id]'>" . text($post['name']) . "</a> <div align='right'><sup> (".vremja($post['time']).") </snup></div> ";
echo '</div>';
}
echo '<div class="main_menu">
<b>Новое в форуме</b>
</div>
';
$adm_add=NULL;
$adm_add2=NULL;
if (!isset($user) || $user['level']==0){
$q222=mysql_query("SELECT * FROM `forum_f` WHERE `adm` = '1'");
while ($adm_f = mysql_fetch_assoc($q222))
{
$adm_add[]="`id_forum` <> '$adm_f[id]'";
}
if (sizeof($adm_add)!=0)
$adm_add2=' WHERE'.implode(' AND ', $adm_add);
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t`$adm_add2"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `forum_t`$adm_add2 ORDER BY `time_create` DESC LIMIT 3");
if (mysql_num_rows($q)==0) {
echo " <div class='mess '>n";
echo "Нет темn";
echo " </div>n";
}
while ($them = mysql_fetch_assoc($q))
{
echo '<div class="mess ">';
$forum=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_f` WHERE `id` = '$them[id_forum]' LIMIT 1"));
$razdel=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_r` WHERE `id` = '$them[id_razdel]' LIMIT 1"));
//$them=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '$post[id_them]' LIMIT 1"));
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));
if ($set['set_show_icon']==2){
echo "<img src='/style/themes/default/forum/48/them_$them[up]$them[close].png' />";
}
elseif ($set['set_show_icon']==1)
{
echo "<img src='/style/themes/default/forum/14/them_$them[up]$them[close].png' alt='' />";
}
echo "<a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>$them[name]</a> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=end'>(".mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_them` = '$them[id]'"),0).")</a>n";
echo "<br><a href='/forum/$forum[id]/'>$forum[name]</a> > <a href='/forum/$forum[id]/$razdel[id]/'>$razdel[name]</a><br />n";
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));
$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_razdel` = '$razdel[id]' AND `id_forum` = '$forum[id]' ORDER BY `time` DESC LIMIT 1"));
$ank2=get_user($post['id_user']);
if ($ank2['id'])echo "Посл.: <a href='/info.php?id=$ank2[id]' title='Анкета "$ank2[nick]"'>$ank2[nick]</a> (".vremja($post['time']).")<br />n";
echo " </div>n";
}
}
if (isset($user)){
/*$adm_add=NULL;
$adm_add2=NULL;
if (!isset($user) || $user['level']==0){
$q222=mysql_query("SELECT * FROM `forum_f` WHERE `adm` = '1'");
while ($adm_f = mysql_fetch_assoc($q222))
{
$adm_add[]="`id_forum` <> '$adm_f[id]'";
}
if (sizeof($adm_add)!=0)
$adm_add2=' WHERE'.implode(' AND ', $adm_add);
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t`$adm_add2"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `forum_t`$adm_add2 ORDER BY `time_create` DESC LIMIT 4");
if (mysql_num_rows($q)==0) {
}
while ($them = mysql_fetch_assoc($q))
{
echo "<a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>";
echo '<div class="forum">';
$forum=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_f` WHERE `id` = '$them[id_forum]' LIMIT 1"));
$razdel=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_r` WHERE `id` = '$them[id_razdel]' LIMIT 1"));
//$them=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '$post[id_them]' LIMIT 1"));
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));
if ($set['set_show_icon']==2){
echo "<img src='/style/themes/$set[set_them]/forum/48/them_$them[up]$them[close].png' />";
}
elseif ($set['set_show_icon']==1)
{
echo "<img src='/style/themes/$set[set_them]/forum/14/them_$them[up]$them[close].png' alt='' />";
}
echo "$them[name](".mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_them` = '$them[id]'"),0).")n";
echo " </div></a>";
}
echo "</div>";*/
echo"<div class='vip22'>";
$k_lider = mysql_result(mysql_query("SELECT COUNT(*) FROM `liders` WHERE `time` > '$time'"),0); $liders = mysql_fetch_assoc(mysql_query("SELECT * FROM `liders` WHERE `time` > '$time' ORDER BY rand() LIMIT 1")); if ($k_lider > 0){ $lider = get_user($liders['id_user']); echo status($lider['id']); echo group($lider['id']) , ' <a href="/info.php?id=' . $lider['id'] . '">' . $lider['nick'] . '</a> '; echo medal($lider['id']) , online($lider['id']) , '<br />'; if ($liders['msg'])echo output_text($liders['msg']) . '<br />'; }
echo"<center><div class='pay_button'><a href='/user/liders/'><b>Получить VIP</b></a></div></center></div>";
}
}else{
include_once 'style/themes/'.$set['set_them'].'/index.php'; // главная web темы
}
include_once 'sys/inc/tfoot.php';
?>