use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
+use Friendica\Core\Search;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\Item;
use Friendica\Model\Post;
+use Friendica\Model\Profile;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
*/
public static function findPeople()
{
- $global_dir = DI::config()->get('system', 'directory');
+ $global_dir = Search::getGlobalDirectory();
if (DI::config()->get('system', 'invitation_only')) {
$x = intval(DI::pConfig()->get(local_user(), 'system', 'invites_remaining'));
$nv['random'] = DI::l10n()->t('Random Profile');
$nv['inv'] = DI::l10n()->t('Invite Friends');
$nv['directory'] = DI::l10n()->t('Global Directory');
- $nv['global_dir'] = $global_dir;
+ $nv['global_dir'] = Profile::zrl($global_dir, true);
$nv['local_directory'] = DI::l10n()->t('Local Directory');
$aside = [];
*/
public static function getContactsFromGlobalDirectory($search, $type = self::TYPE_ALL, $page = 1)
{
- $server = DI::config()->get('system', 'directory', self::DEFAULT_DIRECTORY);
+ $server = self::getGlobalDirectory();
$searchUrl = $server . '/search';
self::remove($contact['id']);
} else {
DI::logger()->info('Couldn\'t remove follower because of invalid contact array', ['contact' => $contact, 'callstack' => System::callstack()]);
+ return;
}
$cdata = Contact::getPublicAndUserContactID($contact['id'], $contact['uid']);
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
+use Friendica\Core\Search;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
$profile = DBA::selectFirst('profile', ['net-publish'], ['uid' => $register['uid']]);
- if (DBA::isResult($profile) && $profile['net-publish'] && DI::config()->get('system', 'directory')) {
+ if (DBA::isResult($profile) && $profile['net-publish'] && Search::getGlobalDirectory()) {
$url = DI::baseUrl() . '/profile/' . $user['nickname'];
Worker::add(PRIORITY_LOW, "Directory", $url);
}
use Friendica\Profile\ProfileField\Collection\ProfileFields;
use Friendica\Content\Text\BBCode;
+use Friendica\Core\Search;
use Friendica\DI;
use Friendica\Model\Profile;
use Friendica\Module\BaseApi;
$uid = self::getCurrentUserID();
// retrieve general information about profiles for user
- $directory = DI::config()->get('system', 'directory');
+ $directory = Search::getGlobalDirectory();
$profile = Profile::getByUID($uid);
if (empty($results)) {
if (DI::config()->get('system', 'poco_local_search')) {
$results = CoreSearch::getContactsFromLocalDirectory($request['q'], CoreSearch::TYPE_ALL, 0, $request['limit']);
- } elseif (!empty(DI::config()->get('system', 'directory'))) {
+ } elseif (CoreSearch::getGlobalDirectory()) {
$results = CoreSearch::getContactsFromGlobalDirectory($request['q'], CoreSearch::TYPE_ALL, 1);
}
}
if (empty($results)) {
if (DI::config()->get('system', 'poco_local_search')) {
$results = CoreSearch::getContactsFromLocalDirectory($q, CoreSearch::TYPE_ALL, 0, $limit);
- } elseif (!empty(DI::config()->get('system', 'directory'))) {
+ } elseif (CoreSearch::getGlobalDirectory()) {
$results = CoreSearch::getContactsFromGlobalDirectory($q, CoreSearch::TYPE_ALL, 1);
}
}
if ($localSearch && empty($results)) {
$pager->setItemsPerPage(80);
$results = Search::getContactsFromLocalDirectory($search, $type, $pager->getStart(), $pager->getItemsPerPage());
- } elseif (strlen($config->get('system', 'directory')) && empty($results)) {
+ } elseif (Search::getGlobalDirectory() && empty($results)) {
$results = Search::getContactsFromGlobalDirectory($search, $type, $pager->getPage());
$pager->setItemsPerPage($results->getItemsPage());
}
use Friendica\Core\Hook;
use Friendica\Core\Session;
use Friendica\Core\Renderer;
+use Friendica\Core\Search;
use Friendica\DI;
use Friendica\Model;
use Friendica\Model\Profile;
$search = trim(rawurldecode($_REQUEST['search'] ?? ''));
$gDirPath = '';
- $dirURL = $config->get('system', 'directory');
+ $dirURL = Search::getGlobalDirectory();
if (strlen($dirURL)) {
$gDirPath = Profile::zrl($dirURL, true);
}
use Friendica\BaseModule;
use Friendica\Core\Renderer;
+use Friendica\Core\Search;
use Friendica\DI;
use Friendica\Model;
use Friendica\Model\User;
}
}
- $dirLocation = $config->get('system', 'directory');
+ $dirLocation = Search::getGlobalDirectory();
if (strlen($dirLocation)) {
if ($config->get('config', 'register_policy') === Register::CLOSED) {
$linkTxt = DI::l10n()->t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.', $dirLocation . '/servers');
use Friendica\Core\ACL;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
+use Friendica\Core\Search;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
}
$net_pub_desc = '';
- if (strlen(DI::config()->get('system', 'directory'))) {
- $net_pub_desc = ' ' . DI::l10n()->t('Your profile will also be published in the global friendica directories (e.g. <a href="%s">%s</a>).', DI::config()->get('system', 'directory'), DI::config()->get('system', 'directory'));
+ if (Search::getGlobalDirectory()) {
+ $net_pub_desc = ' ' . DI::l10n()->t('Your profile will also be published in the global friendica directories (e.g. <a href="%s">%s</a>).', Search::getGlobalDirectory(), Search::getGlobalDirectory());
}
/* Installed langs */
use Friendica\Core\Hook;
use Friendica\Core\Logger;
+use Friendica\Core\Search;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
{
public static function execute($url = '')
{
- $dir = DI::config()->get('system', 'directory');
+ $dir = Search::getGlobalDirectory();
if (!strlen($dir)) {
return;
namespace Friendica\Worker;
use Friendica\Core\Logger;
+use Friendica\Core\Search;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
return;
}
- $directory = DI::config()->get('system', 'directory');
+ $directory = Search::getGlobalDirectory();
if (empty($directory)) {
Logger::info('No directory configured');
return;