Файл: wap-ads.ru/index.php
Строк: 163
<?
$time=time();
include_once 'start_sess.php';
include_once 'head.php';
include_once 'functions.php';
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$user[id]' AND (`izg` = '1' OR `time` > '$time') LIMIT 1"),0)!=0 && (!isset($_GET['user']) || isset($_GET['user']) && $_GET['user']!=$user['id'])){
header("Location:?user=$ku[id]&bans");
exit;
}
if($user['blogtime']<=$time && $user['blog']>=$user['maxblog'])
{
$ttime=$time+3600*12;
mysql_query("UPDATE users SET blogtime = '$ttime' WHERE id = '$user[id]'");
mysql_query("UPDATE users SET blog = '0' WHERE id = '$user[id]'");
}
if(isset($user))mysql_query("UPDATE users SET date_last = '$time' WHERE id = '$user[id]'");
if(isset($_GET['online']))
{
include_once 'online.php';
}
elseif(isset($_GET['user']) && $_GET['user']!=NULL)
{
include_once 'user.php';
}
elseif(isset($_GET['read']) && $_GET['read']!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `blogs` WHERE `id` = '".intval($_GET['read'])."'"),0)!=0)
{
include_once 'read.php';
}
elseif(isset($_GET['newid']) && $_GET['newid']!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `news` WHERE `id` = '".intval($_GET['newid'])."'"),0)!=0)
{
include_once 'news_read.php';
}
elseif(isset($_GET['id']))
{
include_once 'idcat.php';
}
elseif(isset($_GET['ava']) && isset($user))
{
include_once 'ava.php';
}
elseif(isset($_GET['mainmenu']))
{
include_once 'mainmenu.php';
}
elseif(isset($_GET['users']))
{
include_once 'users.php';
}
elseif(isset($_GET['chat']))
{
include_once 'chat.php';
}
elseif(isset($_GET['news']))
{
include_once 'news.php';
}
elseif(isset($_GET['out']))
{
$title='Выход';
include_once 'h.php';
if(isset($_GET['ok']))
{
setcookie('id_user');
setcookie('pass');
session_destroy();
header("Location:/");
}
echo "<div class='title'><center>Выход</center></div><div class='list_item busis'><a href='/?out&ok'>Да, выйти!</a><br><a href='/?'>Нет, отстаться!</a></div>";
include_once 'foot.php';
}
elseif(isset($_GET['cat']))
{
include_once 'cat.php';
}
elseif(isset($_GET['admin']) && isset($user) && $user['status']>=1)
{
if(in_array($_GET['admin'],array('mod','banlist')))include_once 'admin/'.$_GET['admin'].'.php';
else include_once 'admin/index.php';
}
if(!isset($user))
{
if(isset($_GET['auth']))
{
include_once 'auth.php';
}
if(isset($_GET['reg']))
{
include_once 'reg.php';
}
}
echo "<style type='text/css'>
#navis{color: #445988;font-size: small;padding: 4px 2px;background-color: #677fb3;border:1px solid #445988}#navis a:link,#navis a:visited{color: #ffffff;text-decoration: none;font-size: small}#navis a:focus,#navis a:hover,#navis a:active{color: #3b5998;background-color: #fff}
</style>";
$title='Wap блог';
include_once 'h.php';
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `blogs` WHERE `mod` = '0'"),0)!=0 && $user['status']>=2 && isset($user))echo "<div class='linkes'><a class='icolink link' href='?admin=mod'><img src='/images/diaries.png'> Блоги на модерации (".mysql_result(mysql_query("SELECT COUNT(*) FROM `blogs` WHERE `mod` = '0'"), 0).")</a></div>";
$qn=mysql_query("SELECT * FROM `news` WHERE `id` > '0' ORDER BY `id` DESC LIMIT 1");
while($posnt=mysql_fetch_array($qn))
{
echo "<div class='stnd_padd light_blue light_border_bottom'><img src='/images/news_subscribe_7783.png'> ".hsc($posnt['name'])."</div>";
echo "<div class='list_item xot'>".blog_msg($posnt['text'])."...</div><div class='linkes'><a class='icolink link' href='?newid=$posnt[id]'><img src='/images/comment_rss_16_7752.png'> Комментарии (".mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_blog` = '$posnt[id]'".($user['status']==0?" AND `see` = '0'":null).""), 0).")</a></div>";
}
$qqn=mysql_fetch_array(mysql_query("SELECT * FROM `news` WHERE `id` > '0'"),0);
if($qqn==0){echo "<div class='error'>Нет новостей...</div>";}
echo "<div class='stnd_padd light_blue light_border_bottom'><img src='/images/blogs-stack_7150.png'> Новые статьи</div>";
$q=mysql_query("SELECT * FROM `blogs` WHERE `mod` = '1' ORDER BY `time` DESC LIMIT 3");
while($post=mysql_fetch_array($q))
{
echo "<div class='over_users overfl_hid'><a class='' href='/?read=$post[id]'><span>".hsc($post['name'])."</span></a><br>".blog_msg($post['opis'])."...<br><a href='?read=$post[id]&'>Читать всё →</a><br><a href='?read=$post[id]&h'><img src='/images/comments.gif'> Обсудить".(mysql_result(mysql_query("SELECT COUNT(*) FROM `blogs_komm` WHERE `id_blog` = '$post[id]'".($user['status']==0?" AND `see` = '0'":null).""), 0)!=0?" (".mysql_result(mysql_query("SELECT COUNT(*) FROM `blogs_komm` WHERE `id_blog` = '$post[id]'".($user['status']==0?" AND `see` = '0'":null).""), 0).")":null)."</a></div>";
}
$qq=mysql_fetch_array(mysql_query("SELECT * FROM `blogs` WHERE `mod` = '1'"),0);
if($qq==0){echo "<div class='error'>Нет доступных статей...</div>";}
echo "<div class='linkes'><a class='icolink link' href='/?chat'><img src='/images/chat.png'> Чат (".mysql_result(mysql_query("SELECT COUNT(*) FROM `chat`".($user['status']==0?" WHERE `see` = '0'":null).""), 0).")</a></div>";
echo "<div class='linkes'><a class='icolink link' href='/?news'><img src='/images/konqsidebar_news_1221.png'> Новости (".mysql_result(mysql_query("SELECT COUNT(*) FROM `news`"), 0).")</a></div>";
echo "<div class='linkes'><a class='icolink link' href='/?cat'><img src='/images/chart_organisation_3572.png'> Категории (".mysql_result(mysql_query("SELECT COUNT(*) FROM `cat`"), 0).")</a></div>";
echo "<div class='linkes'><a class='icolink link' href='/?users'><img src='/images/users.png'> Блогеры (".mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0).")</a></div>";
echo "<div class='linkes'><a class='icolink link' href='/?online'><img src='/images/msn_online_3215.png'> Онлайн (".mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `date_last` > '".(time()-600)."'"), 0).")</a></div>";
echo "<div class='footer'><a href='/' class='icolink link'>© Alekksss</a></div>";
?>
<a href="http://statok.ru/go/1196"><img src="http://statok.ru/image/1196" alt=""/></a>