Файл: forum_php/index.php
Строк: 65
<?php
include 'system/sys.php';
include 'system/funcs.php';
H ('IT-MOBI.RU | Мобильный форум решений и проблем');
// Новости
$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="news"><div class="neew">';
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></div>';
}
// Форум
echo '<div class="menu2"><a style="text-decoration:none; color:white;">Последние темы</a></div>';
echo '<div class="ram">';
if (DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `forum_t`") != 0) {
$lep = DB :: $dbs -> query ("SELECT * FROM `forum_t` WHERE `lip_them` = ? AND `lip_time` > ? ORDER BY `lip_time` DESC LIMIT 5",array(1,time()));
while ($lt = $lep -> fetch()) {
$c_p = DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `forum_p` WHERE `id_t`= ? ",array($lt['id']));
echo '<div class="raz"><a href="/forum/thema' . $lt['id'] . '/page' . ceil ( $c_p / 10 ) . '"><img src="/design/prikrep.png" alt=""/> ' . $lt['name'] . ' (' . $c_p.') </a></div>';
}
$query = DB :: $dbs -> query ("SELECT * FROM `forum_t` WHERE `id_pr` != '50' AND `lip_them` = ? ORDER BY `time` DESC LIMIT 5",array(0));
while ($t = $query -> fetch()) {
$c_p = DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `forum_p` WHERE (`id_t`='" . $t['id'] . "')");
echo '<div class="raz"><a href="/forum/thema' . $t['id'] . '/page' . ceil ( $c_p / 10 ) . '"><img src="/design/' . ($t['top']==1? 'prikrep' : ($t['type']==0 ? 'closed' : 'the')) . '.png" alt=""/> ' . $t['name'] . ' ('.$c_p.')</a></div> ';
}
}
else {
echo '<div class="block">Тем пока нет..</div>';
}
echo '</div>';
echo '<div class="raz"> <img src="/design/set.png" alt="" align="middle"/> <a href="/billing"><font color="red">Биллинг-панель</font></a></div></div>';
// Вывод активистов
echo '<div class="menu2"><a style="text-decoration:none; color:white;">Активисты форума</a></div>';
include 'forums/activ.php';
// Вывод категорий
include 'form2/fraz.php';
if (isset ($us)) {
//
if (isset ($_GET['exit'])) {
setcookie ('pass', '', time () - 1, '/');
setcookie ('id', '', time () - 1, '/');
header ('location:/');
}
if ($us['level'] != 0) {
echo '<div class="raz"> <img src="/design/set.png" alt="" align="middle"/> <a href="/adm"><font color="red">Админ-панель</font></a></div></div>';
}
}
echo '</div>';
F ();