aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-07-07 16:50:25 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-07-07 16:50:25 -0700
commit6b41074396f72f8c47e3d6479b1035cde4a5c7f8 (patch)
tree4c1a32fcd5c5c5db13c4418241af974d9dedd5d2 /mod
parent7db1bd23f0056a5918f6f1657fdc3a968c18574e (diff)
parentf6cf992aee86e69d1ea5790c22d4af40c266d79e (diff)
downloadvolse-hubzilla-6b41074396f72f8c47e3d6479b1035cde4a5c7f8.tar.gz
volse-hubzilla-6b41074396f72f8c47e3d6479b1035cde4a5c7f8.tar.bz2
volse-hubzilla-6b41074396f72f8c47e3d6479b1035cde4a5c7f8.zip
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Diffstat (limited to 'mod')
-rw-r--r--mod/directory.php35
1 files changed, 24 insertions, 11 deletions
diff --git a/mod/directory.php b/mod/directory.php
index f01efc053..3c230e173 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' : ''
));