Файл: modules/friends/index.php
Строк: 57
<?php
if(!isset($user)) {
header('location: /');
exit;
}
if($db->query("SELECT * FROM `friends` WHERE `friend_id` = '". $user['id'] ."' AND `active` = '1'")->rowCount() != 0)
{
$friends_r = $db->query("SELECT * FROM `friends` WHERE `friend_id` = '". $user['id'] ."' AND `active` = '1'")->rowCount();
}
$locate = 'in_friends';
$title = $lang->word('friends');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('friends').' ['.$db->query("SELECT * FROM `friends` WHERE `friend_id` = '". $user['id'] ."' AND `active` = '1'")->rowCount().']');
$pages = new Paginator($friends_r, $ames);
if($friends_r == 0)
{
$tpl->div('menu', $lang->word('friends_no'));
}
else
{
if( $db->query("SELECT * FROM `friends` WHERE `friend_id` = '". $user['id'] ."' AND `active` = '1'")->rowCount() !=0)
{
$friends_q = $db->query("SELECT * FROM `friends` WHERE `friend_id` = '". $user['id'] ."' AND `active` = '1' ORDER BY friend_id DESC LIMIT $start, $ames");
}
while($friends = $friends_q->fetch())
{
$friend_id = $friends['user_id'];
echo '<div class="menu">
'.nick($friend_id).' [<a href="/friends/delete/'.$friends['id'].'">x</a>]
</div>';
}
$pages->view('/friends/?');
}
$tpl->div('block', img('add_friend.png') .' <a href="/friends/requests">'.$lang->word('friends_requests').'</a> ['.$db->query("SELECT * FROM `friends` WHERE `friend_id` = '". $user['id'] ."' AND `active` = '0'")->rowCount().']<br/> '
. NAV . ' <a href="/user/panel/">'.$lang->word('user_panel').'</a><br/> '
. HICO. ' <a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
?>