<?php

/*
=======================
Dcms-Blog
Автор модификации: Dark_AKC
-----------------------------------------
Контакты
http://darkwm.ru
=======================
*/

include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
user_access('adm_panel_show',null,'/index.php?'.SID);

$set['title']='Статьи ждущие модерацию';
include_once '../../sys/inc/thead.php';
title();
aut(); // форма авторизации



$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `blog` WHERE `mod` = '0'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];

$q=mysql_query("SELECT * FROM `blog` WHERE `mod` = '0' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
if ($k_post==0)
{
echo "  <div class='mess'>\n";
echo "Нет записей\n";
echo "  </div>\n";
}

while ($post = mysql_fetch_assoc($q))
{
$avtor = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '".$post['id_user']."'"));

echo '<div class="mess">';

echo "<img src='/style/icons/dnev.png' alt='*'> ";
echo "<a href='list.php?id=$post[id]'>" . htmlspecialchars($post['name']) . "</a>";
echo " <span style='time'>(".vremja($post['time']).")</span><br>\n";
echo 'Автор: <u> '.$avtor['nick'].'</u><br>';

echo rez_text(htmlspecialchars($post['msg']));

echo "  </div>\n";

}

if (isset($_GET['sort'])) $dop="sort=$_GET[sort]&amp;";
else $dop='';
if ($k_page>1)str('?'.$dop.'',$k_page,$page); // Вывод страниц



include_once '../../sys/inc/tfoot.php';
?>