aboutsummaryrefslogtreecommitdiffstats
path: root/include/dir_fns.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/dir_fns.php')
-rw-r--r--include/dir_fns.php27
1 files changed, 12 insertions, 15 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php
index 83073154a..e466b7404 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -151,16 +151,18 @@ function sync_directories($dirmode) {
$realm = get_directory_realm();
if ($realm == DIRECTORY_REALM) {
- $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and ( site_realm = '%s' or site_realm = '') ",
+ $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_type = %d and ( site_realm = '%s' or site_realm = '') ",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
+ intval(SITE_TYPE_ZOT),
dbesc($realm)
);
} else {
- $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_realm like '%s' ",
+ $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_realm like '%s' and site_type = %d ",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
- dbesc(protect_sprintf('%' . $realm . '%'))
+ dbesc(protect_sprintf('%' . $realm . '%')),
+ intval(SITE_TYPE_ZOT)
);
}
@@ -187,9 +189,10 @@ function sync_directories($dirmode) {
intval($r[0]['site_valid'])
);
- $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s'",
+ $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_type = %d ",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
- dbesc(z_root())
+ dbesc(z_root()),
+ intval(SITE_TYPE_ZOT)
);
}
if (! $r)
@@ -389,19 +392,13 @@ function local_dir_update($uid, $force) {
logger('hidden: ' . $hidden);
- $r = q("select xchan_flags from xchan where xchan_hash = '%s' limit 1",
+ $r = q("select xchan_hidden from xchan where xchan_hash = '%s' limit 1",
dbesc($p[0]['channel_hash'])
);
- // Be careful - XCHAN_FLAGS_HIDDEN should evaluate to 1
- if (($r[0]['xchan_flags'] & XCHAN_FLAGS_HIDDEN) != $hidden)
- $new_flags = $r[0]['xchan_flags'] ^ XCHAN_FLAGS_HIDDEN;
- else
- $new_flags = $r[0]['xchan_flags'];
-
- if ($new_flags != $r[0]['xchan_flags']) {
- $r = q("update xchan set xchan_flags = %d where xchan_hash = '%s'",
- intval($new_flags),
+ if(intval($r[0]['xchan_hidden']) != $hidden) {
+ $r = q("update xchan set xchan_hidden = %d where xchan_hash = '%s'",
+ intval($hidden),
dbesc($p[0]['channel_hash'])
);
}