Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.2 KiB

6 years ago
6 years ago
6 years ago
  1. <?php
  2. require_once('include/socgraph.php');
  3. function allfriends_content(&$a) {
  4. $o = '';
  5. if(! local_user()) {
  6. notice( t('Permission denied.') . EOL);
  7. return;
  8. }
  9. if($a->argc > 1)
  10. $cid = intval($a->argv[1]);
  11. if(! $cid)
  12. return;
  13. $c = q("select name, url, photo from contact where id = %d and uid = %d limit 1",
  14. intval($cid),
  15. intval(local_user())
  16. );
  17. $vcard_widget .= replace_macros(get_markup_template("vcard-widget.tpl"),array(
  18. '$name' => $c[0]['name'],
  19. '$photo' => $c[0]['photo'],
  20. 'url' => z_root() . '/contacts/' . $cid
  21. ));
  22. if(! x($a->page,'aside'))
  23. $a->page['aside'] = '';
  24. $a->page['aside'] .= $vcard_widget;
  25. if(! count($c))
  26. return;
  27. $o .= '<h2>' . sprintf( t('Friends of %s'), $c[0]['name']) . '</h2>';
  28. $r = all_friends(local_user(),$cid);
  29. if(! count($r)) {
  30. $o .= t('No friends to display.');
  31. return $o;
  32. }
  33. $tpl = get_markup_template('common_friends.tpl');
  34. foreach($r as $rr) {
  35. $o .= replace_macros($tpl,array(
  36. '$url' => $rr['url'],
  37. '$name' => $rr['name'],
  38. '$photo' => $rr['photo'],
  39. '$tags' => ''
  40. ));
  41. }
  42. $o .= cleardiv();
  43. // $o .= paginate($a);
  44. return $o;
  45. }