]> git.mxchange.org Git - friendica.git/blob - mod/suggest.php
Add missing $nav_sel in class App
[friendica.git] / mod / suggest.php
1 <?php
2
3 require_once('include/socgraph.php');
4 require_once('include/contact_widgets.php');
5
6
7 function suggest_init(&$a) {
8         if(! local_user())
9                 return;
10
11         if(x($_GET,'ignore') && intval($_GET['ignore'])) {
12                 q("insert into gcign ( uid, gcid ) values ( %d, %d ) ",
13                         intval(local_user()),
14                         intval($_GET['ignore'])
15                 );
16         }
17
18 }
19                 
20
21
22
23
24 function suggest_content(&$a) {
25
26         $o = '';
27         if(! local_user()) {
28                 notice( t('Permission denied.') . EOL);
29                 return;
30         }
31
32         $a->page['aside'] .= follow_widget();
33         $a->page['aside'] .= findpeople_widget();
34
35
36         $o .= '<h2>' . t('Friend Suggestions') . '</h2>';
37
38
39         $r = suggestion_query(local_user());
40
41         if(! count($r)) {
42                 $o .= t('No suggestions. This works best when you have more than one contact/friend.');
43                 return $o;
44         }
45
46         $tpl = get_markup_template('suggest_friends.tpl');
47
48         foreach($r as $rr) {
49                         
50                 $o .= replace_macros($tpl,array(
51                         '$url' => $rr['url'],
52                         '$name' => $rr['name'],
53                         '$photo' => $rr['photo'],
54                         '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'],
55                         '$ignore' => t('Ignore/Hide')
56                 ));
57         }
58
59         $o .= cleardiv();
60 //      $o .= paginate($a);
61         return $o;
62 }