Размер файла: 1.89Kb
<?php
include_once('./system/config.php');
$sys['title'] = 'Главная';
include_once('./system/head.php');
error($err);
echo '<div class="title">Последние записи</div>';
$c_note = mysql_result(mysql_query("SELECT COUNT(*) FROM `note`"), 0);
$sql_note = mysql_query("SELECT * FROM `note` ORDER BY `id` DESC LIMIT 2 ");
if ($c_note != 0) {
while ($note = mysql_fetch_assoc($sql_note)) {
$cat = mysql_fetch_assoc(mysql_query("SELECT * FROM `cat` WHERE `id` = '".$note['id_cat']."'"));
echo '<div class="content2">
<a href="http://'.txt($_SERVER['HTTP_HOST']).'/notes/'.trans($note['title']).'-'.$note['id'].'.xhtml">'.$note['title'].'</a><br/>
'.mb_substr(out($note['note']), 0, 500, 'utf-8').'...<hr />
<a href="http://'.txt($_SERVER['HTTP_HOST']).'/notes/'.trans($note['title']).'-'.$note['id'].'.xhtml">Подробнее...</a> | Категория: <a href="http://'.txt($_SERVER['HTTP_HOST']).'/category-'.$cat['id'].'.xhtml"> '.$cat['title'].'</a>
</div>';
}
} else {
echo '<div class="content2">Записей нет!</div>';
}
echo '<div class="title">Меню</div>
<div class="content">
» <a href="http://'.txt($_SERVER['HTTP_HOST']).'/all_notes.xhtml">Все записи</a> ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `note`"), 0).')<br/>
» <a href="http://'.txt($_SERVER['HTTP_HOST']).'/all_category.xhtml">Все категории</a> ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `cat`"), 0).')<br/>
» <a href="http://'.txt($_SERVER['HTTP_HOST']).'/agreement.xhtml">Соглашение</a><br/>
» <a href="http://'.txt($_SERVER['HTTP_HOST']).'/me.xhtml">Обо мне</a><br/>
» <a href="http://'.txt($_SERVER['HTTP_HOST']).'/statistics.xhtml">Статистика</a>
</div>';
if($user) {
echo '<div class="content2"><a href="http://'.txt($_SERVER['HTTP_HOST']).'/admin/">Админ-панель</a></div>';
}
include_once('./system/foot.php');
?>