Файл: index.php
Строк: 89
<?php
$title='Главная';include_once 'system/head.php';
#echo'<div class="menu" style="text-align:center;"><b>В данный момент проходит реконструкция</b></div>';
if($user){
if($user['ban']==1){
echo '<div class="head">Бан!</div>Вы забанены!<br/>';
}else{
$ser = mysql_query ("select * from `ads` WHERE `pozic`='Ве' and `srok`>".time()." order by `time` desc");
$kols=mysql_num_rows(mysql_query("SELECT id FROM `ads` WHERE `pozic`='Ве' and `srok`>".time().""));
if($kols>0){
while($fr=mysql_fetch_assoc($ser)){
echo'<div class="menu"><a href="out.php?id='.$fr['id'].'" style="display:block;">'.bb_code($fr['name']);
$ost=$fr['srok']-time();
if($user['level']>0)echo'<br /><small>Осталось: '.date('jдн. h:i:s', $ost).'</small>';
echo'</a></div>';
}
}
echo '<div class="pad">
ID: <b>'.$user['id'].'</b><br />
Ваш баланс: <b>'.$user['balans'].'</b> баллов<br />
</div>';
$new=@mysql_fetch_assoc(mysql_query("select * from `news` order by `id` desc limit 1"));
if($new)echo'<div class="citatka"><b>'.$new['nazv'].'</b> / '.clock($new['time']).'<br/>'.$new['msg'].'</div>';
if($user['level']==1){echo '<div class="pages" style="text-align:center;"><a href="/admin" style="display:block;">Администратор панель</a></div>';}
$bonus = mt_rand(1,25);$razmer = mt_rand(2,20);
if($bonus == '7'){echo'<div class="pad">Вам попался бонус в размере '.$razmer.'</div>';
mysql_query("update `user` set `balans`=$user[balans]+$razmer where `id`='".$user['id']."'");}
echo'<div class="menu">
- <a href="/chat.php">Чат</a> ('.mysql_num_rows(mysql_query('SELECT `id` FROM `chat`')).')<br/>
- <a href="/forum.php">Форум</a> ('.mysql_num_rows(mysql_query('SELECT `id` FROM `themes`')).'/'.mysql_num_rows(mysql_query('SELECT id FROM `posts`')).')<br/>
- <a href="/obmen.php">Файлообменник</a> ('.mysql_num_rows(mysql_query('SELECT `id` FROM `obmen`')).')<br/>
- <a href="/news.php">Новости сайта</a> ('.mysql_num_rows(mysql_query("select `id` from `news`")).')<br />
- <a href="/downloads.php">Загруз-центр</a> ('.mysql_num_rows(mysql_query("select `id` from `files`")).')
</div><div class="menu">
- <a href="profile'.$user['id'].'">Мой профиль</a> (<a href="/profile.php?act=edit">ред.</a>)<br/>
- <a href="/dialog.php">Диалоги</a>';
if(mysql_num_rows(mysql_query("SELECT * FROM `mail` WHERE `komu`='$user[id]' and `status`='1'"))>0)echo ' <font style="background-color:orange;border: 1px solid black;color:black;">Новое</font>';
echo'<br />
- <a href="info.php">Информация</a><br />
- <a href="/shop.php">Магазин</a><br/>
- <a href="/remied.php">Смена пароля</a><br />
- <a href="/exit.php">Выход</a><br />
</div>';
$sero = mysql_query ("select * from `ads` WHERE `pozic`='Ни' and `srok`>".time()." order by `time` desc");
$kolso=mysql_num_rows(mysql_query("SELECT id FROM `ads` WHERE `pozic`='Ни' and `srok`>".time().""));
if($kolso>0){
while($fro=mysql_fetch_assoc($sero)){
echo'<div class="menu"><a href="out.php?id='.$fro['id'].'" style="display:block;text-align:right;">'.bb_code($fro['name']);
$osto=$fro['srok']-time();
if($user['level']>0)echo'<br /><small>Осталось: '.date('jдн. h:i:s', $osto).'</small>';
echo'</a></div>';
}
}
echo'<div class="menu"><a href="/online.php" style="display:block;text-align:center;">В сети:'.mysql_num_rows(mysql_query("select `id` from `user` where `visit`>$time-90")).'</a></div>';
}
}else{
echo'<div class="menu" style="text-align:center;"><a href="/enter.php">Вход</a> | <a href="/rega.php">Регистрация</a></div>';
$new=@mysql_fetch_assoc(mysql_query("select * from `news` order by `id` desc limit 1"));
$kolich=mysql_num_rows(mysql_query("select * from `news`"));
echo'<div class="citatka">';
if($kolich)
echo'<b>'.$new['nazv'].'</b> / '.clock($new['time']).'<br/>'.$new['msg'];
else
echo'Новостей еще нет';
echo'</div><div class="menu">
- <a href="/news.php">Новости сайта</a> ('.mysql_num_rows(mysql_query("select `id` from `news`")).')<br />
- <a href="/downloads.php">Загруз-центр</a> ('.mysql_num_rows(mysql_query("select `id` from `files`")).')<br />
- <a href="/about.php">Что это такое?</a><br />
- <a href="info.php?mod=FAQ">F.A.Q</a><br />
- <a href="info.php?mod=rules">Правила</a><br />
</div>';
echo '<div class="pad" style="text-align:center;">С нами уже - '.mysql_num_rows(mysql_query('SELECT id FROM `user`')).' человек(а)<br />
Из них <a href="/online.php">'.mysql_num_rows(mysql_query("select `id` from `user` where `visit`>$time-90")).' в сети</a></div>';
}
include_once 'system/foot.php';
?>