diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/dir_fns.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php index 468e28ae5..cd6d452d6 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -80,6 +80,8 @@ function dir_sort_links() { if ($observer) $safe_mode = get_xconfig($observer,'directory','safe_mode'); + else + $safe_mode = ((array_key_exists('safemode',$_SESSION)) ? intval($_SESSION['safemode']) : false); if($safe_mode === false) $safe_mode = 1; @@ -96,7 +98,7 @@ function dir_sort_links() { // Build urls without order and pubforums so it's easy to tack on the changed value // Probably there's an easier way to do this - $current_order = (($_REQUEST['order']) ? $_REQUEST['order'] : 'normal'); + $current_order = (($_REQUEST['order']) ? $_REQUEST['order'] : 'date'); $url = 'directory?f='; $tmp = array_merge($_GET,$_POST); @@ -107,6 +109,8 @@ function dir_sort_links() { $tmp = array_merge($_GET,$_POST); unset($tmp['pubforums']); + unset($tmp['global']); + unset($tmp['safe']); unset($tmp['q']); unset($tmp['f']); $forumsurl = $url . http_build_query($tmp); @@ -125,7 +129,10 @@ function dir_sort_links() { '$forumsurl' => $forumsurl, '$safemode' => t('Safe Mode'), '$toggle' => $toggle, - '$globaldir' => $globaldir, + '$safemode' => array('safemode', t('Safe Mode'),$safe_mode,'','',' onchange=\'window.location.href="' . $forumsurl . '&safe="+(this.checked ? 1 : 0)\''), + + '$pubforums' => array('pubforums', t('Public Forums Only'),(x($_REQUEST,'pubforums') ? $_REQUEST['pubforums'] : ''),'','',' onchange=\'window.location.href="' . $forumsurl . '&pubforums="+(this.checked ? 1 : 0)\''), + '$globaldir' => array('globaldir', t('This Website Only'), 1-intval($globaldir),'','',' onchange=\'window.location.href="' . $forumsurl . '&global="+(this.checked ? 0 : 1)\''), '$localdir' => t('This Website Only'), )); return $o; |