File size: 2.16Kb
<?php
include_once('./system/config.php');
$note = mysql_fetch_assoc(mysql_query("SELECT * FROM `note` WHERE `id` = '".int($_GET['id'])."'"));
$sys['title'] = ''.$note['title'].'';
include_once('./system/head.php');
if(!$note) {
echo '<div class="error">Ошибка ! Такой записи нет !</div>';
include_once('./system/foot.php');
exit;
}
$cat = mysql_fetch_assoc(mysql_query("SELECT * FROM `cat` WHERE `id` = '".$note['id_cat']."'"));
mysql_query("UPDATE `note` SET `look` = `look`+1 WHERE `id` = ' ".int($_GET['id'])." ' ");
$note_comm = mysql_result(mysql_query("SELECT COUNT(*) FROM `comment` WHERE `id_note` = '".$note['id']."'"), 0);
echo '<div class="title">'.$note['title'].'</div>
<div class="content">'.out($note['note']).'</div>
<div class="title">Статистика:</div>
<div class="content">
Просмотров: '.$note['look'].'<br/>
Дата публикации: '.vtime($note['date']).'<br/>
Категория: <a href="http://'.txt($_SERVER['HTTP_HOST']).'/category-'.$cat['id'].'.xhtml">'.$cat['title'].'</a><br/>
<a href="http://'.txt($_SERVER['HTTP_HOST']).'/comment-'.$note['id'].'.xhtml">Комментарии: '.$note_comm.'</a>
</div>
<div class="title">Скопировать:</div>
<div class="content">
Ссылка:<br/>
<input name="bb" size="15" value="http://'.txt($_SERVER['HTTP_HOST']).'/notes/'.trans($note['title']).'-'.$note['id'].'.xhtml"/><br/>
bb код:<br/>
<input name="bb" size="15" value="[url=http://'.txt($_SERVER['HTTP_HOST']).'/notes/'.trans($note['title']).'-'.$note['id'].'.xhtml]'.$note['title'].' [/url]"/><br/>
HTML код:<br/>
<input name="html" size="15" value="<a href="http://'.txt($_SERVER['HTTP_HOST']).'/notes/'.trans($note['title']).'-'.$note['id'].'.xhtml">'.$note['title'].'</a>" /><br/>
</div>';
if($user) {
echo '<div class="content2">
<a href="http://'.txt($_SERVER['HTTP_HOST']).'/admin/w_note.php?act=edit&id='.$note['id'].'">Изменить запись</a><br/>
<a href="http://'.txt($_SERVER['HTTP_HOST']).'/admin/w_note.php?act=del&id='.$note['id'].'">Удалить запись</a>
</div>';
}
include_once('./system/foot.php');
?>