return $pageURL;
}
-function get_server()
-{
- $server = Config::get("system", "directory");
-
- if ($server == "") {
- $server = "https://dir.friendica.social";
- }
-
- return $server;
-}
-
function get_temppath()
{
$temppath = Config::get("system", "temppath");
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
+use Friendica\Core\Search;
use Friendica\Core\System;
use Friendica\Core\Session;
use Friendica\Database\DBA;
$page_desc = L10n::t("Please enter your 'Identity Address' from one of the following supported communications networks:");
- $invite_desc = L10n::t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica site and join us today</a>.', get_server() . '/servers');
+ $invite_desc = L10n::t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica site and join us today</a>.', Search::getGlobalDirectory() . '/servers');
$o = Renderer::replaceMacros($tpl, [
'$header' => L10n::t('Friend/Connection Request'),
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
+use Friendica\Core\Search;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
$params['n'] = 100;
if (strlen(Config::get('system', 'directory'))) {
- $host = get_server();
+ $host = Search::getGlobalDirectory();
} else {
$host = DI::baseUrl();
}
}
// Workaround for wrong directory photo URL
- $profile->photo = str_replace('http:///photo/', get_server() . '/photo/', $profile->photo);
+ $profile->photo = str_replace('http:///photo/', Search::getGlobalDirectory() . '/photo/', $profile->photo);
$connlnk = DI::baseUrl() . '/follow/?url=' . $profile->url;
$photo_menu = [
$return = GContact::searchByName($search, $mode);
} else {
$p = $page > 1 ? 'p=' . $page : '';
- $curlResult = Network::curl(get_server() . '/search/people?' . $p . '&q=' . urlencode($search), false, ['accept_content' => 'application/json']);
+ $curlResult = Network::curl(self::getGlobalDirectory() . '/search/people?' . $p . '&q=' . urlencode($search), false, ['accept_content' => 'application/json']);
if ($curlResult->isSuccess()) {
$searchResult = json_decode($curlResult->getBody(), true);
if (!empty($searchResult['profiles'])) {
return $return ?? [];
}
+
+ /**
+ * Returns the global directory name, used in this node
+ *
+ * @return string
+ */
+ public static function getGlobalDirectory()
+ {
+ return Config::get('system', 'directory', self::DEFAULT_DIRECTORY);
+ }
}
function notice($s)
function info($s)
function is_site_admin()
- function get_server()
function get_temppath()
function get_cachefile($file, $writemode = true)
function get_itemcachepath()
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
+use Friendica\Core\Search;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Network\Probe;
$done[] = DI::baseUrl() . '/poco';
if (strlen(Config::get('system', 'directory'))) {
- $x = Network::fetchUrl(get_server() . '/pubsites');
+ $x = Network::fetchUrl(Search::getGlobalDirectory() . '/pubsites');
if (!empty($x)) {
$j = json_decode($x);
if (!empty($j->entries)) {
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
+use Friendica\Core\Search;
use Friendica\Core\StorageManager;
use Friendica\Core\Theme;
use Friendica\Core\Worker;
'$banner' => ['banner', L10n::t('Banner/Logo'), $banner, ''],
'$shortcut_icon' => ['shortcut_icon', L10n::t('Shortcut icon'), Config::get('system', 'shortcut_icon'), L10n::t('Link to an icon that will be used for browsers.')],
'$touch_icon' => ['touch_icon', L10n::t('Touch icon'), Config::get('system', 'touch_icon'), L10n::t('Link to an icon that will be used for tablets and mobiles.')],
- '$additional_info' => ['additional_info', L10n::t('Additional Info'), $additional_info, L10n::t('For public servers: you can add additional information here that will be listed at %s/servers.', get_server())],
+ '$additional_info' => ['additional_info', L10n::t('Additional Info'), $additional_info, L10n::t('For public servers: you can add additional information here that will be listed at %s/servers.', Search::getGlobalDirectory()],
'$language' => ['language', L10n::t('System language'), Config::get('system', 'language'), '', $lang_choices],
'$theme' => ['theme', L10n::t('System theme'), Config::get('system', 'theme'), L10n::t('Default system theme - may be over-ridden by user profiles - <a href="/admin/themes" id="cnftheme">Change default theme settings</a>'), $theme_choices],
'$theme_mobile' => ['theme_mobile', L10n::t('Mobile system theme'), Config::get('system', 'mobile-theme', '---'), L10n::t('Theme for mobile devices'), $theme_choices_mobile],
namespace Friendica\Module;
-use Friendica\App\Arguments;
use Friendica\BaseModule;
use Friendica\Content\ContactSelector;
use Friendica\Content\Pager;
use Friendica\Object\Search\ContactResult;
use Friendica\Object\Search\ResultList;
use Friendica\Util\Proxy as ProxyUtils;
-use Friendica\Util\Strings;
/**
* Base class for search modules
$photo_menu['follow'] = [L10n::t("Connect/Follow"), $connLink];
}
- $photo = str_replace("http:///photo/", get_server() . "/photo/", $result->getPhoto());
+ $photo = str_replace("http:///photo/", Search::getGlobalDirectory() . "/photo/", $result->getPhoto());
$entry = [
'alt_text' => $alt_text,
use Friendica\Core\Config;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
+use Friendica\Core\Search;
use Friendica\Database\DBA;
use Friendica\Model\GContact;
use Friendica\Model\GServer;
}
}
- $x = Network::fetchUrl(get_server() . '/lsearch?p=1&n=500&search=' . urlencode($search));
+ $x = Network::fetchUrl(Search::getGlobalDirectory() . '/lsearch?p=1&n=500&search=' . urlencode($search));
$j = json_decode($x);
if (!empty($j->results)) {
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\Renderer;
+use Friendica\Core\Search;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
$nv['random'] = L10n::t('Random Profile');
$nv['inv'] = L10n::t('Invite Friends');
$nv['directory'] = L10n::t('Global Directory');
- $nv['global_dir'] = get_server();
+ $nv['global_dir'] = Search::getGlobalDirectory();
$nv['local_directory'] = L10n::t('Local Directory');
$aside['$nv'] = $nv;