Файл: index.php
Строк: 97
<?php
/*
#Бесплатный WAP движок StrongCMS
#Официальный сайт поддержки: http://strongcms.ru
*/
# Заголовок>Функции>Шапка
$title = 'Главная';
require_once ('system/function.php');
require_once ('system/header.php');
## Выводим новости
$count_news = mysql_result(mysql_query('select count(`id`) from `news`'),0);
if(!empty($user['news']) != $count_news)
{
echo '<div class="menu">';
echo '<a href="'.$HOME.'/news/">Новости</a> ('.$count_news.')';
echo '</div>';
echo '<div class="news">';
$sql = mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 1");
while($sql1 = mysql_fetch_assoc($sql))
{
echo '<div class="new">';
echo ''.nl2br(smile(bb($sql1['text']))).'<br />
Добавил: '.nick($sql1['avtor']).'<br />
<a href="/news/comment'.$sql1['id'].'">Комментарии:</a> ('.mysql_result(mysql_query('select count(`id`) from `news_com` where `news` = "'.$sql1['id'].'"'),0).')';
if(isset($user['id'])) {
echo '<br /><a href="?news='.$sql1['id'].'">Скрыть новость</a>';}
echo '</div >';
if(isset($_GET['news'])){
$news= trim(intval($_GET['news']));
mysql_query("UPDATE `users` SET `news` = '".$news."' WHERE `id` = '".$user['id']."'");
header('Location: '.$HOME.'');
}}
} else{
echo '<div class="menu">
<a href="'.$HOME.'/news/">Новости</a> ('.$count_news.')</div>';}
echo '</div></div>';
##Выводим меню сайта
echo '<div class="menu">Меню сайта:</div>';
$nf = mysql_result(mysql_query('select count(`id`) from `photo_files` where `time` > "'.(time()-((60*60)*24)).'"'),0);
echo '
<div class="menudiv"><a href="'.$HOME.'/guest" class="k_menu"><img src="/images/gostt.png" alt="Гостевая" title="Гостевая" /> Гостевая ('.mysql_result(mysql_query("SELECT COUNT(id) FROM `guest`"),0).')</div></a>
<div class="menudiv"><a href="'.$HOME.'/lib/" class="k_menu"><img src="/images/biblo.png" alt="*" title="Библиотека" /> Библиотека ('.mysql_result(mysql_query("SELECT COUNT(id) FROM `lib_stat`"),0).')</div></a>
<div class="menudiv"><a href="'.$HOME.'/photo/" class="k_menu"><img src="/images/photos.png" alt="*" title="Фотоальбомы" /> Фотоальбомы ('.mysql_result(mysql_query("SELECT COUNT(id) FROM `photo_album`"),0).'/'.mysql_result(mysql_query("SELECT COUNT(id) FROM `photo_files`"),0).') ' . ($nf > 0 ? '<font color="red"><b>+'.$nf.'</b></font>' : '') . '</div></a>
<div class="menudiv"><a href="'.$HOME.'/chat/" class="k_menu"><img src="/images/chats.png" alt="*" title="Чат" /> Чат ('.mysql_result(mysql_query("SELECT COUNT(id) FROM `chat_post`"),0).')</div></a>
<div class="menudiv"><a href="'.$HOME.'/blog/" class="k_menu"><img src="/images/blogs.png" alt="*" title="Блоги" /> Блоги ('.mysql_result(mysql_query("SELECT COUNT(id) FROM `blog_stat`"),0).')</div></a>
<div class="menudiv"><a href="'.$HOME.'/user.php" class="k_menu"><img src="/images/users.png" alt="Пользователи" title="Пользователи" /> Пользователи ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"),0).')</a></div>
';
##Выводим форум
$t_f = mysql_result(mysql_query('select count(`id`) from `forum_tema`'),0);
$p_f = mysql_result(mysql_query('select count(`id`) from `forum_post`'),0);
$ntf = mysql_result(mysql_query('select count(`id`) from `forum_tema` where `time` > "'.(time()-((60*60)*24)).'"'),0);
$npf = mysql_result(mysql_query('select count(`id`) from `forum_post` where `time` > "'.(time()-((60*60)*24)).'"'),0);
echo '<div class="menu">';
echo '<a href="'.$HOME.'/forum/"> Форум</a> ('.$t_f.' / '.$p_f.')(<font color="red"><b>+'.$ntf.'</b></font> / <font color="green"><b>+'.$npf.'</b></font>)';
echo '</div>';
##последние темы форума
if (!isset($user['id'])){
require_once ('system/new_tem.php');
}else{
if ($user['new_tem']== 0)
require_once ('system/new_tem.php');
}
##Выводим файлы
$df = mysql_result(mysql_query("SELECT COUNT(id) FROM `load_file`"),0);
$ndf = mysql_result(mysql_query('select count(`id`) FROM `load_file` WHERE `time` > "'.(time()-((60*60)*24)).'"'),0);
echo '<div class="menu">';
echo '<a href="'.$HOME.'/down/"> Загрузки ('.$df.' <span style="color: #61b565"><b>+ '.$ndf.'</b></span></a>)';
echo '</div>';
##последние файлы
if (!isset($user['id'])){
require_once ('system/new_files.php');
}else{
if ($user['new_files']== 0)
require_once ('system/new_files.php');
}
##Подключаем низ
require_once ('system/footer.php');
?>