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