PageRenderTime 54ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/profile.friends.php

https://bitbucket.org/DESURE/dcms
PHP | 51 lines | 41 code | 10 blank | 0 comment | 8 complexity | 754329881b97f559e793d7c3fb6ebb64 MD5 | raw file
  1. <?php
  2. include_once 'sys/inc/start.php';
  3. $doc = new document(1);
  4. $doc->title = __('??????');
  5. $ank = new user(@$_GET['id']);
  6. if (!$ank->id) {
  7. if (isset($_GET['return'])) {
  8. header('Refresh: 1; url=' . $_GET['return']);
  9. } else {
  10. header('Refresh: 1; url=/');
  11. }
  12. $doc->err(__('??? ??????'));
  13. exit;
  14. }
  15. if (!$ank->is_friend($user) && !$ank->vis_friends) {
  16. if (isset($_GET['return'])) {
  17. header('Refresh: 1; url=' . $_GET['return']);
  18. } else {
  19. header('Refresh: 1; url=/');
  20. }
  21. $doc->err(__('?????? ? ?????? ???????? ?????????'));
  22. exit;
  23. }
  24. $doc->title = __('?????? %s', $ank->login);
  25. $posts = array();
  26. $pages = new pages;
  27. $pages->posts = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `id_user` = '$ank->id' AND `confirm` = '1'"), 0); // ?????????? ??????
  28. $pages->this_page(); // ???????? ??????? ????????
  29. $q = mysql_query("SELECT * FROM `friends` WHERE `id_user` = '$ank->id' AND `confirm` = '1' ORDER BY `time` DESC LIMIT $pages->limit");
  30. $listing = new listing();
  31. while ($friend = mysql_fetch_assoc($q)) {
  32. $fr = new user($friend['id_friend']);
  33. $post = $listing->post();
  34. $post->title = $fr->nick();
  35. $post->url = '/profile.view.php?id=' . $fr->id;
  36. $post->icon($fr->icon());
  37. }
  38. $listing->display(__('? ???????????? "%s" ??? ??? ??????', $ank->login));
  39. $pages->display('?id=' . $ank->id . '&amp;'); // ????? ???????
  40. $doc->ret(__('?????? "%s"', $ank->login), '/profile.view.php?id=' . $ank->id);
  41. ?>