]> git.mxchange.org Git - friendica.git/blobdiff - include/contact_widgets.php
GlobalContact created
[friendica.git] / include / contact_widgets.php
index d47cf86c358868b9192f0a98d48652002d65dd9a..efb258ecaea215856b4056fe07140c9e8f592d62 100644 (file)
@@ -5,6 +5,7 @@ use Friendica\Core\System;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Database\DBM;
+use Friendica\Model\GlobalContact;
 
 require_once 'include/contact_selectors.php';
 
@@ -248,31 +249,28 @@ function common_friends_visitor_widget($profile_uid) {
                return;
        }
 
-       require_once 'include/socgraph.php';
-
        if ($cid) {
-               $t = count_common_friends($profile_uid, $cid);
+               $t = GlobalContact::countCommonFriends($profile_uid, $cid);
        } else {
-               $t = count_common_friends_zcid($profile_uid, $zcid);
+               $t = GlobalContact::countCommonFriendsZcid($profile_uid, $zcid);
        }
        if (! $t) {
                return;
        }
 
        if ($cid) {
-               $r = common_friends($profile_uid, $cid, 0, 5, true);
+               $r = GlobalContact::commonFriends($profile_uid, $cid, 0, 5, true);
        } else {
-               $r = common_friends_zcid($profile_uid, $zcid, 0, 5, true);
+               $r = GlobalContact::commonFriendsZcid($profile_uid, $zcid, 0, 5, true);
        }
 
        return replace_macros(get_markup_template('remote_friends_common.tpl'), array(
-               '$desc' =>  sprintf( tt("%d contact in common", "%d contacts in common", $t), $t),
+               '$desc' =>  sprintf(tt("%d contact in common", "%d contacts in common", $t), $t),
                '$base' => System::baseUrl(),
                '$uid' => $profile_uid,
                '$cid' => (($cid) ? $cid : '0'),
                '$linkmore' => (($t > 5) ? 'true' : ''),
                '$more' => t('show more'),
-               '$items' => $r
-       ));
-
-};
+               '$items' => $r)
+       );
+}