X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnoscrape.php;h=3a8abe2290928e62c40eeb0cda12a389c042af21;hb=db0b848ae30983b394847a5597c3f7c7332cfe7c;hp=e9ced2518c3b50f893f381b6c5d163d2562516d4;hpb=4f2ae8868431952bd3acda1537ee899740cbf205;p=friendica.git diff --git a/mod/noscrape.php b/mod/noscrape.php index e9ced2518c..3a8abe2290 100644 --- a/mod/noscrape.php +++ b/mod/noscrape.php @@ -4,9 +4,10 @@ */ use Friendica\App; +use Friendica\Core\Protocol; use Friendica\Core\System; use Friendica\Database\DBA; -use Friendica\Database\DBM; +use Friendica\Model\Contact; use Friendica\Model\Profile; function noscrape_init(App $a) @@ -31,7 +32,7 @@ function noscrape_init(App $a) 'guid' => $a->profile['guid'], 'key' => $a->profile['pubkey'], 'homepage' => System::baseUrl()."/profile/{$which}", - 'comm' => ($a->profile['account-type'] == ACCOUNT_TYPE_COMMUNITY), + 'comm' => ($a->profile['account-type'] == Contact::ACCOUNT_TYPE_COMMUNITY), ]; if (!$a->profile['net-publish'] || $a->profile['hidewall']) { @@ -55,18 +56,18 @@ function noscrape_init(App $a) /// @todo What should this value tell us? $r = q("SELECT `gcontact`.`updated` FROM `contact` INNER JOIN `gcontact` WHERE `gcontact`.`nurl` = `contact`.`nurl` AND `self` AND `uid` = %d LIMIT 1", intval($a->profile['uid'])); - if (DBM::is_result($r)) { + if (DBA::isResult($r)) { $json_info["updated"] = date("c", strtotime($r[0]['updated'])); } $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0 AND `network` IN ('%s', '%s', '%s', '')", intval($a->profile['uid']), - dbesc(NETWORK_DFRN), - dbesc(NETWORK_DIASPORA), - dbesc(NETWORK_OSTATUS) + DBA::escape(Protocol::DFRN), + DBA::escape(Protocol::DIASPORA), + DBA::escape(Protocol::OSTATUS) ); - if (DBM::is_result($r)) { + if (DBA::isResult($r)) { $json_info["contacts"] = intval($r[0]['total']); } } @@ -75,13 +76,13 @@ function noscrape_init(App $a) $last_active = 0; $condition = ['uid' => $a->profile['uid'], 'self' => true]; $contact = DBA::selectFirst('contact', ['last-item'], $condition); - if (DBM::is_result($contact)) { + if (DBA::isResult($contact)) { $last_active = strtotime($contact['last-item']); } $condition = ['uid' => $a->profile['uid']]; $user = DBA::selectFirst('user', ['login_date'], $condition); - if (DBM::is_result($user)) { + if (DBA::isResult($user)) { if ($last_active < strtotime($user['login_date'])) { $last_active = strtotime($user['login_date']); }