diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/dirsearch.php | 14 | ||||
-rw-r--r-- | mod/sitelist.php | 6 |
2 files changed, 18 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) { diff --git a/mod/sitelist.php b/mod/sitelist.php index 1e6d0fcfb..95cf862df 100644 --- a/mod/sitelist.php +++ b/mod/sitelist.php @@ -18,6 +18,12 @@ function sitelist_init(&$a) { if($open) $sql_extra = " and site_register = " . intval(REGISTER_OPEN) . " "; + $realm = get_directory_realm(); + if($realm == DIRECTORY_REALM) { + $sql_extra .= " and ( site_realm = '" . dbesc($realm) . "' or site_realm = '') "; + } + else + $sql_extra .= " and site_realm = '" . dbesc($realm) . "' "; $result = array('success' => false); |