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.
 
 
 
 
 
 

71 lines
1.8 KiB

  1. <?php
  2. require_once('include/Contact.php');
  3. require_once('include/socgraph.php');
  4. require_once('include/contact_selectors.php');
  5. function nogroup_init(&$a) {
  6. if(! local_user())
  7. return;
  8. require_once('include/group.php');
  9. require_once('include/contact_widgets.php');
  10. if(! x($a->page,'aside'))
  11. $a->page['aside'] = '';
  12. $a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id);
  13. }
  14. function nogroup_content(&$a) {
  15. if(! local_user()) {
  16. notice( t('Permission denied.') . EOL);
  17. return '';
  18. }
  19. require_once('include/Contact.php');
  20. $r = contacts_not_grouped(local_user());
  21. if(count($r)) {
  22. $a->set_pager_total($r[0]['total']);
  23. }
  24. $r = contacts_not_grouped(local_user(),$a->pager['start'],$a->pager['itemspage']);
  25. if(count($r)) {
  26. foreach($r as $rr) {
  27. $contact_details = get_contact_details_by_url($rr['url'], local_user());
  28. $contacts[] = array(
  29. 'img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
  30. 'edit_hover' => t('Edit contact'),
  31. 'photo_menu' => contact_photo_menu($rr),
  32. 'id' => $rr['id'],
  33. 'alt_text' => $alt_text,
  34. 'dir_icon' => $dir_icon,
  35. 'thumb' => $rr['thumb'],
  36. 'name' => $rr['name'],
  37. 'username' => $rr['name'],
  38. 'details' => $contact_details['location'],
  39. 'tags' => $contact_details['keywords'],
  40. 'about' => $contact_details['about'],
  41. 'sparkle' => $sparkle,
  42. 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
  43. 'url' => $url,
  44. 'network' => network_to_name($rr['network'], $url),
  45. );
  46. }
  47. }
  48. $tpl = get_markup_template("nogroup-template.tpl");
  49. $o .= replace_macros($tpl, array(
  50. '$header' => t('Contacts who are not members of a group'),
  51. '$contacts' => $contacts,
  52. '$paginate' => paginate($a),
  53. ));
  54. return $o;
  55. }