]> git.mxchange.org Git - friendica.git/blobdiff - mod/suggest.php
Merge pull request #2905 from annando/1611-performance-again
[friendica.git] / mod / suggest.php
index 8f5f4f6a128b05cd20afea3083dc169ead318e5e..4399450eccf2a1330882886d10e9923bc820e383 100644 (file)
@@ -3,7 +3,7 @@
 require_once('include/socgraph.php');
 require_once('include/contact_widgets.php');
 
-if(! function_exists('suggest_init')) {
+
 function suggest_init(&$a) {
        if(! local_user())
                return;
@@ -42,13 +42,13 @@ function suggest_init(&$a) {
                        );
                }
        }
+
 }
-}
 
 
 
 
-if(! function_exists('suggest_content')) {
+
 function suggest_content(&$a) {
 
        require_once("mod/proxy.php");
@@ -78,21 +78,24 @@ function suggest_content(&$a) {
 
                $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());
+               $photo_menu = array(
+                       'profile' => array(t("View Profile"), zrl($rr["url"])),
+                       'follow' => array(t("Connect/Follow"), $connlnk),
+                       'hide' => array(t('Ignore/Hide'), $ignlnk)
+               );
+
+               $contact_details = get_contact_details_by_url($rr["url"], local_user(), $rr);
 
                $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),
+                       'name' => $contact_details['name'],
+                       'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB),
                        'details'       => $contact_details['location'],
                        'tags'          => $contact_details['keywords'],
                        'about'         => $contact_details['about'],
-                       'account_type'  => (($contact_details['community']) ? t('Forum') : ''),
+                       'account_type'  => account_type($contact_details),
                        'ignlnk' => $ignlnk,
                        'ignid' => $rr['id'],
                        'conntxt' => t('Connect'),
@@ -110,9 +113,7 @@ function suggest_content(&$a) {
        $o .= replace_macros($tpl,array(
                '$title' => t('Friend Suggestions'),
                '$contacts' => $entries,
-
        ));
 
        return $o;
 }
-}