aboutsummaryrefslogtreecommitdiffstats
path: root/mod/directory.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-05 18:24:49 -0800
committerfriendica <info@friendica.com>2015-03-05 18:24:49 -0800
commit22391a24378cae317cdf62dc4be4b31b68e8191f (patch)
treeeca9be09c179ab036625dd64fbaea91d181f87fc /mod/directory.php
parente73d0ee418564eb32517f86930c78384ca3bd52d (diff)
downloadvolse-hubzilla-22391a24378cae317cdf62dc4be4b31b68e8191f.tar.gz
volse-hubzilla-22391a24378cae317cdf62dc4be4b31b68e8191f.tar.bz2
volse-hubzilla-22391a24378cae317cdf62dc4be4b31b68e8191f.zip
straighten out some directory stuff, which required some Comanche structural changes
Diffstat (limited to 'mod/directory.php')
-rw-r--r--mod/directory.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/mod/directory.php b/mod/directory.php
index bc5aa41e2..dfc60b190 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -14,6 +14,20 @@ function directory_init(&$a) {
dbesc($_GET['ignore'])
);
}
+
+ $observer = get_observer_hash();
+ $global_changed = false;
+
+ if(array_key_exists('global',$_REQUEST)) {
+ $globaldir = intval($_REQUEST['global']);
+ $global_changed = true;
+ }
+ if($global_changed) {
+ $_SESSION['globaldir'] = $globaldir;
+ if($observer)
+ set_xconfig($observer,'directory','globaldir',$globaldir);
+ }
+
}
function directory_content(&$a) {
@@ -26,6 +40,11 @@ function directory_content(&$a) {
$safe_mode = 1;
$observer = get_observer_hash();
+
+ if($observer)
+ $globaldir = get_xconfig($observer,'directory','globaldir');
+ else
+ $globaldir = ((array_key_exists('globaldir',$_SESSION)) ? intval($_SESSION['globaldir']) : false);
if($observer) {
$safe_mode = get_xconfig($observer,'directory','safe_mode');
@@ -120,6 +139,9 @@ function directory_content(&$a) {
if($token)
$query .= '&t=' . $token;
+ if(! $globaldir)
+ $query .= '&hub=' . get_app()->get_hostname();
+
if($search)
$query .= '&name=' . urlencode($search) . '&keywords=' . urlencode($search);
if(strpos($search,'@'))