mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-06-17 04:45:14 +02:00
Rename DBA::is_result to DBA::isResult
This commit is contained in:
parent
332ea212b5
commit
f4ad0d3721
11 changed files with 76 additions and 76 deletions
|
@ -464,7 +464,7 @@ function statusnet_post_hook(App $a, &$b)
|
|||
|
||||
$condition = ['uri' => $b["thr-parent"], 'uid' => $b["uid"]];
|
||||
$orig_post = Item::selectFirst(['author-link', 'uri'], $condition);
|
||||
if (!DBA::is_result($orig_post)) {
|
||||
if (!DBA::isResult($orig_post)) {
|
||||
logger("statusnet_post_hook: no parent found " . $b["thr-parent"]);
|
||||
return;
|
||||
} else {
|
||||
|
@ -685,7 +685,7 @@ function statusnet_prepare_body(App $a, &$b)
|
|||
|
||||
$condition = ['uri' => $item["thr-parent"], 'uid' => local_user()];
|
||||
$orig_post = Item::selectFirst(['author-link', 'uri'], $condition);
|
||||
if (DBA::is_result($orig_post)) {
|
||||
if (DBA::isResult($orig_post)) {
|
||||
$nick = preg_replace("=https?://(.*)/(.*)=ism", "$2", $orig_post["author-link"]);
|
||||
|
||||
$nickname = "@[url=" . $orig_post["author-link"] . "]" . $nick . "[/url]";
|
||||
|
@ -730,7 +730,7 @@ function statusnet_cron(App $a, $b)
|
|||
logger('statusnet: cron_start');
|
||||
|
||||
$r = q("SELECT * FROM `pconfig` WHERE `cat` = 'statusnet' AND `k` = 'mirror_posts' AND `v` = '1' ORDER BY RAND() ");
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
foreach ($r as $rr) {
|
||||
logger('statusnet: fetching for user ' . $rr['uid']);
|
||||
statusnet_fetchtimeline($a, $rr['uid']);
|
||||
|
@ -745,11 +745,11 @@ function statusnet_cron(App $a, $b)
|
|||
$abandon_limit = date(DateTimeFormat::MYSQL, time() - $abandon_days * 86400);
|
||||
|
||||
$r = q("SELECT * FROM `pconfig` WHERE `cat` = 'statusnet' AND `k` = 'import' AND `v` ORDER BY RAND()");
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
foreach ($r as $rr) {
|
||||
if ($abandon_days != 0) {
|
||||
$user = q("SELECT `login_date` FROM `user` WHERE uid=%d AND `login_date` >= '%s'", $rr['uid'], $abandon_limit);
|
||||
if (!DBA::is_result($user)) {
|
||||
if (!DBA::isResult($user)) {
|
||||
logger('abandoned account: timeline from user ' . $rr['uid'] . ' will not be imported');
|
||||
continue;
|
||||
}
|
||||
|
@ -901,16 +901,16 @@ function statusnet_fetch_contact($uid, $contact, $create_user)
|
|||
|
||||
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `alias` = '%s' AND `network` = '%s'LIMIT 1", intval($uid), dbesc(normalise_link($contact->statusnet_profile_url)), dbesc(NETWORK_STATUSNET));
|
||||
|
||||
if (!DBA::is_result($r) && !$create_user) {
|
||||
if (!DBA::isResult($r) && !$create_user) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (DBA::is_result($r) && ($r[0]["readonly"] || $r[0]["blocked"])) {
|
||||
if (DBA::isResult($r) && ($r[0]["readonly"] || $r[0]["blocked"])) {
|
||||
logger("statusnet_fetch_contact: Contact '" . $r[0]["nick"] . "' is blocked or readonly.", LOGGER_DEBUG);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!DBA::is_result($r)) {
|
||||
if (!DBA::isResult($r)) {
|
||||
// create contact record
|
||||
q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `alias`, `notify`, `poll`,
|
||||
`name`, `nick`, `photo`, `network`, `rel`, `priority`,
|
||||
|
@ -940,7 +940,7 @@ function statusnet_fetch_contact($uid, $contact, $create_user)
|
|||
intval($uid),
|
||||
dbesc(NETWORK_STATUSNET));
|
||||
|
||||
if (!DBA::is_result($r)) {
|
||||
if (!DBA::isResult($r)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1024,7 +1024,7 @@ function statusnet_fetchuser(App $a, $uid, $screen_name = "", $user_id = "")
|
|||
$r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||
intval($uid));
|
||||
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
$self = $r[0];
|
||||
} else {
|
||||
return;
|
||||
|
@ -1086,11 +1086,11 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex
|
|||
$fields = ['uri', 'parent-uri', 'parent'];
|
||||
$item = Item::selectFirst($fields, ['uri' => $parent, 'uid' => $uid]);
|
||||
|
||||
if (!DBA::is_result($item)) {
|
||||
if (!DBA::isResult($item)) {
|
||||
$item = Item::selectFirst($fields, ['extid' => $parent, 'uid' => $uid]);
|
||||
}
|
||||
|
||||
if (DBA::is_result($item)) {
|
||||
if (DBA::isResult($item)) {
|
||||
$postarray['thr-parent'] = $item['uri'];
|
||||
$postarray['parent-uri'] = $item['parent-uri'];
|
||||
$postarray['parent'] = $item['parent'];
|
||||
|
@ -1108,7 +1108,7 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex
|
|||
$r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||
intval($uid));
|
||||
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
$contactid = $r[0]["id"];
|
||||
|
||||
$postarray['owner-name'] = $r[0]["name"];
|
||||
|
@ -1212,7 +1212,7 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1)
|
|||
intval($own_contact),
|
||||
intval($uid));
|
||||
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
$nick = $r[0]["nick"];
|
||||
} else {
|
||||
logger("statusnet_fetchhometimeline: Own GNU Social contact not found for user " . $uid, LOGGER_DEBUG);
|
||||
|
@ -1222,7 +1222,7 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1)
|
|||
$r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||
intval($uid));
|
||||
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
$self = $r[0];
|
||||
} else {
|
||||
logger("statusnet_fetchhometimeline: Own contact not found for user " . $uid, LOGGER_DEBUG);
|
||||
|
@ -1231,7 +1231,7 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1)
|
|||
|
||||
$u = q("SELECT * FROM user WHERE uid = %d LIMIT 1",
|
||||
intval($uid));
|
||||
if (!DBA::is_result($u)) {
|
||||
if (!DBA::isResult($u)) {
|
||||
logger("statusnet_fetchhometimeline: Own user not found for user " . $uid, LOGGER_DEBUG);
|
||||
return;
|
||||
}
|
||||
|
@ -1521,7 +1521,7 @@ function statusnet_fetch_own_contact(App $a, $uid)
|
|||
} else {
|
||||
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `alias` = '%s' LIMIT 1",
|
||||
intval($uid), dbesc($own_url));
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
$contact_id = $r[0]["id"];
|
||||
} else {
|
||||
PConfig::delete($uid, 'statusnet', 'own_url');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue