make directory suggest work with directory options

This commit is contained in:
Mario Vavti 2015-07-07 14:46:47 +02:00
parent 18798b1d12
commit b50151d7bf
2 changed files with 7 additions and 3 deletions

View File

@ -113,6 +113,8 @@ function dir_sort_links() {
$safe_mode = get_safemode_setting($observer); $safe_mode = get_safemode_setting($observer);
$globaldir = get_globaldir_setting($observer); $globaldir = get_globaldir_setting($observer);
$suggest = ($_REQUEST['suggest']) ? '&suggest=' . $_REQUEST['suggest'] : '';
// Build urls without order and pubforums so it's easy to tack on the changed value // 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 // Probably there's an easier way to do this
@ -126,18 +128,20 @@ function dir_sort_links() {
$url = 'directory?f='; $url = 'directory?f=';
$tmp = array_merge($_GET,$_POST); $tmp = array_merge($_GET,$_POST);
unset($tmp['suggest']);
unset($tmp['order']); unset($tmp['order']);
unset($tmp['q']); unset($tmp['q']);
unset($tmp['f']); unset($tmp['f']);
$sorturl = $url . http_build_query($tmp); $sorturl = $url . $suggest . http_build_query($tmp);
$tmp = array_merge($_GET,$_POST); $tmp = array_merge($_GET,$_POST);
unset($tmp['suggest']);
unset($tmp['pubforums']); unset($tmp['pubforums']);
unset($tmp['global']); unset($tmp['global']);
unset($tmp['safe']); unset($tmp['safe']);
unset($tmp['q']); unset($tmp['q']);
unset($tmp['f']); unset($tmp['f']);
$forumsurl = $url . http_build_query($tmp); $forumsurl = $url . $suggest . http_build_query($tmp);
$o = replace_macros(get_markup_template('dir_sort_links.tpl'), array( $o = replace_macros(get_markup_template('dir_sort_links.tpl'), array(
'$header' => t('Directory Options'), '$header' => t('Directory Options'),

View File

@ -132,7 +132,7 @@ function widget_suggestions($arr) {
'profile' => $rr['xchan_url'], 'profile' => $rr['xchan_url'],
'name' => $rr['xchan_name'], 'name' => $rr['xchan_name'],
'photo' => $rr['xchan_photo_m'], 'photo' => $rr['xchan_photo_m'],
'ignlnk' => z_root() . '/suggest?ignore=' . $rr['xchan_hash'], 'ignlnk' => z_root() . '/directory?ignore=' . $rr['xchan_hash'],
'conntxt' => t('Connect'), 'conntxt' => t('Connect'),
'connlnk' => $connlnk, 'connlnk' => $connlnk,
'ignore' => t('Ignore/Hide') 'ignore' => t('Ignore/Hide')