Файл: _modules/friends/index.php
Строк: 42
<?php
# mark core v1.0
# author Drk in
# date 24.10.19
# core
require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );
# user
system::access(true);
# meta
$title = 'Друзья :: '.domain;
# get
$s = isset( $_GET['s'] ) ? system::check($_GET['s']): null;
# head
require_once ( head );
echo '
<div style="margin: 5px;">
<div class="grid fights-link">
<div class="six columns ln">
<a href="/friends">Друзья</a>
</div>
<div class="six columns">
<a href="/friends/request">Заявки</a>
</div>
</div>
</div>'.system::dis().'';
$cn = DB :: $dbh -> querySingle("SELECT count(id) FROM friends WHERE user = ?;", array($user['id']));
if ($cn == 0)echo '<div class="dialog"><h1 class="pda">КПК</h1><p>› Cписок друзей пуст<br></p></div>';
$page = new page($cn);
$limit = $cn > $page -> elements ? $page -> limit : null;
$query = DB :: $dbh -> query("SELECT id FROM friends WHERE user = ? ORDER BY id {$limit}", array($user['id']));
while ($act = $query -> fetch()):
$act = cache_friends::get($act['id']);
$data = cache_user::get($act['data']);
echo '
<div class="fights-link" style="margin: 5px;">
<a href="/id/'.$data['id'].'" style="padding: 5px;">
<div style="padding-right: 7px;float: left;margin-top: 5px;">
'.user::min_ava($data['ava']).'
</div>
<div style="overflow: hidden;">
<h1 class="chat">'.user::mail($data['id']).'</h1></div>
<span style="font-size: 10px;">
Уровень: <font color="#82e42b">'.$data['lvl'].'</font> <br> Опыт <font color="#82e42b">'.$data['exp'].'</font>
</span>
</a></div>
';
endwhile;
$page -> get('?');
echo '<div class="line"></div>';
# foot
require_once ( foot );
?>