From 79e5c2456bfc78296d77d1a4caedd5a32b7d9d12 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 23 Nov 2014 18:54:33 -0800 Subject: [PATCH] add link to search forums in the directory --- include/dir_fns.php | 5 +++-- mod/directory.php | 8 ++++++++ view/tpl/dir_sort_links.tpl | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/dir_fns.php b/include/dir_fns.php index 0ba4f8712..909005bbb 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -53,10 +53,11 @@ function check_upstream_directory() { function dir_sort_links() { $o = replace_macros(get_markup_template('dir_sort_links.tpl'), array( - '$header' => t('Sort Options'), + '$header' => t('Directory Options'), '$normal' => t('Alphabetic'), '$reverse' => t('Reverse Alphabetic'), - '$date' => t('Newest to Oldest') + '$date' => t('Newest to Oldest'), + '$pubforums' => t('Public Forums Only'), )); return $o; } diff --git a/mod/directory.php b/mod/directory.php index 921c8ece7..c06a14d9e 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -96,10 +96,18 @@ function directory_content(&$a) { if(! is_null($pubforums)) $query .= '&pubforums=' . intval($pubforums); + if(! is_null($pubforums)) + $query .= '&pubforums=' . intval($pubforums); + $sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : ''); + if($pubforums) + $sort_order = 'normal'; + if($sort_order) $query .= '&order=' . urlencode($sort_order); + + if($a->pager['page'] != 1) $query .= '&p=' . $a->pager['page']; diff --git a/view/tpl/dir_sort_links.tpl b/view/tpl/dir_sort_links.tpl index f6d8c3454..2fcf0c13a 100644 --- a/view/tpl/dir_sort_links.tpl +++ b/view/tpl/dir_sort_links.tpl @@ -4,5 +4,6 @@
  • {{$normal}}
  • {{$reverse}}
  • {{$date}}
  • +
  • {{$pubforums}}