Файл: public_html/modules/friends/index.php
Строк: 57
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.net *
* ------------------------------- *
* @package: PerfCMS Ultra *
* @year: 2013 *
* @author: wanya26ua & Tesla *
* @link: http://perfclub.ru *
**********************************/
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();
}
$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', NAV.' <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');
?>