aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dirsearch.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-08-17 19:06:56 -0700
committerfriendica <info@friendica.com>2014-08-17 19:06:56 -0700
commit4a76925787672ede57e0d36c890ffb08b6d32ed4 (patch)
treee61d21fbde2020027fd0c9dd132c0cb8f998d262 /mod/dirsearch.php
parentde1198ccfe113c848482ba0ba21bc9f24caca8a8 (diff)
downloadvolse-hubzilla-4a76925787672ede57e0d36c890ffb08b6d32ed4.tar.gz
volse-hubzilla-4a76925787672ede57e0d36c890ffb08b6d32ed4.tar.bz2
volse-hubzilla-4a76925787672ede57e0d36c890ffb08b6d32ed4.zip
some more work on realms
Diffstat (limited to 'mod/dirsearch.php')
-rw-r--r--mod/dirsearch.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 0ace4ecae..b72d303b7 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -325,8 +325,18 @@ function dir_parse_query($s) {
function list_public_sites() {
-
- $r = q("select * from site where site_access != 0 and site_register !=0 order by rand()");
+ $realm = get_directory_realm();
+ if($realm == DIRECTORY_REALM) {
+ $r = q("select * from site where site_access != 0 and site_register !=0 and ( site_realm = '%s' or site_realm = '') order by rand()",
+ dbesc($realm)
+ );
+ }
+ else {
+ $r = q("select * from site where site_access != 0 and site_register !=0 and site_realm = '%s' order by rand()",
+ dbesc($realm)
+ );
+ }
+
$ret = array('success' => false);
if($r) {