]> git.mxchange.org Git - friendica.git/blobdiff - mod/suggest.php
photos-albms widget: add some classes
[friendica.git] / mod / suggest.php
index e07e9331146cd1ec8efa4840de23eeb3763d37dd..b73c2cd1b61eef34a248ff9e507d92b4182f419b 100644 (file)
@@ -36,7 +36,7 @@ function suggest_init(&$a) {
                }
                // Now check how the user responded to the confirmation query
                if(!$_REQUEST['canceled']) {
-                       q("insert into gcign ( uid, gcid ) values ( %d, %d ) ",
+                       q("INSERT INTO `gcign` ( `uid`, `gcid` ) VALUES ( %d, %d ) ",
                                intval(local_user()),
                                intval($_GET['ignore'])
                        );
@@ -61,13 +61,8 @@ function suggest_content(&$a) {
 
        $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
 
-       $a->page['aside'] .= follow_widget();
        $a->page['aside'] .= findpeople_widget();
-
-
-       $o .= replace_macros(get_markup_template("section_title.tpl"),array(
-               '$title' => t('Friend Suggestions')
-       ));
+       $a->page['aside'] .= follow_widget();
 
 
        $r = suggestion_query(local_user());
@@ -77,25 +72,46 @@ function suggest_content(&$a) {
                return $o;
        }
 
-       $tpl = get_markup_template('suggest_friends.tpl');
+       require_once 'include/contact_selectors.php';
 
        foreach($r as $rr) {
 
-               $connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);                      
-
-               $o .= replace_macros($tpl,array(
-                       '$url' => zrl($rr['url']),
-                       '$name' => $rr['name'],
-                       '$photo' => proxy_url($rr['photo']),
-                       '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'],
-                       '$ignid' => $rr['id'],
-                       '$conntxt' => t('Connect'),
-                       '$connlnk' => $connlnk,
-                       '$ignore' => t('Ignore/Hide')
-               ));
+               $connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
+               $ignlnk = $a->get_baseurl() . '/suggest?ignore=' . $rr['id'];
+               $photo_menu = array(array(t("View Profile"), zrl($rr["url"])));
+               $photo_menu[] = array(t("Connect/Follow"), $connlnk);
+               $photo_menu[] = array(t('Ignore/Hide'), $ignlnk);
+               $contact_details = get_contact_details_by_url($rr["url"], local_user());
+
+               $entry = array(
+                       'url' => zrl($rr['url']),
+                       'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
+                       'img_hover' => $rr['url'],
+                       'name' => $rr['name'],
+                       'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB),
+                       'details'       => $contact_details['location'],
+                       'tags'          => $contact_details['keywords'],
+                       'about'         => $contact_details['about'],
+                       'account_type'  => (($contact_details['community']) ? t('Forum') : ''),
+                       'ignlnk' => $ignlnk,
+                       'ignid' => $rr['id'],
+                       'conntxt' => t('Connect'),
+                       'connlnk' => $connlnk,
+                       'photo_menu' => $photo_menu,
+                       'ignore' => t('Ignore/Hide'),
+                       'network' => network_to_name($rr['network'], $rr['url']),
+                       'id' => ++$id,
+               );
+               $entries[] = $entry;
        }
 
-       $o .= cleardiv();
-//     $o .= paginate($a);
+       $tpl = get_markup_template('viewcontact_template.tpl');
+
+       $o .= replace_macros($tpl,array(
+               '$title' => t('Friend Suggestions'),
+               '$contacts' => $entries,
+               
+       ));
+
        return $o;
 }