]> git.mxchange.org Git - friendica.git/blob - mod/allfriends.php
add remove_user hook (it looks like dreamhost changed all my file permissions, this...
[friendica.git] / mod / allfriends.php
1 <?php
2
3 require_once('include/socgraph.php');
4
5 function allfriends_content(&$a) {
6
7         $o = '';
8         if(! local_user()) {
9                 notice( t('Permission denied.') . EOL);
10                 return;
11         }
12
13         if($a->argc > 1)
14                 $cid = intval($a->argv[1]);
15         if(! $cid)
16                 return;
17
18         $c = q("select name, url, photo from contact where id = %d and uid = %d limit 1",
19                 intval($cid),
20                 intval(local_user())
21         );
22
23         $a->page['aside'] .= '<div class="vcard">' 
24                 . '<div class="fn label">' . $c[0]['name'] . '</div>' 
25                 . '<div id="profile-photo-wrapper">'
26                 . '<a href="/contacts/' . $cid . '"><img class="photo" width="175" height="175" 
27                 src="' . $c[0]['photo'] . '" alt="' . $c[0]['name'] . '" /></div>'
28                 . '</div>';
29         
30
31         if(! count($c))
32                 return;
33
34         $o .= '<h2>' . sprintf( t('Friends of %s'), $c[0]['name']) . '</h2>';
35
36
37         $r = all_friends(local_user(),$cid);
38
39         if(! count($r)) {
40                 $o .= t('No friends to display.');
41                 return $o;
42         }
43
44         $tpl = get_markup_template('common_friends.tpl');
45
46         foreach($r as $rr) {
47                         
48                 $o .= replace_macros($tpl,array(
49                         '$url' => $rr['url'],
50                         '$name' => $rr['name'],
51                         '$photo' => $rr['photo'],
52                         '$tags' => ''
53                 ));
54         }
55
56         $o .= cleardiv();
57 //      $o .= paginate($a);
58         return $o;
59 }