Файл: index.php
Строк: 63
<?php
include 'system/sys.php';
include 'system/funcs.php';
H ('Осторожно! Территория WAP мастера!');
// Новости
$c_n = DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `news`");
if ($c_n !=0) {
$news = DB :: $dbs -> queryFetch ("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 1");
//
echo '<div class="menu"><a href="/news" style="text-decoration:none; color:white;">Новости проекта (' . $c_n . ')</a></div>';
//
echo '<div class="list1">';
if (mb_strlen ($news['text']) > 150) {
echo bb (mb_substr ($news['text'], 0, 150)) . '.. <a href="/news">Читать дальше..</a>';
}
else {
echo bb ($news['text']);
}
echo '<br/>';
echo '<span style="color: #6d6d6d;">Добавил: ' . uNick ($news['us']) . ' (' . datef ($news['t']) . ')</span><br/>';
// display link from comments
echo '<a href="/komm' . $news['id'] . '">Комментарии</a>: (' . DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `news_komm` WHERE (`id_news`='" . $news['id'] . "')") . ')';
echo '</div>';
}
//
$t = mktime (0, 0, 0, 01, 01, 2015);
echo '<div class="lst">';
// ёлочка =)
echo '<img src="/images/tree.png" alt=""/><br/>';
if (time () < $t) {
echo 'До нового года осталось ' . timef ( $t - time () );
}
if (date ('Y') == 2015 && date ('m') == 01 && date ('d') < 15) {
echo 'Поздравляем всех с новым годом!<br/>';
}
echo '</div>';
// Форум
echo '<div class="menu2"><a href="/forum.php" style="text-decoration:none; color:white;">Форум</a> (' . DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `forum_t` " . (isset ($us) ? ($us['level']>0 ? '' : 'WHERE (`type`!='2')') : 'WHERE (`type`!='2')')) . '/' . DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `forum_p` " . (isset ($us) ? ($us['level']>0 ? '' : 'WHERE (`del`='0')' ) : 'WHERE (`del`='0')')) . ') (<font color="green">+' . DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `forum_t` WHERE `time`>'" . (time () - 86400) . "' " . (isset ($us) ? ($us['level']>0 ? 'AND (`type`!='2')' : '') : 'AND (`type`!='2')')) . '</font>/<font color="red">+' . DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `forum_p` WHERE `time`>'" . (time () - 86400) . "' " . (isset ($us) ? ($us['level']>0 ? '' : 'AND (`del`='0')') : 'AND (`del`='0')')) . '</font>)</div>';
echo '<div class="ram">';
if (DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `forum_t` " . (isset ($us) ? ($us['level']>0 ? '' : 'WHERE (`type`!='2')') : 'WHERE (`type`!='2')' )) != 0) {
$query = DB :: $dbs -> query ("SELECT * FROM `forum_t` " . (isset ($us) ? ($us['level']>0 ? '' : 'WHERE (`type`!='2')') : 'WHERE (`type`!='2')' ) . " ORDER BY `time` DESC LIMIT 5");
while ($t = $query -> fetch()) {
//
$c_p = DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `forum_p` WHERE (`id_t`='" . $t['id'] . "') " . (isset ($us) ? ($us['level']>0 ? '' : 'AND (`del`='0')') : 'AND (`del`='0')'));
echo '<div class="raz"><img src="/design/' . ($t['top']==1? 'prikrep' : ($t['type']==0 ? 'closed' : 'the')) . '.png" alt=""/> <a href="/forum/thema' . $t['id'] . '">' . $t['name'] . '</a> (' . $c_p.') <a href="/forum/thema' . $t['id'] . '/page' . ceil ( $c_p / 10 ) . '">>></a></div>';
}
}
else {
echo 'Тем пока нет..';
}
// Загруз-центр
echo '</div>';
echo '<div class="menu2"><a href="/zc" style="color:white;">Загруз-центр</a> (' . DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `zc_f` WHERE (`dop`='da')") . '/<font color="red">+' . DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `zc_f` WHERE (`dop`='da') AND (`time`>'" . (time()-86400) . "')") . '</font>)</div>';
echo '<div class="ram">';
if (DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `zc_f` WHERE (`dop`='da')") != 0) {
$query = DB :: $dbs -> query ("SELECT * FROM `zc_f` WHERE (`dop`='da') ORDER BY `id` DESC LIMIT 3");
while ($f = $query -> fetch ()) {
echo '<div class="raz">' . fName ($f['id']) . ' (' . sizef ($f['size']) . ')</div>';
}
}
else {
echo 'Файлов пока нет..';
}
//
echo '</div>';
//
echo '<div class="menu2">Меню ' . ((isset ($us) ? 'пользователя' : 'гостя')) . '</div>';
echo '<div class="ram">';
if (isset ($us)) {
//
if (isset ($_GET['exit'])) {
setcookie ('pass', '', time () - 1, '/');
setcookie ('id', '', time () - 1, '/');
header ('location:/');
}
echo '<div class="raz"><a href="/kab">Личный кабинет</a></div>';
if ($us['level'] != 0) {
echo '<div class="raz"><a href="/adm"><font color="red">Админ-панель</font></a></div>';
}
echo '<div class="raz"><a href="/?exit">Выход</a></div>';
}
else {
echo '<div class="raz"><a href="/log.in.php">Авторизация</a></div>';
echo '<div class="raz"><a href="/reg.php">Регистрация</a></div>';
echo '<div class="raz"><a href="/remind.php">Восстановление пароля</a></div>';
}
echo '</div>';
F ();