tagmatch available to anon, add paging variable to query

This commit is contained in:
Friendika 2011-10-03 14:47:18 -07:00
parent c6ac438735
commit dfd5cc57c2
2 changed files with 9 additions and 11 deletions

View file

@ -8,7 +8,7 @@ require_once("include/pgettext.php");
require_once('include/nav.php'); require_once('include/nav.php');
define ( 'FRIENDIKA_PLATFORM', 'Free Friendika'); define ( 'FRIENDIKA_PLATFORM', 'Free Friendika');
define ( 'FRIENDIKA_VERSION', '2.3.1122' ); define ( 'FRIENDIKA_VERSION', '2.3.1123' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1094 ); define ( 'DB_UPDATE_VERSION', 1094 );

View file

@ -3,24 +3,22 @@
function tagmatch_content(&$a) { function tagmatch_content(&$a) {
$search = $_REQUEST['search']; $search = notags(trim($_REQUEST['search']));
$o = ''; $o = '';
if(! local_user())
return;
$o .= '<h2>' . t('Tag Match') . ' - ' . notags($search) . '</h2>';
$o .= '<h2>' . t('Tag Match') . ' - ' . $search . '</h2>';
if($search) { if($search) {
$params['s'] = $search;
if($a->pager['page'] != 1) $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : '');
$params['p'] = $a->pager['page'];
if(strlen(get_config('system','directory_submit_url'))) 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 // else
// $x = post_url($a->get_baseurl() . '/msearch', $params); // $x = post_url($a->get_baseurl() . '/lsearch', $params);
$j = json_decode($x); $j = json_decode($x);