Файл: world-faces.ru/world-faces.ru/user_status/index.php
Строк: 48
<?
include_once '../i.php';
pdo();
only_reg();
$set['title']='Статусы Обитателей';
verh();
if (isset($us)){
aut();
$k_post=DB::$dbs->querySingle("SELECT COUNT(*) FROM `status_user`");
$k_my=DB::$dbs->querySingle("SELECT COUNT(*) FROM `status_user` where `id_user` = ?",array($us['id']));
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo '<div class="prof"><b>Все статусы</b> | <a href="alls.php?id='.$user['id'].'">Мои статусы</a> ('.$k_my.')</div>';
if ($k_post==0)
{
echo "Нет статусовn";
}
$q=DB::$dbs->query("SELECT * FROM `status_user` ORDER BY id DESC LIMIT $start, $set[p_str]");
while ($post = $q ->Fetch()){
$ank=DB::$dbs->QueryFetch("SELECT * FROM `user` WHERE `id` = ? limit 1", array($post['id_user']));
echo "<div class='menu'>";
if (isset($_GET['delete'])){
if ($user['level']>=3){
$id=intval($_GET['id']);
DB::$dbs->query("DELETE FROM `status_user` WHERE `id` = ? LIMIT 1",array(intval($_GET['id'])));
header ('location: index.php');
}
}
if(isset($_GET['vote'])){
if (DB::$dbs->querySingle("SELECT COUNT(*) FROM `status_vote` WHERE `id_status` = ? AND `id_user` = ? LIMIT 1",array(intval($_GET['id']),$us['id']))!=0){header("location: index.php");
}else{
DB::$dbs->Query("INSERT INTO `status_vote` SET `id_user` = ?,`time` = ?,`id_status` = ?",array($user['id'],$time,intval($_GET['id'])));
$status=DB::$dbs->queryFetch("SELECT * FROM `status_user` where `id`= ? limit 1",array(intval($_GET['id'])));
if($us['id']!==$status['id_user']){
$timer = intval($_SERVER['REQUEST_TIME']);
$msb='Обитателю [b][url=/'.$us['id'].']'.$us['nick'].'[/url][/b] понравился [url=/user_status/komm.php?id='.intval($_GET['id']).']ваш статус[/url]:<br/>[b]'.$status['msg'].'[/b]';
DB::$dbs->query("INSERT INTO `op` SET `id_us` = ?,`msg` = ?,`type` = ?,`time` = ?",array($status['id_user'], $msb, 2,$timer));
}
header("location: index.php");
}
}
echo "".foto($ank['id'])." ";
echo "<a href='/info.php?id=$ank[id]'><span style="color:$ank[ncolor]">$ank[nick]</span></a> (".vremja($post['time']).")n";
if (isset($user) && ($user['level']>$ank['level'] || $user['level']>=3))
echo '[<a href="index.php?id='.$post['id'].'&delete"><b>x</b></a>]';
echo'<br>';
echo '<span style="color:'.$ank['color'].'">';
echo output_text($post['msg'])." <a href='komm.php?id=$post[id]'>[".DB::$dbs->querySingle("SELECT COUNT(*) FROM `status_komm1` WHERE `id_status` = ?",array($post['id']))."]<img src='/sys/inc/komm.png' alt''></a> <a href='index.php?id=$post[id]&vote'>[".DB::$dbs->querySingle("SELECT COUNT(*) FROM `status_vote` WHERE `id_status` = ?",array($post['id']))."]<img src='/user_status/bbl3.png' alt''></a>n";
echo "</span>n";
echo'</div>';
}
if ($k_page>1)str('?',$k_page,$page);
}
niz();
?>