mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
GlobalContact created
Moved DirSearch and GlobalContact related functions to Friendica\Model namespace
This commit is contained in:
parent
5f25ef55d2
commit
47db624105
26 changed files with 2715 additions and 2610 deletions
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue