Файл: public_html/status/index.php
Строк: 66
<?
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';
$set['title']='Список статусов';
include_once '../sys/inc/thead.php';
title();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `status`"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo "<div class='gend'>Последние статусы :</div>";
if ($k_post==0)
{
echo "<div class='mess'>n";
echo "Нет статусовn";
echo "</div>n";
}
//////////////// удаление статуса ////////////
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `status` WHERE `id` = '".intval($_GET['id'])."'"),0)==1)
{
$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `status` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
if (isset($user) && ($user['level']>$ank['level']) || $post['id_user']==$user['id'])
mysql_query("DELETE FROM `status` WHERE `id` = '$post[id]'");
mysql_query("DELETE FROM `status_komm` WHERE `id_status` = '$post[id]'");
mysql_query("DELETE FROM `status_like` WHERE `id_status` = '$post[id]'");
$_SESSION['message'] = 'Статус упешно удален';
header("Location: index.php?id=$ank[id]");
exit;
}
//////////////// удаление статуса ////////////
////
$q=mysql_query("SELECT * FROM `status` ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q))
{
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
echo '<div class="' . ($num % 2 ? "nav1" : "nav2") . '">';
$num++;
echo "" . group($ank['id']) . " <a href='/info.php?id=$ank[id]'>$ank[nick] ".online($ank['id'])."</a>".vremja($post['time'])."<br/>";
echo '<div class="st_1"></div>';
echo '<div class="st_2">';
echo output_text($post['msg']);
echo "</div>";
echo "<a href='/user/status/komm.php?id=$post[id]'><img src='/style/icons/bbl4.png' alt=''/> Обсуждения </a>(" . mysql_result(mysql_query("SELECT COUNT(*) FROM `status_komm` WHERE `id_status` = '$post[id]'"),0) . ") ";
if (isset($user) && ($user['level']>1))
echo " [<a href="delete.php?id=$post[id]"><img src='/style/icons/delete.gif' alt=''/> удл</a>]n";
echo '</div>';
}
if ($k_page>1)str('?',$k_page,$page);
include_once '../sys/inc/tfoot.php';
?>