$search = db_escape_string($_REQUEST["search"]);
$search_mode = db_escape_string($_REQUEST["search_mode"]);
- $match_on = db_escape_string($_REQUEST["match_on"]);
$headlines = $this->api_get_headlines($this->link, $feed_id, $limit, $offset,
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, false,
- $include_attachments, $since_id, $search, $search_mode, $match_on,
+ $include_attachments, $since_id, $search, $search_mode,
$include_nested, $sanitize_content);
print $this->wrap(self::STATUS_OK, $headlines);
static function api_get_headlines($link, $feed_id, $limit, $offset,
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, $order,
$include_attachments, $since_id,
- $search = "", $search_mode = "", $match_on = "",
+ $search = "", $search_mode = "",
$include_nested = false, $sanitize_content = true) {
$qfh_ret = queryFeedHeadlines($link, $feed_id, $limit,
- $view_mode, $is_cat, $search, $search_mode, $match_on,
+ $view_mode, $is_cat, $search, $search_mode,
$order, $offset, 0, false, $since_id, $include_nested);
$result = $qfh_ret[0];
}
private function format_headline_subtoolbar($feed_site_url, $feed_title,
- $feed_id, $is_cat, $search, $match_on,
+ $feed_id, $is_cat, $search,
$search_mode, $view_mode, $error) {
$page_prev_link = "viewFeedGoPage(-1)";
if ($is_cat) $cat_q = "&is_cat=$is_cat";
if ($search) {
- $search_q = "&q=$search&m=$match_on&smode=$search_mode";
+ $search_q = "&q=$search&smode=$search_mode";
} else {
$search_q = "";
}
}
@$search_mode = db_escape_string($_REQUEST["search_mode"]);
- $match_on = "both"; // deprecated, TODO: remove
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H0", $timing_info);
}
// error_log("search_mode: " . $search_mode);
$qfh_ret = queryFeedHeadlines($this->link, $feed, $limit, $view_mode, $cat_view,
- $search, $search_mode, $match_on, $override_order, $offset, 0,
+ $search, $search_mode, $override_order, $offset, 0,
false, 0, $include_children);
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H1", $timing_info);
$reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url,
$feed_title,
- $feed, $cat_view, $search, $match_on, $search_mode, $view_mode,
+ $feed, $cat_view, $search, $search_mode, $view_mode,
$last_error);
$headlines_count = db_num_rows($result);
class Handler_Public extends Handler {
private function generate_syndicated_feed($owner_uid, $feed, $is_cat,
- $limit, $offset, $search, $search_mode, $match_on,
+ $limit, $offset, $search, $search_mode,
$view_mode = false, $format = 'atom') {
require_once "lib/MiniTemplator.class.php";
$qfh_ret = queryFeedHeadlines($this->link, $feed,
$limit, $view_mode, $is_cat, $search, $search_mode,
- $match_on, "$date_sort_field DESC", $offset, $owner_uid,
+ "$date_sort_field DESC", $offset, $owner_uid,
false, 0, false, true);
$result = $qfh_ret[0];
$offset = (int)db_escape_string($_REQUEST["offset"]);
$search = db_escape_string($_REQUEST["q"]);
- $match_on = db_escape_string($_REQUEST["m"]);
$search_mode = db_escape_string($_REQUEST["smode"]);
$view_mode = db_escape_string($_REQUEST["view-mode"]);
if ($owner_id) {
$this->generate_syndicated_feed($owner_id, $feed, $is_cat, $limit,
- $offset, $search, $search_mode, $match_on, $view_mode, $format);
+ $offset, $search, $search_mode, $view_mode, $format);
} else {
header('HTTP/1.1 403 Forbidden');
}
$feed_title = getFeedTitle($this->link, $feed);
$qfh_ret = queryFeedHeadlines($this->link, -4, 30, "", false, false, false,
- false, "date_entered DESC", 0, $_SESSION["uid"], $filter);
+ "date_entered DESC", 0, $_SESSION["uid"], $filter);
$result = $qfh_ret[0];
$result = db_query($this->link, "SELECT description FROM ttrss_filter_types
WHERE id = ".(int)$rule["filter_type"]);
- $match_on = db_fetch_result($result, 0, "description");
+ $filter_type = db_fetch_result($result, 0, "description");
- return T_sprintf("%s on %s in %s", strip_tags($rule["reg_exp"]), $match_on, $feed);
+ return T_sprintf("%s on %s in %s", strip_tags($rule["reg_exp"]), $filter_type, $feed);
}
function printRuleName() {
return $data;
}
- function search_to_sql($link, $search, $match_on) {
+ function search_to_sql($link, $search) {
$search_query_part = "";
//$k = date("Y-m-d", strtotime(substr($k, 1)));
array_push($query_keywords, "(".SUBSTRING_FOR_DATE."(updated,1,LENGTH('$k')) $not = '$k')");
- } else if ($match_on == "both") {
+ } else {
array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
OR UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))");
- } else if ($match_on == "title") {
- array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%'))");
- } else if ($match_on == "content") {
- array_push($query_keywords, "(UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))");
}
}
return $rv;
}
- function queryFeedHeadlines($link, $feed, $limit, $view_mode, $cat_view, $search, $search_mode, $match_on, $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false, $ignore_vfeed_group = false) {
+ function queryFeedHeadlines($link, $feed, $limit, $view_mode, $cat_view, $search, $search_mode, $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false, $ignore_vfeed_group = false) {
if (!$owner_uid) $owner_uid = $_SESSION["uid"];
$search_query_part = "ref_id = -1 AND ";
} else {
- $search_query_part = search_to_sql($link, $search, $match_on);
+ $search_query_part = search_to_sql($link, $search);
$search_query_part .= " AND ";
}
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,
+ $view_mode, $is_cat, $search, $search_mode,
"score DESC, date_entered ".(mobile_get_pref($link, 'REVERSE_HEADLINES') ? 'ASC' : 'DESC'), $offset);
$result = $qfh_ret[0];