From dfd5cc57c2134067dc6229b8583b5e808f160004 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 3 Oct 2011 14:47:18 -0700 Subject: tagmatch available to anon, add paging variable to query --- mod/tagmatch.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'mod/tagmatch.php') diff --git a/mod/tagmatch.php b/mod/tagmatch.php index b2313694b..8023fa433 100644 --- a/mod/tagmatch.php +++ b/mod/tagmatch.php @@ -3,24 +3,22 @@ function tagmatch_content(&$a) { - $search = $_REQUEST['search']; + $search = notags(trim($_REQUEST['search'])); $o = ''; - if(! local_user()) - return; - - $o .= '

' . t('Tag Match') . ' - ' . notags($search) . '

'; + $o .= '

' . t('Tag Match') . ' - ' . $search . '

'; if($search) { - $params['s'] = $search; - if($a->pager['page'] != 1) - $params['p'] = $a->pager['page']; + + $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : ''); if(strlen(get_config('system','directory_submit_url'))) - $x = fetch_url('http://dir.friendika.com/lsearch?f=&search=' . urlencode($search)); + $x = fetch_url('http://dir.friendika.com/lsearch?f=' . $p . '&search=' . urlencode($search)); + +//TODO fallback local search if global dir not available. // else -// $x = post_url($a->get_baseurl() . '/msearch', $params); +// $x = post_url($a->get_baseurl() . '/lsearch', $params); $j = json_decode($x); -- cgit v1.2.3