File size: 2.3Kb
- <?php
-
- ###################################################
- # Скрипт портфолио #
- # Версия системы: 1.0 #
- # Автор: RonsoN #
- # ICQ: 7-191-321 #
- # Email: ronson.kharkov@gmail.com #
- ###################################################
-
- $system['page_title'] = 'Добро пожаловать';
- require_once(HOME .'/system/header.php');
-
- $news_n = $db->query("SELECT * FROM `news`")->rowCount();
- $category_n = $db->query("SELECT * FROM `category`")->rowCount();
- $reviews_n = $db->query("SELECT * FROM `reviews`")->rowCount();
- $news_sql = $db->query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 1 ")->fetch();
-
- $category_n = $db->query("SELECT * FROM `category`")->rowCount();
-
- echo '<div class="menu">Последняя новость</div>';
-
- if($news_n != 0 ) {
-
- echo '<div class="main">
- <b>'.$news_sql['title'].'</b> ['.vtime($news_sql['date']).']<br/>'.mb_substr(out($news_sql['text']), 0, 80, 'utf-8').'...</div>
- <div class="main">
- '.NEWS.'<a href="/news/'.$news_sql['id'].'.xhtml">Подробнее</a> | <a href="/news/">Все новости ('.$news_n.')</a>
- </div>';
-
- } else {
-
- echo '<div class="main"><div class="error">Новостей нет!</div></div>';
-
- }
-
- echo '<div class="menu">Категории</div>';
-
- if($category_n != 0 ) {
-
- $category_sql = $db->query("SELECT * FROM `category` ORDER BY `id` ASC");
-
- while($cats = $category_sql->fetch()) {
-
-
-
- echo '<div class="main">'.CAT.'<a href="/category/'.$cats['id'].'.xhtml">'.$cats['title'].'</a> ('.$db->query("SELECT * FROM `works` WHERE `id_category` = '".$cats['id']."' ")->rowCount().')<br/>'.$cats['text'].'</div>';
-
- }
-
- } else {
-
- echo '<div class="main"><div class="error">Категорий нет!</div></div>';
-
- }
-
-
- echo '<div class="menu">Меню</div>
- <div class="main">
- <a href="/news/">Новости</a> ('.$news_n.')<br/>
- <a href="/reviews/">Отзывы</a> ('.$reviews_n.')<br/>
- <a href="/pages/profile.xhtml">Обо мне</a><br/>
- <a href="/pages/contacts.xhtml">Контактная информация</a>
- </div>';
-
-
- if(isset($user)) {
-
- echo '<div class="main"><a href="/panel/">Админ-панель</a></div>';
-
- }
-
-
-
-
- require_once(HOME .'/system/footer.php');
-
- ?>