Directory sorting as a dropdown, forum filter as checkbox, option to sort oldest first

This commit is contained in:
Stefan Parviainen
2014-12-06 14:55:23 +01:00
parent 3855be4910
commit 647311db3e
4 changed files with 28 additions and 10 deletions

View File

@@ -51,13 +51,30 @@ function check_upstream_directory() {
}
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
$url = 'directory?';
$tmp = $_REQUEST;
unset($tmp['order']);
$sorturl = $url . http_build_query($tmp);
$tmp = $_REQUEST;
unset($tmp['pubforums']);
$forumsurl = $url . http_build_query($tmp);
$o = replace_macros(get_markup_template('dir_sort_links.tpl'), array(
'$header' => t('Directory Options'),
'$normal' => t('Alphabetic'),
'$reverse' => t('Reverse Alphabetic'),
'$date' => t('Newest to Oldest'),
'$reversedate' => t('Oldest to Newest'),
'$pubforums' => t('Public Forums Only'),
'$pubforumsonly' => x($_REQUEST,'pubforums') ? $_REQUEST['pubforums'] : '',
'$sort' => t('Sort'),
'$selected_sort' => x($_REQUEST,'order') ? $_REQUEST['order'] : 'normal',
'$sorturl' => $sorturl,
'$forumsurl' => $forumsurl,
));
return $o;
}