diff options
Diffstat (limited to 'mod/directory.php')
-rw-r--r-- | mod/directory.php | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/mod/directory.php b/mod/directory.php index 6d066a21b..44d80cff1 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_setting($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_setting($observer, 'safemode'); - $pubforums = null; - if(array_key_exists('pubforums',$_REQUEST)) - $pubforums = intval($_REQUEST['pubforums']); - if(! $pubforums) - $pubforums = null; + $pubforums = get_directory_setting($observer, 'pubforums'); $o = ''; nav_set_selected('directory'); @@ -375,7 +382,13 @@ function directory_content(&$a) { '$entries' => $entries, '$dirlbl' => $suggest ? t('Channel Suggestions') : $dirtitle, '$submit' => t('Find'), - '$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')) + '$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')), + '$sort' => t('Sort options'), + '$normal' => t('Alphabetic'), + '$reverse' => t('Reverse Alphabetic'), + '$date' => t('Newest to Oldest'), + '$reversedate' => t('Oldest to Newest'), + '$suggest' => $suggest ? '&suggest=1' : '' )); |