Размер файла: 5.15Kb
<?php
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";
include_once"distribution/db.php";
include_once"distribution/fnc.php";
$id = (int)$_GET['id_blog'];
$blog_kel = mysql_fetch_array(mysql_query("SELECT * FROM `directly_blogs` WHERE `id` = '".$id."'"));
if (trim($blog_kel)){
echo '<img src="../images/img/messages.gif" alt=""> <b>Комментарии ('.$blog_kel['name_blog_categories'].')</b><br><br>';
if($provpar==md5($_SESSION['par']) && $provlog==$_SESSION['log']) {
if (isset($_POST['new_comm'])){
if (iconv_strlen($_POST['new_comment'],'UTF-8') > 5){
if (iconv_strlen($_POST['new_comment'],'UTF-8') < 5000){
mysql_query("INSERT INTO `blog_comments` SET
`id_bloge_comment` = '".$id."',
`time_comment` = '".$sitetime."',
`author_comment` = '".$log."',
`text_comment` = '".check($_POST['new_comment'])."'");
header ("Location: comments.php?id_blog=".$id.""); die();
}else{ echo '<div align="center"><font color="#FF0000"><b>Слишком большой комментарий!</b></font><br></div>';}
}else{ echo '<div align="center"><font color="#FF0000"><b>Слишком маленький комментарий!</b></font><br></div>';}}
echo '<div><form action="comments.php?id_blog='.$id.'" method="post">';
echo '<b>Сообщение:</b><br><textarea cols="25" rows="3" name="new_comment"></textarea>';
echo '<br><input name="new_comm" type="submit" value="Написать"></form></div><hr>';
}else{ echo '<br><div><img src="images/err.gif" alt=""> Посетители, находящиеся в группе Гости, не могут оставлять комментарии.</div><br>';}
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `blog_comments` WHERE `id_bloge_comment` = '".$id."'"),0);
$start = isset($_GET['start']) ? abs((int)$_GET['start']) : 0;
if($start > $total) $start = 0;
if ($total < $start + config_navig_comm) $end = $total;
else $end = $start + $config_navig_comm;
$blog_ver = mysql_query("SELECT * FROM `blog_comments` WHERE `id_bloge_comment` = '".$id."' ORDER BY `id` DESC LIMIT $start,$config_navig_comm");
if (mysql_num_rows($blog_ver)){
while($blog_comm = mysql_fetch_array($blog_ver)){
echo'<div class=b> ';
$ava = file("../local/profil/".$blog_comm['author_comment'].".prof");
$avv = explode(":||:",$ava[0]);
if(!empty($udata[45])){
if($avv[43]!="" && $avv[43]!="noavatar.gif"){
echo'<img src="../'.$avv[43].'" alt=""> ';}else{
echo'<img src="../images/avators/noavatar.gif" alt=""> '; }
}else{echo'<img src="../images/img/edit.gif" alt=""> ';}
echo '<a href="../pages/anketa.php?uz='.$blog_comm['author_comment'].'"><b>'.nickname($blog_comm['author_comment']).'</b></a> ';
echo user_online($blog_comm['author_comment']).'<small> ('.date_fixed($blog_comm['time_comment']).')</small>';
if($provpar==md5($_SESSION['par']) && $provlog==$_SESSION['log']) {
if ($dostup==101 || $dostup==102 || $dostup==103 || $dostup==105){
echo ' <a href="index.php?do=del_comm&id_comm='.$blog_comm['id'].'&id_bloge='.$id.'"><font color="#FF0000">[Del]</font></a>';}}
echo '</div><div>'.smiles(bb_code(nl2_br($blog_comm['text_comment']))).'</div>';}
}else{ echo '<br><div><b>Комментариев еще нет!</b></div><br>';}
if ($total > $config_navig_comm){
echo '<div class="b">';
if ($start != 0){
echo '<a href="comments.php?id_blog='.$id.'&start='.($start - $config_navig_comm).'"><-Назад</a> ';
}else{ echo '<-Назад';}
echo ' | ';
if ($total > $start + $config_navig_comm){
echo ' <a href="comments.php?id_blog='.$id.'&start='.($start + $config_navig_comm).'">Далее-></a>';
}else{ echo 'Далее->';}
if($total>0){
$ba = ceil($total/$config_navig_comm);
$ba2 = $ba*$onpage-$config_navig_comm;
echo '<br/>Страницы:';
$asd = $start-($config_navig_comm*3);
$asd2 = $start+($config_navig_comm*4);
if($asd<$total && $asd>0) echo ' <a href="comments.php?id_blog='.$id.'&start=0">1</a> ... ';
for($i=$asd; $i<$asd2;){
if($i<$total && $i>=0){
$ii = floor(1+$i/$config_navig_comm);
if ($start==$i) echo ' <b>['.$ii.']</b>';
else echo ' <a href="comments.php?id_blog='.$id.'&start='.$i.'">'.$ii.'</a>';}
$i=$i+$config_navig_comm;}
if($asd2<$total) echo ' ... <a href="comments.php?id_blog='.$id.'&start='.$ba2.'">'.$ba.'</a>';}
echo '</div>';}else{echo '<hr>';}
echo '<div><img src="../images/img/reload.gif" alt=""> <a href="index.php?do=blog&id_blog_category='.$id.'">Назад</a><br>';
}else{ echo '<br><div><img src="images/err.gif" alt=""> Такого блога не существует!</div><br><hr><div>';}
echo '<img src="../images/img/back.gif" alt=""> <a href="index.php?'.SID.'">В блоги</a><br>';
echo '<img src="../images/img/homepage.gif" alt=""> <a href="../index.php?'.SID.'">На главную</a></div>';
include_once"../themes/$config_themes/foot.php";
?>