From 3585a3c5600d4e3ce69a4b3b11126bf0fa7d5674 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 18 Dec 2009 16:00:58 +0300 Subject: [PATCH] mobile: add feed search --- mobile/feed.php | 3 ++- mobile/functions.php | 54 ++++++++++++++++++++++++++++++++++++-------- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/mobile/feed.php b/mobile/feed.php index 02461b3f..966e1b44 100644 --- a/mobile/feed.php +++ b/mobile/feed.php @@ -23,7 +23,8 @@ $feed_id = db_escape_string($_REQUEST["id"]); $cat_id = db_escape_string($_REQUEST["cat"]); $offset = (int) db_escape_string($_REQUEST["skip"]); + $search = db_escape_string($_REQUEST["search"]); - render_headlines_list($link, $feed_id, $cat_id, $offset); + render_headlines_list($link, $feed_id, $cat_id, $offset, $search); ?> diff --git a/mobile/functions.php b/mobile/functions.php index 30200a13..b6889528 100644 --- a/mobile/functions.php +++ b/mobile/functions.php @@ -217,11 +217,13 @@ function render_categories_list($link) { $owner_uid = $_SESSION["uid"]; - - + print '"; } - function render_headlines_list($link, $feed_id, $cat_id, $offset) { + function render_headlines_list($link, $feed_id, $cat_id, $offset, $search) { $feed_id = $feed_id; $limit = 15; @@ -301,11 +303,13 @@ $is_cat = false; $view_mode = 'adaptive'; - /* do not rely on params below */ - - $search = ''; - $search_mode = ''; - $match_on = ''; + if ($search) { + $search_mode = 'this_feed'; + $match_on = 'both'; + } else { + $search_mode = ''; + $match_on = ''; + } $qfh_ret = queryFeedHeadlines($link, $feed_id, $limit, $view_mode, $is_cat, $search, $search_mode, $match_on, false, $offset); @@ -314,6 +318,23 @@ $feed_title = $qfh_ret[1]; if (!$offset) { + + print "
+ + + + +
+

Search

+ Cancel + Search + + + +
+
"; + if ($cat_id) { $cat_title = getCategoryTitle($link, $cat_id); @@ -323,6 +344,8 @@ print "