function user_remove($uid) {
if(! $uid)
return;
- $a = get_app();
logger('Removing user: ' . $uid);
$r = q("select * from user where uid = %d limit 1", intval($uid));
if($uid == local_user()) {
unset($_SESSION['authenticated']);
unset($_SESSION['uid']);
- goaway($a->get_baseurl());
+ goaway(App::get_baseurl());
}
}
$r = q("select uid from contact where id = %d limit 1",
intval($id)
);
- if((! count($r)) || (! intval($r[0]['uid'])))
+ if((! dbm::is_result($r)) || (! intval($r[0]['uid'])))
return;
$archive = get_pconfig($r[0]['uid'], 'system','archive_removed_contacts');
function terminate_friendship($user,$self,$contact) {
-
$a = get_app();
require_once('include/datetime.php');
FROM `gcontact` WHERE `nurl` = '%s'",
dbesc(normalise_link($url)));
- if ($r) {
+ if (dbm::is_result($r)) {
// If there is more than one entry we filter out the connector networks
if (count($r) > 1) {
foreach ($r AS $id => $result) {
$sparkle = false;
if ($contact['network'] === NETWORK_DFRN) {
$sparkle = true;
- $profile_link = $a->get_baseurl() . '/redir/' . $contact['id'];
+ $profile_link = App::get_baseurl() . '/redir/' . $contact['id'];
} else {
$profile_link = $contact['url'];
}
}
if (in_array($contact['network'], array(NETWORK_DFRN, NETWORK_DIASPORA))) {
- $pm_url = $a->get_baseurl() . '/message/new/' . $contact['id'];
+ $pm_url = App::get_baseurl() . '/message/new/' . $contact['id'];
}
if ($contact['network'] == NETWORK_DFRN) {
- $poke_link = $a->get_baseurl() . '/poke/?f=&c=' . $contact['id'];
+ $poke_link = App::get_baseurl() . '/poke/?f=&c=' . $contact['id'];
}
- $contact_url = $a->get_baseurl() . '/contacts/' . $contact['id'];
+ $contact_url = App::get_baseurl() . '/contacts/' . $contact['id'];
- $posts_link = $a->get_baseurl() . '/contacts/' . $contact['id'] . '/posts';
- $contact_drop_link = $a->get_baseurl() . '/contacts/' . $contact['id'] . '/drop?confirm=1';
+ $posts_link = App::get_baseurl() . '/contacts/' . $contact['id'] . '/posts';
+ $contact_drop_link = App::get_baseurl() . '/contacts/' . $contact['id'] . '/drop?confirm=1';
/**
* menu array:
ORDER BY rand() LIMIT 1",
dbesc(NETWORK_DFRN));
- if(count($r))
+ if (dbm::is_result($r))
return dirname($r[0]['url']);
return '';
}