use Friendica\App;
use Friendica\Core\System;
+use Friendica\Core\Worker;
+use Friendica\Database\DBM;
+use Friendica\Model\GlobalContact;
use Friendica\Network\Probe;
+use Friendica\Object\Contact;
require_once 'include/Contact.php';
-require_once 'include/socgraph.php';
require_once 'include/contact_selectors.php';
-require_once 'include/probe.php';
require_once 'mod/proxy.php';
require_once 'include/Photo.php';
intval(local_user()),
intval($contact_id)
);
- if (! dbm::is_result($r)) {
+ if (! DBM::is_result($r)) {
$contact_id = 0;
}
}
intval($profile_id),
intval(local_user())
);
- if (! dbm::is_result($r)) {
+ if (! DBM::is_result($r)) {
notice( t('Could not locate selected profile.') . EOL);
return;
}
intval($contact_id),
intval(local_user())
);
- if($r && dbm::is_result($r))
+ if($r && DBM::is_result($r))
$a->data['contact'] = $r[0];
return;
intval($contact_id));
} else
// pull feed and consume it, which should subscribe to the hub.
- proc_run(PRIORITY_HIGH, "include/onepoll.php", $contact_id, "force");
+ Worker::add(PRIORITY_HIGH, "OnePoll", $contact_id, "force");
}
function _contact_update_profile($contact_id) {
update_contact_avatar($data['photo'], local_user(), $contact_id, true);
// Update the entry in the gcontact table
- update_gcontact_from_probe($data["url"]);
+ GlobalContact::updateFromProbe($data["url"]);
}
function _contact_block($contact_id, $orig_record) {
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
intval($a->user['uid'])
);
- if (!dbm::is_result($r)) {
+ if (!DBM::is_result($r)) {
return;
}
$nettype = sprintf( t('Network type: %s'),network_to_name($contact['network'], $contact["url"]));
- //$common = count_common_friends(local_user(),$contact['id']);
+ //$common = GlobalContact::countCommonFriends(local_user(),$contact['id']);
//$common_text = (($common) ? sprintf( tt('%d contact in common','%d contacts in common', $common),$common) : '');
$polling = (($contact['network'] === NETWORK_MAIL | $contact['network'] === NETWORK_FEED) ? 'polling' : '');
- //$x = count_all_friends(local_user(), $contact['id']);
+ //$x = GlobalContact::countAllFriends(local_user(), $contact['id']);
//$all_friends = (($x) ? t('View all contacts') : '');
// tabs
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ",
intval($_SESSION['uid']));
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$a->set_pager_total($r[0]['total']);
$total = $r[0]['total'];
}
$contacts = array();
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
foreach ($r as $rr) {
$contacts[] = _contact_detail_for_template($rr);
}
'url' => "contacts/".$contact_id,
'sel' => (($active_tab == 2)?'active':''),
'title' => t('Profile Details'),
- 'id' => 'status-tab',
+ 'id' => 'profile-tab',
'accesskey' => 'o',
)
);
// Show this tab only if there is visible friend list
- $x = count_all_friends(local_user(), $contact_id);
+ $x = GlobalContact::countAllFriends(local_user(), $contact_id);
if ($x)
$tabs[] = array('label'=>t('Contacts'),
'url' => "allfriends/".$contact_id,
'accesskey' => 't');
// Show this tab only if there is visible common friend list
- $common = count_common_friends(local_user(),$contact_id);
+ $common = GlobalContact::countCommonFriends(local_user(), $contact_id);
if ($common)
$tabs[] = array('label'=>t('Common Friends'),
'url' => "common/loc/".local_user()."/".$contact_id,