<?
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';


include_once '../sys/inc/thead.php';

echo "<div class=\"rowup\">\n";
echo "<a href=\"/forum\">Форум</a> / Мои сообщения<br />\n";
echo "</div>\n";
aut(); // форма авторизации


$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p`  WHERE `id_user` = '$user[id]'"),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 `forum_p` WHERE `id_user` = '$user[id]' ORDER BY `time` DESC  LIMIT $start, $set[p_str]");
if (mysql_num_rows($q)==0) {
echo "Вы еще ни разу не писали в форуме<br/>\n";
}

while ($them = mysql_fetch_array($q))
{

$forum=mysql_fetch_array(mysql_query("SELECT * FROM `forum_f` WHERE `id` = '$them[id_forum]' LIMIT 1"));
$razdel=mysql_fetch_array(mysql_query("SELECT * FROM `forum_r` WHERE `id` = '$them[id_razdel]' LIMIT 1"));
$them1=mysql_fetch_array(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '$them[id_them]' LIMIT 1"));


if($num==1){ 
echo "<div class='str'>"; 
$num=0;
}else{ 
echo "<div class='menu'>"; 
$num=1;}
echo "<img src='/img/razd.gif' alt='' /> ";
echo "$them[msg] (".vremja($them['time']).")<br/>\n";
echo "</div>"; 

}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц


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