$nickname = Strings::escapeTags(trim($a->argv[1]));
}
if (empty($nickname)) {
- $c = q("SELECT * FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1");
- if (!DBA::isResult($c)) {
+ if (!DBA::exists('profile', ['net-publish' => true])) {
throw new \Friendica\Network\HTTPException\ForbiddenException();
}
$system_mode = true;
DBA::escape(Protocol::OSTATUS)
);
} elseif ($system_mode) {
- $contacts = q("SELECT count(*) AS `total` FROM `contact` WHERE `self` = 1
- AND `uid` IN (SELECT `uid` FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1) ");
+ $totalResults = DBA::count('profile', ['net-publish' => true]);
} else {
$contacts = q("SELECT count(*) AS `total` FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
AND (`success_update` >= `failure_update` OR `last-item` >= `failure_update`)
DBA::escape(Protocol::STATUSNET)
);
}
- if (DBA::isResult($contacts)) {
+ if (empty($totalResults) && DBA::isResult($contacts)) {
$totalResults = intval($contacts[0]['total']);
- } else {
+ } elseif (empty($totalResults)) {
$totalResults = 0;
}
if (!empty($_GET['startIndex'])) {
`profile`.`postal-code` AS `ppostalcode`, `profile`.`country-name` AS `pcountry`, `user`.`account-type`
FROM `contact` INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid`
INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
- WHERE `self` = 1
- AND `contact`.`uid` IN (SELECT `uid` FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1) LIMIT %d, %d",
+ WHERE `self` = 1 AND `profile`.`net-publish`
+ LIMIT %d, %d",
intval($startIndex),
intval($itemsPerPage)
);
$blocktags = ((!empty($_POST['blocktags']) && (intval($_POST['blocktags']) == 1)) ? 0: 1); // this setting is inverted!
$unkmail = ((!empty($_POST['unkmail']) && (intval($_POST['unkmail']) == 1)) ? 1: 0);
$cntunkmail = (!empty($_POST['cntunkmail']) ? intval($_POST['cntunkmail']) : 0);
- $suggestme = (!empty($_POST['suggestme']) ? intval($_POST['suggestme']) : 0);
$hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
$hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
DI::pConfig()->set(local_user(), 'expire', 'photos', $expire_photos);
DI::pConfig()->set(local_user(), 'expire', 'network_only', $expire_network_only);
- DI::pConfig()->set(local_user(), 'system', 'suggestme', $suggestme);
-
DI::pConfig()->set(local_user(), 'system', 'email_textonly', $email_textonly);
DI::pConfig()->set(local_user(), 'system', 'detailed_notif', $detailed_notif);
$expire_starred = DI::pConfig()->get(local_user(), 'expire', 'starred', true);
$expire_photos = DI::pConfig()->get(local_user(), 'expire', 'photos', false);
$expire_network_only = DI::pConfig()->get(local_user(), 'expire', 'network_only', false);
- $suggestme = DI::pConfig()->get(local_user(), 'system', 'suggestme', false);
// nowarn_insecure
'$field' => ['blocktags', DI::l10n()->t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), DI::l10n()->t('Your contacts can add additional tags to your posts.')],
]);
- $suggestme = Renderer::replaceMacros($opt_tpl, [
- '$field' => ['suggestme', DI::l10n()->t('Allow us to suggest you as a potential friend to new members?'), $suggestme, DI::l10n()->t('If you like, Friendica may suggest new members to add you as a contact.')],
- ]);
-
$unkmail = Renderer::replaceMacros($opt_tpl, [
'$field' => ['unkmail', DI::l10n()->t('Permit unknown people to send you private mail?'), $unkmail, DI::l10n()->t('Friendica network users may send you private messages even if they are not in your contact list.')],
]);
'$permdesc' => DI::l10n()->t("\x28click to open/close\x29"),
'$visibility' => $profile['net-publish'],
'$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->user),
- '$suggestme' => $suggestme,
'$blockwall'=> $blockwall, // array('blockwall', DI::l10n()->t('Allow friends to post to your profile page:'), !$blockwall, ''),
'$blocktags'=> $blocktags, // array('blocktags', DI::l10n()->t('Allow friends to tag your posts:'), !$blocktags, ''),