<?php
+
+use Friendica\App;
+use Friendica\Core\Config;
+use Friendica\Database\DBM;
+
require_once('include/Contact.php');
require_once('include/contact_selectors.php');
-function viewcontacts_init(App &$a) {
+function viewcontacts_init(App $a) {
- if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+ if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
return;
}
dbesc($nick)
);
- if (! dbm::is_result($r)) {
+ if (! DBM::is_result($r)) {
return;
}
}
-function viewcontacts_content(App &$a) {
+function viewcontacts_content(App $a) {
require_once("mod/proxy.php");
- if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+ if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
notice( t('Public access denied.') . EOL);
return;
}
}
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
- WHERE `uid` = %d AND (NOT `blocked` OR `pending`) AND NOT `hidden` AND NOT `archive`
+ WHERE `uid` = %d AND NOT `blocked` AND NOT `pending`
+ AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s')",
intval($a->profile['uid']),
dbesc(NETWORK_DFRN),
dbesc(NETWORK_DIASPORA),
dbesc(NETWORK_OSTATUS)
);
- if (dbm::is_result($r))
+ if (DBM::is_result($r))
$a->set_pager_total($r[0]['total']);
$r = q("SELECT * FROM `contact`
- WHERE `uid` = %d AND (NOT `blocked` OR `pending`) AND NOT `hidden` AND NOT `archive`
+ WHERE `uid` = %d AND NOT `blocked` AND NOT `pending`
+ AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s')
ORDER BY `name` ASC LIMIT %d, %d",
intval($a->profile['uid']),
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
- if (!dbm::is_result($r)) {
+ if (!DBM::is_result($r)) {
info(t('No contacts.').EOL);
return $o;
}