Файл: 4mast/profmas.ru/index.php
Строк: 108
<?php
require_once('includes/Headers.php');
require_once('includes/PDO_func.php');
H ('Форум Wap мастеров, программистов, дизайнеров, кодеров и администраторов!');
if($us == true) {
echo'<div class="menu2">' . hi($us). '</div>
<a href="/kab" class="link"><div class="block"><img src="'.$img.'" alt="*"/> Личный кабинет</div></a>
<a href="?exit" class="link"> <div class="block"><img src="'.$img.'" alt="*"/> Выход </div></a>';
} else {
echo'<div class="menu2">Меню гостя</div>
<a href="/login/reg" class="link"><div class="block"><img src="'.$img.'" alt="*"/> Регистрация</div></a>
<a href="/login/auth" class="link"> <div class="block"><img src="'.$img.'" alt="*"/> Авторизация </div></a>';
}
$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="menu2"><a href="/news" style="text-decoration:none; color:white;">Новости проекта (' . $c_n . ')</a></div>';
//
echo '<div class="block">';
if (mb_strlen ($news['text']) > 150) {
echo tag (mb_substr ($news['text'], 0, 150)) . '.. <a href="/news">Читать дальше..</a>';
}
else {
echo tag ($news['text']);
}
echo '<br/>';
echo '<span style="color: #6d6d6d;">Добавил: ' . Nick ($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>';
}
//////////////////////////////////////////////////////
if ($us['level'] != 0) {
echo '<a href="/adm/fort.php" class="block"><img src="'.$img.'" alt="*"/> Админ форум (' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `adm_fort`") . '/' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `adm_post`") . '+<font color="red">' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `adm_post` WHERE (`time`>'" . (time()-86400) . "')") . '</font>)</div></a>'; }
// Форум
echo '<div class="menu2"><a href="/forum"style="color:white;"> Форум ( ' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `forum_t`") . ' <font color="green"> +' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `forum_t` WHERE `time`>'" . (time () - 86400) . "'") . '</font> / ' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `forum_p`").' <font color="red">+' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `forum_p` WHERE `time`>'" . (time () - 86400) . "'") . '9</font>)</a></div>';
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 '<a class="block" href="/forum/thema' . $lt['id'] . '/page' . ceil ( $c_p / 10 ) . '"><img src="/images/prikrep.png" alt=""/> ' . $lt['name'] . ' (' . $c_p.') </a>';
}
$query = DB :: $dbs -> query ("SELECT * FROM `forum_t` WHERE `id_pr` != '50' AND `lip_them` = ? ORDER BY `time` DESC LIMIT 6",array(0));
while ($t = $query -> fetch()) {
$c_p = DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `forum_p` WHERE (`id_t`='" . $t['id'] . "')");
echo '<a class="block" href="/forum/thema' . $t['id'] . '/page' . ceil ( $c_p / 10 ) . '"><img src="/images/' . ($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 class="menu2"><a href="/downloads" style="color:white;"> Загруз-центр [' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `down_files` WHERE (`dop`='da')") . '/<font color="red">+' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `down_files` WHERE (`dop`='da') AND (`time`>'" . (time()-86400) . "')") . '</font>]</div></a>';
if (DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `down_files` WHERE (`dop`='da')") != 0) {
$query = DB :: $dbs -> query ("SELECT * FROM `down_files` WHERE (`dop`='da') ORDER BY `id` DESC LIMIT 3");
while ($f = $query -> fetch ()) {
echo '<div class="block">' . fName ($f['id']) . ' (' . sizef ($f['size']) . ')</div>';
}
}
else {
echo '<div class="error">Файлов пока нет..</div>';
}
/*echo '<div class="menu2"><a href="/pages/shop" style="color:white;">Магазин</a> (' . DB::$dbs -> querySingle ("SELECT COUNT(*) FROM `magazin_file`") . '/<font color="red">+' . DB::$dbs->querySingle ("SELECT COUNT(*) FROM `magazin_file` WHERE `time`> ?", [time()-86400]) . '</font>)</div>';
$sql = DB :: $dbs -> query ("SELECT * FROM `magazin_file` ORDER BY `time` DESC LIMIT 3");
if ($sql -> rowCount() >0) {
while($a = $sql-> fetch ()) {
echo '<a href="/pages/shop/file/'.$a['id'].'" class="block"><img src="/images/001_46.png" hight="18" width="18"/> ' .$a['name'] . ' </div></a>';
}
}
else {
echo '<div class="error">Товаров пока нет..</div>';
}
*/
echo '<div class="menu2"><a href="/" style="color:white;">Главное меню</div></a>';
echo '<a href="/modules/works" class="block"><img src="'.$img.'" alt="*"/> Полезное WAP мастеру</a> </div>';
echo '<a href="/pages/blogs" class="block"><img src="'.$img.'" alt="*"/> WM Библиотека [' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `blogs`") . '/<font color="red">+' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `blogs` WHERE (`time`>'" . (time()-86400) . "')") . '</font>] </a></div>';
//echo '<a href="/Viewforum" class="block"><img src="'.$img.'" alt="*"/> Новый форум</div>';
echo '<a href="/guest" class="block"><img src="'.$img.'" alt="*"/> Гостевая (' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `guest`") . '<font color="red">+' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `guest` WHERE (`time`>'" . (time()-86400) . "')") . '</font>)</a></div>';
echo '<a href="/modules/black.php" class="block"><img src="'.$img.'" alt="*"/> Архив мошенников</a> </div>';
echo '<a href="/codes" class="block"><img src="'.$img.'" alt="*"/> Куски PHP кода (' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `codes`") . '<font color="red">+' . DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `codes` WHERE (`time`>'" . (time()-86400) . "')") . '</font>)</a> </div>';
echo '<div class="menu2"><a href="/" style="color:white;">Статистика</div></a>';
echo '<a href="/modules/reits.php" class="block"><img src="'.$img.'" alt="*"/> Достижение мастеров</a> </div>';
echo '<a href="/modules/info.php" class="block"><img src="'.$img.'" alt="*"/> Информация/FAQ</a></div>';
echo '<a href="/modules/stat.php" class="block"><img src="'.$img.'" alt="*"/> Статистика сайта</a> </div>';
$items = DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `us` WHERE (`last`>'" . ( time () - 3600 ) . "')");
echo '<a href="/online.php" class="block"><img src="'.$img.'" alt="*"/> Сейчас на сайте ('.$items.')</a></div>';
if (isset ($us)) {
if (isset ($_GET['exit'])) {
setcookie ('pass', '', time () - 1, '/');
setcookie ('id', '', time () - 1, '/');
header ('location:/');
}
}
echo '<a href="http://funsi.ru/7.go">Каталог бесплатных сайтов!</a>';
require_once('includes/Footers.php');
?>