Файл: blog.php
Строк: 21
<?php
require_once('core/start.php');
$latname = secur($_GET['latname']);
$arr = core::$dbs->queryFetch("SELECT * FROM `blog` WHERE `latname` = ? LIMIT 1",array($latname));
if(empty($arr['latname'])){
header('location:/');
die();
}
$title = stripslashes($arr['name']);
require_once(root.'core/header.php');
echo ' <div class="ot4">'.$title.'</div>';
if($user['level']>=1){
echo '<div class="block">[<a href="/admin.html?do=red_zapis&id='.$arr['id'].'">ред.</a> / <a href="/admin.html?do=del_zapis&id='.$arr['id'].'">удалить</a>]</div>';
}
core::$dbs->query("UPDATE `blog` SET `chit` = `chit` + ? WHERE `id` = ?",array(1,$arr['id']));
echo '<div class="block">'.out($arr['text']).'</div>';
echo '<div class="block">» Автор: '.us($arr['user_id']).' / '.times($arr['time']).'<br />» Просмотров: '.$arr['chit'].'<br />» <a href="/comment/'.$arr['id'].'">Мнения</a> ['.core::$dbs->querySingle("SELECT COUNT(id) from `comments` where `blog` = ?",array($arr['id'])).']</div>';
if(!empty($arr['tags'])){
$record = explode(",", $arr['tags']);
$num = count($record);
$max = round(($num/10)+0.45);
echo '<div class="block">';
echo '<b>Теги:</b><br/>';
for($i=0;$i<$num;$i++){
$z++;
$adr = $record[$i];
if($z>0) $zp = ', ';
else
$zp = '';
echo '<a href="/other/search.php?msg='.$adr.'">'.$adr.'</a>'.$zp;
}
echo '</div>';
}
require_once(root.'core/footer.php');
?>