From 57eb0576b018902d020bbf17e5b38a4ed7c440fd Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 12 Dec 2010 18:43:32 -0800 Subject: make both content and people search POSTable --- mod/directory.php | 13 ++++++++++++- mod/search.php | 11 ++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/directory.php b/mod/directory.php index 703c08ce1..e9bbf47ab 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -3,11 +3,22 @@ function directory_init(&$a) { $a->set_pager_itemspage(60); } + +function directory_post(&$a) { + if(x($_POST,'search')) + $a->data['search'] = $_POST['search']; +} + + + function directory_content(&$a) { $o = ''; $o .= ''; - $search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : ''); + if(x($a->data,'search')) + $search = notags(trim($a->data['search'])); + else + $search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : ''); $tpl = load_view_file('view/directory_header.tpl'); diff --git a/mod/search.php b/mod/search.php index 78a4a3d53..7605e9ae2 100644 --- a/mod/search.php +++ b/mod/search.php @@ -1,13 +1,22 @@ data['search'] = $_POST['search']; +} + + function search_content(&$a) { $o = '' . "\r\n"; $o .= '

' . t('Search') . '

'; - $search = ((x($_GET,'search')) ? rawurldecode($_GET['search']) : ''); + if(x($a->data,'search')) + $search = notags(trim($a->data['search'])); + else + $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : ''); $o .= search($search); -- cgit v1.2.3