]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #1842 from annando/1508-directory-configurable
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Sun, 23 Aug 2015 13:10:34 +0000 (15:10 +0200)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Sun, 23 Aug 2015 13:10:34 +0000 (15:10 +0200)
Make the hardcoded path to dir.friendica.com configurable

boot.php
include/discover_poco.php
include/socgraph.php
mod/admin.php
mod/dfrn_request.php
mod/dirfind.php
mod/match.php

index ce02ca8b0dba57d213014cfc344923e3cce4f76d..7fb4591411c99fdb44f3373800e21ebacdf9777c 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1708,6 +1708,15 @@ function random_digits($digits) {
        return $rn;
 }
 
+function get_server() {
+       $server = get_config("system", "directory");
+
+       if ($server == "")
+               $server = "http://dir.friendi.ca";
+
+       return($server);
+}
+
 function get_cachefile($file, $writemode = true) {
        $cache = get_itemcachepath();
 
index a4cf5db54e9abe603e7e50f1995d27274769cfb8..4a17b49279aa952fcf1f43c1df60e5fecc7879e2 100644 (file)
@@ -146,7 +146,7 @@ function discover_directory($search) {
                }
        }
 
-       $x = fetch_url("http://dir.friendica.com/lsearch?p=1&n=500&search=".urlencode($search));
+       $x = fetch_url(get_server()."/lsearch?p=1&n=500&search=".urlencode($search));
        $j = json_decode($x);
 
        if(count($j->results))
index d114ef09cce8f304bda8ef72ba66912c25ef0e2d..c6c4f5ea8e5ef0704a8876e4b7926793815b38a9 100644 (file)
@@ -1184,7 +1184,7 @@ function update_suggestions() {
        $done[] = $a->get_baseurl() . '/poco';
 
        if(strlen(get_config('system','directory_submit_url'))) {
-               $x = fetch_url('http://dir.friendica.com/pubsites');
+               $x = fetch_url(get_server()."/pubsites");
                if($x) {
                        $j = json_decode($x);
                        if($j->entries) {
index 2493973dff3b4a141a845f7516e8c29517c4c78d..be4ab8b52ea014cfbccb3273caf4c0274664f7e1 100644 (file)
@@ -693,7 +693,7 @@ function admin_page_site(&$a) {
                '$banner'               => array('banner', t("Banner/Logo"), $banner, ""),
                '$shortcut_icon'        => array('shortcut_icon', t("Shortcut icon"), get_config('system','shortcut_icon'),  "Link to an icon that will be used for browsers."),
                '$touch_icon'           => array('touch_icon', t("Touch icon"), get_config('system','touch_icon'),  "Link to an icon that will be used for tablets and mobiles."),
-               '$info' => array('info',t('Additional Info'), $info, t('For public servers: you can add additional information here that will be listed at dir.friendica.com/siteinfo.')),
+               '$info' => array('info',t('Additional Info'), $info, sprintf(t('For public servers: you can add additional information here that will be listed at %s/siteinfo.'), get_server())),
                '$language'             => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
                '$theme'                => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
                '$theme_mobile'         => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile),
index 62b6f4bd700f80aaea4dc69729e57eeb238d2f1e..3316cb0b0f5103f9e43139d74dc839f1211db5e6 100644 (file)
@@ -836,7 +836,7 @@ function dfrn_request_content(&$a) {
                //$emailnet = (($mail_disabled) ? '' : t("<strike>Connect as an email follower</strike> \x28Coming soon\x29"));
                $emailnet = "";
 
-               $invite_desc = t('If you are not yet a member of the free social web, <a href="http://dir.friendica.com/siteinfo">follow this link to find a public Friendica site and join us today</a>.');
+               $invite_desc = sprintf(t('If you are not yet a member of the free social web, <a href="%s/siteinfo">follow this link to find a public Friendica site and join us today</a>.', get_server()));
 
                $o .= replace_macros($tpl,array(
                        '$header' => t('Friend/Connection Request'),
index 516742c249cf27732e313fbce7362b7a4d35e198..e70dfe968080503348e0d6aa1fe9bc10ad5d4e14 100644 (file)
@@ -98,7 +98,7 @@ function dirfind_content(&$a) {
                        $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : '');
 
                        if(strlen(get_config('system','directory_submit_url')))
-                               $x = fetch_url('http://dir.friendica.com/lsearch?f=' . $p .  '&search=' . urlencode($search));
+                               $x = fetch_url(get_server().'/lsearch?f=' . $p .  '&search=' . urlencode($search));
 
                        $j = json_decode($x);
                }
index 7773636420658cc015c2db7a4076d5ad9e40b589..199ad9ed769df981116a42dee157822046208c77 100644 (file)
@@ -26,14 +26,14 @@ function match_content(&$a) {
 
        $params = array();
        $tags = trim($r[0]['pub_keywords'] . ' ' . $r[0]['prv_keywords']);
-       
+
        if($tags) {
                $params['s'] = $tags;
                if($a->pager['page'] != 1)
                        $params['p'] = $a->pager['page'];
-                       
+
                if(strlen(get_config('system','directory_submit_url')))
-                       $x = post_url('http://dir.friendica.com/msearch', $params);
+                       $x = post_url(get_server().'/msearch', $params);
                else
                        $x = post_url($a->get_baseurl() . '/msearch', $params);