aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-07-07 21:41:37 +0200
committerMario Vavti <mario@mariovavti.com>2015-07-07 21:41:37 +0200
commit9c577e042292bd8227b40f9500d19eecd974a8e4 (patch)
treef5d873e58e5f9ac55b5b071dc2e4a8a594cabcd6 /mod
parentcc7eaa0d050cde57024eb7baff042513479ed0c4 (diff)
downloadvolse-hubzilla-9c577e042292bd8227b40f9500d19eecd974a8e4.tar.gz
volse-hubzilla-9c577e042292bd8227b40f9500d19eecd974a8e4.tar.bz2
volse-hubzilla-9c577e042292bd8227b40f9500d19eecd974a8e4.zip
make public forums only setting sticky and simplify function to get directory settings
Diffstat (limited to 'mod')
-rw-r--r--mod/directory.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/mod/directory.php b/mod/directory.php
index 6d066a21b..6dea0e992 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -19,6 +19,7 @@ function directory_init(&$a) {
$observer = get_observer_hash();
$global_changed = false;
$safe_changed = false;
+ $pubforums_changed = false;
if(array_key_exists('global',$_REQUEST)) {
$globaldir = intval($_REQUEST['global']);
@@ -28,7 +29,7 @@ function directory_init(&$a) {
$_SESSION['globaldir'] = $globaldir;
if($observer)
set_xconfig($observer,'directory','globaldir',$globaldir);
- }
+ }
if(array_key_exists('safe',$_REQUEST)) {
$safemode = intval($_REQUEST['safe']);
@@ -37,9 +38,19 @@ function directory_init(&$a) {
if($safe_changed) {
$_SESSION['safemode'] = $safemode;
if($observer)
- set_xconfig($observer,'directory','safe_mode',$safemode);
- }
+ set_xconfig($observer,'directory','safemode',$safemode);
+ }
+
+ if(array_key_exists('pubforums',$_REQUEST)) {
+ $pubforums = intval($_REQUEST['pubforums']);
+ $pubforums_changed = true;
+ }
+ if($pubforums_changed) {
+ $_SESSION['pubforums'] = $pubforums;
+ if($observer)
+ set_xconfig($observer,'directory','pubforums',$pubforums);
+ }
}
function directory_content(&$a) {
@@ -51,18 +62,14 @@ function directory_content(&$a) {
$observer = get_observer_hash();
- $globaldir = get_globaldir_setting($observer);
+ $globaldir = get_directory_settings($observer, 'globaldir');
// override your personal global search pref if we're doing a navbar search of the directory
if(intval($_REQUEST['navsearch']))
$globaldir = 1;
- $safe_mode = get_safemode_setting($observer);
+ $safe_mode = get_directory_settings($observer, 'safemode');
- $pubforums = null;
- if(array_key_exists('pubforums',$_REQUEST))
- $pubforums = intval($_REQUEST['pubforums']);
- if(! $pubforums)
- $pubforums = null;
+ $pubforums = get_directory_settings($observer, 'pubforums');
$o = '';
nav_set_selected('directory');