Файл: modules/user/friends.php
Строк: 64
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
$id = num($_GET['id']);
if(!isset($_GET['id']) || User::profile('time', $id) == false)
{
redirect('/pages/not_found');
}
$friends_r = $db->query("SELECT * FROM `friends` WHERE (`friend_id` = '". $id ."' OR `user_id` = '". $id ."') AND `active` = '1'")->rowCount();
$title = _t('friends');
include_header($title);
$tpl->div('title', _t('friends').' ('.$friends_r.')');
$pages = new Paginator($friends_r, $ames);
if($friends_r == 0)
{
$tpl->div('menu', _t('friends_no'));
}
else
{
$friends_q = $db->query("SELECT * FROM `friends` WHERE (`friend_id` = '". $id ."' OR `user_id` = '". $id ."') AND `active` = '1' ORDER BY friend_id DESC LIMIT $start, $ames");
while($friends = $friends_q->fetch())
{
if($friends['user_id'] == $id)
{
$friend_id = $friends['friend_id'];
}
else
{
$friend_id = $friends['user_id'];
}
echo '<div class="post">
'.nick($friend_id).'
</div>';
}
$pages->view();
}
$tpl->div('block',
NAV .' <a href="/user/friends_online/'.$id.'">'._t('friends_online').'</a><br/> '
. NAV .' <a href="/user/profile/'.$id.'">'._t('back').'</a><br/> '
. NAV . ' <a href="/user/list/">'._t('users').'</a><br/> '
. HICO. ' <a href="/">'. _t('home') .'</a>');
include_footer();
?>