/profile.friends.php
PHP | 51 lines | 41 code | 10 blank | 0 comment | 8 complexity | 754329881b97f559e793d7c3fb6ebb64 MD5 | raw file
- <?php
- include_once 'sys/inc/start.php';
- $doc = new document(1);
- $doc->title = __('??????');
- $ank = new user(@$_GET['id']);
- if (!$ank->id) {
- if (isset($_GET['return'])) {
- header('Refresh: 1; url=' . $_GET['return']);
- } else {
- header('Refresh: 1; url=/');
- }
- $doc->err(__('??? ??????'));
- exit;
- }
- if (!$ank->is_friend($user) && !$ank->vis_friends) {
- if (isset($_GET['return'])) {
- header('Refresh: 1; url=' . $_GET['return']);
- } else {
- header('Refresh: 1; url=/');
- }
- $doc->err(__('?????? ? ?????? ???????? ?????????'));
- exit;
- }
- $doc->title = __('?????? %s', $ank->login);
- $posts = array();
- $pages = new pages;
- $pages->posts = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `id_user` = '$ank->id' AND `confirm` = '1'"), 0); // ?????????? ??????
- $pages->this_page(); // ???????? ??????? ????????
- $q = mysql_query("SELECT * FROM `friends` WHERE `id_user` = '$ank->id' AND `confirm` = '1' ORDER BY `time` DESC LIMIT $pages->limit");
- $listing = new listing();
- while ($friend = mysql_fetch_assoc($q)) {
- $fr = new user($friend['id_friend']);
- $post = $listing->post();
- $post->title = $fr->nick();
- $post->url = '/profile.view.php?id=' . $fr->id;
- $post->icon($fr->icon());
- }
- $listing->display(__('? ???????????? "%s" ??? ??? ??????', $ank->login));
- $pages->display('?id=' . $ank->id . '&'); // ????? ???????
- $doc->ret(__('?????? "%s"', $ank->login), '/profile.view.php?id=' . $ank->id);
- ?>