use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
-use Friendica\Database\DBM;
+use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Group;
$contact = null;
if ((($a->argc == 2) && intval($a->argv[1])) || (($a->argc == 3) && intval($a->argv[1]) && ($a->argv[2] == "posts"))) {
$contact_id = intval($a->argv[1]);
- $contact = dba::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
+ $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
}
- if (DBM::is_result($contact)) {
+ if (DBA::is_result($contact)) {
if ($contact['self']) {
if (($a->argc == 3) && intval($a->argv[1]) && ($a->argv[2] == "posts")) {
goaway('profile/' . $contact['nick']);
return;
}
- if (!dba::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) {
+ if (!DBA::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) {
notice(L10n::t('Could not access contact record.') . EOL);
goaway('contacts');
return; // NOTREACHED
$profile_id = intval($_POST['profile-assign']);
if ($profile_id) {
- if (!dba::exists('profile', ['id' => $profile_id, 'uid' => local_user()])) {
+ if (!DBA::exists('profile', ['id' => $profile_id, 'uid' => local_user()])) {
notice(L10n::t('Could not locate selected profile.') . EOL);
return;
}
intval($contact_id),
intval(local_user())
);
- if (DBM::is_result($r)) {
+ if (DBA::is_result($r)) {
info(L10n::t('Contact updated.') . EOL);
} else {
notice(L10n::t('Failed to update contact record.') . EOL);
}
- $contact = dba::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
- if (DBM::is_result($contact)) {
+ $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
+ if (DBA::is_result($contact)) {
$a->data['contact'] = $contact;
}
function _contact_update($contact_id)
{
- $contact = dba::selectFirst('contact', ['uid', 'url', 'network'], ['id' => $contact_id, 'uid' => local_user()]);
- if (!DBM::is_result($contact)) {
+ $contact = DBA::selectFirst('contact', ['uid', 'url', 'network'], ['id' => $contact_id, 'uid' => local_user()]);
+ if (!DBA::is_result($contact)) {
return;
}
function _contact_update_profile($contact_id)
{
- $contact = dba::selectFirst('contact', ['uid', 'url', 'network'], ['id' => $contact_id, 'uid' => local_user()]);
- if (!DBM::is_result($contact)) {
+ $contact = DBA::selectFirst('contact', ['uid', 'url', 'network'], ['id' => $contact_id, 'uid' => local_user()]);
+ if (!DBA::is_result($contact)) {
return;
}
intval($contact_id),
intval(local_user())
);
- return DBM::is_result($r);
+ return DBA::is_result($r);
}
function _contact_ignore($contact_id, $orig_record)
intval($contact_id),
intval(local_user())
);
- return DBM::is_result($r);
+ return DBA::is_result($r);
}
function _contact_archive($contact_id, $orig_record)
intval($contact_id),
intval(local_user())
);
- return DBM::is_result($r);
+ return DBA::is_result($r);
}
function _contact_drop($orig_record)
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
intval($a->user['uid'])
);
- if (!DBM::is_result($r)) {
+ if (!DBA::is_result($r)) {
return;
}
$cmd = $a->argv[2];
- $orig_record = dba::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'self' => false]);
- if (!DBM::is_result($orig_record)) {
+ $orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'self' => false]);
+ if (!DBA::is_result($orig_record)) {
notice(L10n::t('Could not access contact record.') . EOL);
goaway('contacts');
return; // NOTREACHED
WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ",
intval($_SESSION['uid'])
);
- if (DBM::is_result($r)) {
+ if (DBA::is_result($r)) {
$a->set_pager_total($r[0]['total']);
$total = $r[0]['total'];
}
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
- if (DBM::is_result($r)) {
+ if (DBA::is_result($r)) {
foreach ($r as $rr) {
$contacts[] = _contact_detail_for_template($rr);
}
{
$o = contacts_tab($a, $contact_id, 1);
- $contact = dba::selectFirst('contact', ['url'], ['id' => $contact_id]);
- if (DBM::is_result($contact)) {
+ $contact = DBA::selectFirst('contact', ['url'], ['id' => $contact_id]);
+ if (DBA::is_result($contact)) {
$a->page['aside'] = "";
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
$o .= Contact::getPostsFromUrl($contact["url"]);