Rename DBA::is_result to DBA::isResult

This commit is contained in:
Hypolite Petovan 2018-07-21 08:46:04 -04:00 committed by Hypolite Petovan
parent 0ec44f3e8a
commit ecea7425f8
152 changed files with 765 additions and 765 deletions

View file

@ -234,7 +234,7 @@ function api_login(App $a)
}
}
if (!DBA::is_result($record)) {
if (!DBA::isResult($record)) {
logger('API_login failure: ' . print_r($_SERVER, true), LOGGER_DEBUG);
header('WWW-Authenticate: Basic realm="Friendica"');
//header('HTTP/1.0 401 Unauthorized');
@ -500,7 +500,7 @@ function api_unique_id_to_nurl($id)
{
$r = DBA::selectFirst('contact', ['nurl'], ['id' => $id]);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return $r["nurl"];
} else {
return false;
@ -630,14 +630,14 @@ function api_get_user(App $a, $contact_id = null)
}
// if the contact wasn't found, fetch it from the contacts with uid = 0
if (!DBA::is_result($uinfo)) {
if (!DBA::isResult($uinfo)) {
$r = [];
if ($url != "") {
$r = q("SELECT * FROM `contact` WHERE `uid` = 0 AND `nurl` = '%s' LIMIT 1", dbesc(normalise_link($url)));
}
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$network_name = ContactSelector::networkToName($r[0]['network'], $r[0]['url']);
// If no nick where given, extract it from the address
@ -1183,7 +1183,7 @@ function api_statuses_update($type)
intval(requestdata('media_ids')),
api_user()
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$phototypes = Image::supportedTypes();
$ext = $phototypes[$r[0]['type']];
$_REQUEST['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $r[0]['nickname'] . '/image/' . $r[0]['resource-id'] . ']';
@ -1279,7 +1279,7 @@ function api_status_show($type)
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]];
$lastwall = Item::selectFirst(Item::ITEM_FIELDLIST, $condition, ['order' => ['id' => true]]);
if (DBA::is_result($lastwall)) {
if (DBA::isResult($lastwall)) {
$in_reply_to = api_in_reply_to($lastwall);
$converted = api_convert_item($lastwall);
@ -1364,7 +1364,7 @@ function api_users_show($type)
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'private' => false];
$lastwall = Item::selectFirst(Item::ITEM_FIELDLIST, $condition, ['order' => ['id' => true]]);
if (DBA::is_result($lastwall)) {
if (DBA::isResult($lastwall)) {
$in_reply_to = api_in_reply_to($lastwall);
$converted = api_convert_item($lastwall);
@ -1439,11 +1439,11 @@ function api_users_search($type)
if (x($_GET, 'q')) {
$r = q("SELECT id FROM `contact` WHERE `uid` = 0 AND `name` = '%s'", dbesc($_GET["q"]));
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$r = q("SELECT `id` FROM `contact` WHERE `uid` = 0 AND `nick` = '%s'", dbesc($_GET["q"]));
}
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$k = 0;
foreach ($r as $user) {
$user_info = api_get_user($a, $user["id"]);
@ -1823,12 +1823,12 @@ function api_statuses_show($type)
// try to fetch the item for the local user - or the public item, if there is no local one
$uri_item = Item::selectFirst(['uri'], ['id' => $id]);
if (!DBA::is_result($uri_item)) {
if (!DBA::isResult($uri_item)) {
throw new BadRequestException("There is no status with this id.");
}
$item = Item::selectFirst(['id'], ['uri' => $uri_item['uri'], 'uid' => [0, api_user()]], ['order' => ['uid' => true]]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
throw new BadRequestException("There is no status with this id.");
}
@ -1845,7 +1845,7 @@ function api_statuses_show($type)
$statuses = Item::selectForUser(api_user(), [], $condition, $params);
/// @TODO How about copying this to above methods which don't check $r ?
if (!DBA::is_result($statuses)) {
if (!DBA::isResult($statuses)) {
throw new BadRequestException("There is no status with this id.");
}
@ -1903,12 +1903,12 @@ function api_conversation_show($type)
// try to fetch the item for the local user - or the public item, if there is no local one
$item = Item::selectFirst(['parent-uri'], ['id' => $id]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
throw new BadRequestException("There is no status with this id.");
}
$parent = Item::selectFirst(['id'], ['uri' => $item['parent-uri'], 'uid' => [0, api_user()]], ['order' => ['uid' => true]]);
if (!DBA::is_result($parent)) {
if (!DBA::isResult($parent)) {
throw new BadRequestException("There is no status with this id.");
}
@ -1925,7 +1925,7 @@ function api_conversation_show($type)
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
$statuses = Item::selectForUser(api_user(), [], $condition, $params);
if (!DBA::is_result($statuses)) {
if (!DBA::isResult($statuses)) {
throw new BadRequestException("There is no status with id $id.");
}
@ -1975,7 +1975,7 @@ function api_statuses_repeat($type)
$fields = ['body', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
$item = Item::selectFirst($fields, ['id' => $id, 'private' => false]);
if (DBA::is_result($item) && $item['body'] != "") {
if (DBA::isResult($item) && $item['body'] != "") {
if (strpos($item['body'], "[/share]") !== false) {
$pos = strpos($item['body'], "[share");
$post = substr($item['body'], $pos);
@ -2225,7 +2225,7 @@ function api_favorites_create_destroy($type)
$item = Item::selectFirstForUser(api_user(), [], ['id' => $itemid, 'uid' => api_user()]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
throw new BadRequestException("Invalid item.");
}
@ -3409,7 +3409,7 @@ function api_ff_ids($type)
WHERE `contact`.`uid` = %s AND NOT `contact`.`self`",
intval(api_user())
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
return;
}
@ -3485,7 +3485,7 @@ function api_direct_messages_new($type)
dbesc($_POST['screen_name'])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
// Selecting the id by priority, friendica first
api_best_nickname($r);
@ -3589,7 +3589,7 @@ function api_direct_messages_destroy($type)
);
// error message if specified id is not in database
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
if ($verbose == "true") {
$answer = ['result' => 'error', 'message' => 'message id not in database'];
return api_format_data("direct_messages_delete", $type, ['$result' => $answer]);
@ -3694,7 +3694,7 @@ function api_direct_messages_box($type, $box, $verbose)
intval($start),
intval($count)
);
if ($verbose == "true" && !DBA::is_result($r)) {
if ($verbose == "true" && !DBA::isResult($r)) {
$answer = ['result' => 'error', 'message' => 'no mails available'];
return api_format_data("direct_messages_all", $type, ['$result' => $answer]);
}
@ -3849,7 +3849,7 @@ function api_fr_photoalbum_delete($type)
intval(api_user()),
dbesc($album)
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
throw new BadRequestException("album not available");
}
@ -3859,7 +3859,7 @@ function api_fr_photoalbum_delete($type)
$condition = ['uid' => local_user(), 'resource-id' => $rr['resource-id'], 'type' => 'photo'];
$photo_item = Item::selectFirstForUser(local_user(), ['id'], $condition);
if (!DBA::is_result($photo_item)) {
if (!DBA::isResult($photo_item)) {
throw new InternalServerErrorException("problem with deleting items occured");
}
Item::deleteForUser(['id' => $photo_item['id']], api_user());
@ -3939,7 +3939,7 @@ function api_fr_photos_list($type)
'image/gif' => 'gif'
];
$data = ['photo'=>[]];
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
foreach ($r as $rr) {
$photo = [];
$photo['id'] = $rr['resource-id'];
@ -4011,7 +4011,7 @@ function api_fr_photo_create_update($type)
dbesc($photo_id),
dbesc($album)
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
throw new BadRequestException("photo not available");
}
}
@ -4134,7 +4134,7 @@ function api_fr_photo_delete($type)
intval(api_user()),
dbesc($photo_id)
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
throw new BadRequestException("photo not available");
}
// now we can perform on the deletion of the photo
@ -4146,7 +4146,7 @@ function api_fr_photo_delete($type)
$condition = ['uid' => local_user(), 'resource-id' => $photo_id, 'type' => 'photo'];
$photo_item = Item::selectFirstForUser(local_user(), ['id'], $condition);
if (!DBA::is_result($photo_item)) {
if (!DBA::isResult($photo_item)) {
throw new InternalServerErrorException("problem with deleting items occured");
}
// function for setting the items to "deleted = 1" which ensures that comments, likes etc. are not shown anymore
@ -4213,7 +4213,7 @@ function api_account_update_profile_image($type)
if ($profile_id != 0) {
$profile = DBA::selectFirst('profile', ['is-default'], ['uid' => api_user(), 'id' => $profile_id]);
// error message if specified profile id is not in database
if (!DBA::is_result($profile)) {
if (!DBA::isResult($profile)) {
throw new BadRequestException("profile_id not available");
}
$is_default_profile = $profile['is-default'];
@ -4345,7 +4345,7 @@ function check_acl_input($acl_string)
intval($cid),
intval(api_user())
);
$contact_not_found |= !DBA::is_result($contact);
$contact_not_found |= !DBA::isResult($contact);
}
return $contact_not_found;
}
@ -4607,7 +4607,7 @@ function prepare_photo_data($type, $scale, $photo_id)
];
// prepare output data for photo
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$data = ['photo' => $r[0]];
$data['photo']['id'] = $data['photo']['resource-id'];
if ($scale !== false) {
@ -4702,7 +4702,7 @@ function api_friendica_remoteauth()
$contact = DBA::selectFirst('contact', [], ['uid' => api_user(), 'nurl' => $c_url]);
if (!DBA::is_result($contact) || ($contact['network'] !== NETWORK_DFRN)) {
if (!DBA::isResult($contact) || ($contact['network'] !== NETWORK_DFRN)) {
throw new BadRequestException("Unknown contact");
}
@ -4853,7 +4853,7 @@ function api_get_nick($profile)
dbesc(normalise_link($profile))
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$nick = $r[0]["nick"];
}
@ -4863,7 +4863,7 @@ function api_get_nick($profile)
dbesc(normalise_link($profile))
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$nick = $r[0]["nick"];
}
}
@ -4938,7 +4938,7 @@ function api_in_reply_to($item)
if (($item['thr-parent'] != $item['uri']) && (intval($item['parent']) != intval($item['id']))) {
$parent = Item::selectFirst(['id'], ['uid' => $item['uid'], 'uri' => $item['thr-parent']]);
if (DBA::is_result($parent)) {
if (DBA::isResult($parent)) {
$in_reply_to['status_id'] = intval($parent['id']);
} else {
$in_reply_to['status_id'] = intval($item['parent']);
@ -4949,7 +4949,7 @@ function api_in_reply_to($item)
$fields = ['author-nick', 'author-name', 'author-id', 'author-link'];
$parent = Item::selectFirst($fields, ['id' => $in_reply_to['status_id']]);
if (DBA::is_result($parent)) {
if (DBA::isResult($parent)) {
if ($parent['author-nick'] == "") {
$parent['author-nick'] = api_get_nick($parent['author-link']);
}
@ -5126,7 +5126,7 @@ function api_friendica_group_show($type)
intval($gid)
);
// error message if specified gid is not in database
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
throw new BadRequestException("gid not available");
}
} else {
@ -5196,7 +5196,7 @@ function api_friendica_group_delete($type)
intval($gid)
);
// error message if specified gid is not in database
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
throw new BadRequestException('gid not available');
}
@ -5208,7 +5208,7 @@ function api_friendica_group_delete($type)
dbesc($name)
);
// error message if specified gid is not in database
if (!DBA::is_result($rname)) {
if (!DBA::isResult($rname)) {
throw new BadRequestException('wrong group name');
}
@ -5293,7 +5293,7 @@ function group_create($name, $uid, $users = [])
dbesc($name)
);
// error message if specified group name already exists
if (DBA::is_result($rname)) {
if (DBA::isResult($rname)) {
throw new BadRequestException('group name already exists');
}
@ -5304,7 +5304,7 @@ function group_create($name, $uid, $users = [])
dbesc($name)
);
// error message if specified group name already exists
if (DBA::is_result($rname)) {
if (DBA::isResult($rname)) {
$reactivate_group = true;
}
@ -5635,7 +5635,7 @@ function api_friendica_notification_seen($type)
if ($note['otype']=='item') {
// would be really better with an ItemsManager and $im->getByID() :-P
$item = Item::selectFirstForUser(api_user(), [], ['id' => $note['iid'], 'uid' => api_user()]);
if (DBA::is_result($$item)) {
if (DBA::isResult($$item)) {
// we found the item, return it to the user
$ret = api_format_items([$item], $user_info, false, $type);
$data = ['status' => $ret];
@ -5734,7 +5734,7 @@ function api_friendica_direct_messages_search($type, $box = "")
$profile_url = $user_info["url"];
// message if nothing was found
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$success = ['success' => false, 'search_results' => 'problem with query'];
} elseif (count($r) == 0) {
$success = ['success' => false, 'search_results' => 'nothing found'];
@ -5792,7 +5792,7 @@ function api_friendica_profile_show($type)
);
// error message if specified gid is not in database
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
throw new BadRequestException("profile_id not available");
}
} else {

View file

@ -135,7 +135,7 @@ function localize_item(&$item)
$fields = ['author-link', 'author-name', 'verb', 'object-type', 'resource-id', 'body', 'plink'];
$obj = Item::selectFirst($fields, ['uri' => $item['parent-uri']]);
if (!DBA::is_result($obj)) {
if (!DBA::isResult($obj)) {
return;
}
@ -266,7 +266,7 @@ function localize_item(&$item)
$fields = ['author-id', 'author-link', 'author-name', 'author-network',
'verb', 'object-type', 'resource-id', 'body', 'plink'];
$obj = Item::selectFirst($fields, ['uri' => $item['parent-uri']]);
if (!DBA::is_result($obj)) {
if (!DBA::isResult($obj)) {
return;
}
@ -321,7 +321,7 @@ function localize_item(&$item)
if (strlen($obj->id)) {
$fields = ['author-link', 'author-name', 'plink'];
$target = Item::selectFirst($fields, ['uri' => $obj->id, 'uid' => $item['uid']]);
if (DBA::is_result($target) && $target['plink']) {
if (DBA::isResult($target) && $target['plink']) {
$Bname = $target['author-name'];
$Blink = $target['author-link'];
$A = '[url=' . Contact::magicLink($Alink) . ']' . $Aname . '[/url]';
@ -829,7 +829,7 @@ function item_photo_menu($item) {
$rel = 0;
$condition = ['uid' => local_user(), 'nurl' => normalise_link($item['author-link'])];
$contact = DBA::selectFirst('contact', ['id', 'network', 'rel'], $condition);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
$cid = $contact['id'];
$network = $contact['network'];
$rel = $contact['rel'];

View file

@ -53,7 +53,7 @@ function notification($params)
['uid' => $params['uid']]);
// There is no need to create notifications for forum accounts
if (!DBA::is_result($user) || in_array($user["page-flags"], [PAGE_COMMUNITY, PAGE_PRVGROUP])) {
if (!DBA::isResult($user) || in_array($user["page-flags"], [PAGE_COMMUNITY, PAGE_PRVGROUP])) {
return;
}
}
@ -107,7 +107,7 @@ function notification($params)
if ($params['type'] == NOTIFY_COMMENT) {
$thread = DBA::selectFirst('thread', ['ignored'], ['iid' => $parent_id]);
if (DBA::is_result($thread) && $thread["ignored"]) {
if (DBA::isResult($thread) && $thread["ignored"]) {
logger("Thread ".$parent_id." will be ignored", LOGGER_DEBUG);
return;
}
@ -155,7 +155,7 @@ function notification($params)
}
// "your post"
if (DBA::is_result($item) && $item['owner-id'] == $item['author-id'] && $item['wall']) {
if (DBA::isResult($item) && $item['owner-id'] == $item['author-id'] && $item['wall']) {
$dest_str = L10n::t('%1$s commented on [url=%2$s]your %3$s[/url]',
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$itemlink,
@ -437,7 +437,7 @@ function notification($params)
$hash = random_string();
$r = q("SELECT `id` FROM `notify` WHERE `hash` = '%s' LIMIT 1",
dbesc($hash));
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$dups = true;
}
} while ($dups == true);
@ -689,12 +689,12 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
$fields = ['notify-flags', 'language', 'username', 'email', 'nickname'];
$user = DBA::selectFirst('user', $fields, ['uid' => $uid]);
if (!DBA::is_result($user)) {
if (!DBA::isResult($user)) {
return false;
}
$owner = DBA::selectFirst('contact', ['url'], ['self' => true, 'uid' => $uid]);
if (!DBA::is_result($owner)) {
if (!DBA::isResult($owner)) {
return false;
}
@ -745,7 +745,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
'guid', 'parent-uri', 'uri', 'contact-id', 'network'];
$condition = ['id' => $itemid, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]];
$item = Item::selectFirst($fields, $condition);
if (!DBA::is_result($item) || in_array($item['author-id'], $contacts)) {
if (!DBA::isResult($item) || in_array($item['author-id'], $contacts)) {
return;
}
@ -772,7 +772,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
$tags = q("SELECT `url` FROM `term` WHERE `otype` = %d AND `oid` = %d AND `type` = %d AND `uid` = %d",
intval(TERM_OBJ_POST), intval($itemid), intval(TERM_MENTION), intval($uid));
if (DBA::is_result($tags)) {
if (DBA::isResult($tags)) {
foreach ($tags AS $tag) {
$condition = ['nurl' => normalise_link($tag["url"]), 'uid' => $uid, 'notify_new_posts' => true];
$r = DBA::exists('contact', $condition);

View file

@ -265,7 +265,7 @@ function consume_feed($xml, $importer, $contact, &$hub, $datedir = 0, $pass = 0)
WHERE `contact`.`id` = %d AND `user`.`uid` = %d",
dbesc($contact["id"]), dbesc($importer["uid"])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
logger("Now import the DFRN feed");
DFRN::import($xml, $r[0], true);
return;
@ -289,7 +289,7 @@ function subscribe_to_hub($url, $importer, $contact, $hubmode = 'subscribe') {
* through the direct Diaspora protocol. If we try and use
* the feed, we'll get duplicates. So don't.
*/
if ((!DBA::is_result($r)) || $contact['network'] === NETWORK_DIASPORA) {
if ((!DBA::isResult($r)) || $contact['network'] === NETWORK_DIASPORA) {
return;
}
@ -340,7 +340,7 @@ function drop_item($id) {
$fields = ['id', 'uid', 'contact-id', 'deleted'];
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
notice(L10n::t('Item not found.') . EOL);
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
}
@ -461,7 +461,7 @@ function posted_date_widget($url, $uid, $wall) {
$ret = list_post_dates($uid, $wall);
if (!DBA::is_result($ret)) {
if (!DBA::isResult($ret)) {
return $o;
}

View file

@ -100,7 +100,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
if ((x($_SESSION, 'submanage')) && intval($_SESSION['submanage'])) {
$user = DBA::selectFirst('user', [], ['uid' => $_SESSION['submanage']]);
if (DBA::is_result($user)) {
if (DBA::isResult($user)) {
$master_record = $user;
}
}
@ -114,7 +114,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
// Then add all the children
$r = DBA::select('user', ['uid', 'username', 'nickname'],
['parent-uid' => $master_record['uid'], 'account_removed' => false]);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$a->identities = array_merge($a->identities, DBA::toArray($r));
}
} else {
@ -124,14 +124,14 @@ function authenticate_success($user_record, $login_initial = false, $interactive
// First entry is our parent
$r = DBA::select('user', ['uid', 'username', 'nickname'],
['uid' => $master_record['parent-uid'], 'account_removed' => false]);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$a->identities = DBA::toArray($r);
}
// Then add all siblings
$r = DBA::select('user', ['uid', 'username', 'nickname'],
['parent-uid' => $master_record['parent-uid'], 'account_removed' => false]);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$a->identities = array_merge($a->identities, DBA::toArray($r));
}
}
@ -142,7 +142,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
WHERE `user`.`account_removed` = 0 AND `manage`.`uid` = ?",
$master_record['uid']
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$a->identities = array_merge($a->identities, DBA::toArray($r));
}
@ -154,7 +154,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
}
$contact = DBA::selectFirst('contact', [], ['uid' => $_SESSION['uid'], 'self' => true]);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
$a->contact = $contact;
$a->cid = $contact['id'];
$_SESSION['cid'] = $a->cid;
@ -246,7 +246,7 @@ function can_write_wall($owner)
intval(PAGE_COMMUNITY)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$verified = 2;
return true;
} else {
@ -301,7 +301,7 @@ function permissions_sql($owner_id, $remote_verified = false, $groups = null)
intval($remote_user),
intval($owner_id)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$remote_verified = true;
$groups = Group::getIdsByContactId($remote_user);
}
@ -364,7 +364,7 @@ function item_permissions_sql($owner_id, $remote_verified = false, $groups = nul
intval($remote_user),
intval($owner_id)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$remote_verified = true;
$groups = Group::getIdsByContactId($remote_user);
}

View file

@ -759,7 +759,7 @@ function contact_block() {
dbesc(NETWORK_OSTATUS),
dbesc(NETWORK_DIASPORA)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$total = intval($r[0]['total']);
}
if (!$total) {
@ -778,7 +778,7 @@ function contact_block() {
dbesc(NETWORK_DIASPORA),
intval($shown)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$contacts = [];
foreach ($r AS $contact) {
$contacts[] = $contact["id"];
@ -786,7 +786,7 @@ function contact_block() {
$r = q("SELECT `id`, `uid`, `addr`, `url`, `name`, `thumb`, `network` FROM `contact` WHERE `id` IN (%s)",
dbesc(implode(",", $contacts)));
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$contacts = L10n::tt('%d Contact', '%d Contacts', $total);
$micropro = [];
foreach ($r as $rr) {
@ -1469,7 +1469,7 @@ function generate_user_guid() {
$x = q("SELECT `uid` FROM `user` WHERE `guid` = '%s' LIMIT 1",
dbesc($guid)
);
if (!DBA::is_result($x)) {
if (!DBA::isResult($x)) {
$found = false;
}
} while ($found == true);
@ -1758,7 +1758,7 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
intval($termtype),
intval($uid));
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
unset($deleted_tags[$key]);
} else {
$filetags_updated = str_replace($lbracket . file_tag_encode($tag) . $rbracket,'',$filetags_updated);
@ -1782,7 +1782,7 @@ function file_tag_save_file($uid, $item_id, $file)
}
$item = Item::selectFirst(['file'], ['id' => $item_id, 'uid' => $uid]);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
if (!stristr($item['file'],'[' . file_tag_encode($file) . ']')) {
$fields = ['file' => $item['file'] . '[' . file_tag_encode($file) . ']'];
Item::update($fields, ['id' => $item_id]);
@ -1811,7 +1811,7 @@ function file_tag_unsave_file($uid, $item_id, $file, $cat = false)
}
$item = Item::selectFirst(['file'], ['id' => $item_id, 'uid' => $uid]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
return false;
}
@ -1824,7 +1824,7 @@ function file_tag_unsave_file($uid, $item_id, $file, $cat = false)
intval($termtype),
intval($uid)
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$saved = PConfig::get($uid, 'system', 'filetags');
PConfig::set($uid, 'system', 'filetags', str_replace($pattern, '', $saved));
}