Remove deprecated $match_on
This commit is contained in:
parent
2a3b6de0ef
commit
ca5d9be49f
|
@ -194,11 +194,10 @@ class API extends Handler {
|
||||||
|
|
||||||
$search = db_escape_string($_REQUEST["search"]);
|
$search = db_escape_string($_REQUEST["search"]);
|
||||||
$search_mode = db_escape_string($_REQUEST["search_mode"]);
|
$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,
|
$headlines = $this->api_get_headlines($this->link, $feed_id, $limit, $offset,
|
||||||
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, false,
|
$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);
|
$include_nested, $sanitize_content);
|
||||||
|
|
||||||
print $this->wrap(self::STATUS_OK, $headlines);
|
print $this->wrap(self::STATUS_OK, $headlines);
|
||||||
|
@ -584,11 +583,11 @@ class API extends Handler {
|
||||||
static function api_get_headlines($link, $feed_id, $limit, $offset,
|
static function api_get_headlines($link, $feed_id, $limit, $offset,
|
||||||
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, $order,
|
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, $order,
|
||||||
$include_attachments, $since_id,
|
$include_attachments, $since_id,
|
||||||
$search = "", $search_mode = "", $match_on = "",
|
$search = "", $search_mode = "",
|
||||||
$include_nested = false, $sanitize_content = true) {
|
$include_nested = false, $sanitize_content = true) {
|
||||||
|
|
||||||
$qfh_ret = queryFeedHeadlines($link, $feed_id, $limit,
|
$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);
|
$order, $offset, 0, false, $since_id, $include_nested);
|
||||||
|
|
||||||
$result = $qfh_ret[0];
|
$result = $qfh_ret[0];
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Feeds extends Handler_Protected {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function format_headline_subtoolbar($feed_site_url, $feed_title,
|
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) {
|
$search_mode, $view_mode, $error) {
|
||||||
|
|
||||||
$page_prev_link = "viewFeedGoPage(-1)";
|
$page_prev_link = "viewFeedGoPage(-1)";
|
||||||
|
@ -50,7 +50,7 @@ class Feeds extends Handler_Protected {
|
||||||
if ($is_cat) $cat_q = "&is_cat=$is_cat";
|
if ($is_cat) $cat_q = "&is_cat=$is_cat";
|
||||||
|
|
||||||
if ($search) {
|
if ($search) {
|
||||||
$search_q = "&q=$search&m=$match_on&smode=$search_mode";
|
$search_q = "&q=$search&smode=$search_mode";
|
||||||
} else {
|
} else {
|
||||||
$search_q = "";
|
$search_q = "";
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,6 @@ class Feeds extends Handler_Protected {
|
||||||
}
|
}
|
||||||
|
|
||||||
@$search_mode = db_escape_string($_REQUEST["search_mode"]);
|
@$search_mode = db_escape_string($_REQUEST["search_mode"]);
|
||||||
$match_on = "both"; // deprecated, TODO: remove
|
|
||||||
|
|
||||||
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H0", $timing_info);
|
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H0", $timing_info);
|
||||||
|
|
||||||
|
@ -219,7 +218,7 @@ class Feeds extends Handler_Protected {
|
||||||
}
|
}
|
||||||
// error_log("search_mode: " . $search_mode);
|
// error_log("search_mode: " . $search_mode);
|
||||||
$qfh_ret = queryFeedHeadlines($this->link, $feed, $limit, $view_mode, $cat_view,
|
$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);
|
false, 0, $include_children);
|
||||||
|
|
||||||
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H1", $timing_info);
|
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H1", $timing_info);
|
||||||
|
@ -233,7 +232,7 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
$reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url,
|
$reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url,
|
||||||
$feed_title,
|
$feed_title,
|
||||||
$feed, $cat_view, $search, $match_on, $search_mode, $view_mode,
|
$feed, $cat_view, $search, $search_mode, $view_mode,
|
||||||
$last_error);
|
$last_error);
|
||||||
|
|
||||||
$headlines_count = db_num_rows($result);
|
$headlines_count = db_num_rows($result);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
class Handler_Public extends Handler {
|
class Handler_Public extends Handler {
|
||||||
|
|
||||||
private function generate_syndicated_feed($owner_uid, $feed, $is_cat,
|
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') {
|
$view_mode = false, $format = 'atom') {
|
||||||
|
|
||||||
require_once "lib/MiniTemplator.class.php";
|
require_once "lib/MiniTemplator.class.php";
|
||||||
|
@ -25,7 +25,7 @@ class Handler_Public extends Handler {
|
||||||
|
|
||||||
$qfh_ret = queryFeedHeadlines($this->link, $feed,
|
$qfh_ret = queryFeedHeadlines($this->link, $feed,
|
||||||
$limit, $view_mode, $is_cat, $search, $search_mode,
|
$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);
|
false, 0, false, true);
|
||||||
|
|
||||||
$result = $qfh_ret[0];
|
$result = $qfh_ret[0];
|
||||||
|
@ -314,7 +314,6 @@ class Handler_Public extends Handler {
|
||||||
$offset = (int)db_escape_string($_REQUEST["offset"]);
|
$offset = (int)db_escape_string($_REQUEST["offset"]);
|
||||||
|
|
||||||
$search = db_escape_string($_REQUEST["q"]);
|
$search = db_escape_string($_REQUEST["q"]);
|
||||||
$match_on = db_escape_string($_REQUEST["m"]);
|
|
||||||
$search_mode = db_escape_string($_REQUEST["smode"]);
|
$search_mode = db_escape_string($_REQUEST["smode"]);
|
||||||
$view_mode = db_escape_string($_REQUEST["view-mode"]);
|
$view_mode = db_escape_string($_REQUEST["view-mode"]);
|
||||||
|
|
||||||
|
@ -338,7 +337,7 @@ class Handler_Public extends Handler {
|
||||||
|
|
||||||
if ($owner_id) {
|
if ($owner_id) {
|
||||||
$this->generate_syndicated_feed($owner_id, $feed, $is_cat, $limit,
|
$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 {
|
} else {
|
||||||
header('HTTP/1.1 403 Forbidden');
|
header('HTTP/1.1 403 Forbidden');
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Pref_Filters extends Handler_Protected {
|
||||||
$feed_title = getFeedTitle($this->link, $feed);
|
$feed_title = getFeedTitle($this->link, $feed);
|
||||||
|
|
||||||
$qfh_ret = queryFeedHeadlines($this->link, -4, 30, "", false, false, false,
|
$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 = $qfh_ret[0];
|
||||||
|
|
||||||
|
@ -370,9 +370,9 @@ class Pref_Filters extends Handler_Protected {
|
||||||
|
|
||||||
$result = db_query($this->link, "SELECT description FROM ttrss_filter_types
|
$result = db_query($this->link, "SELECT description FROM ttrss_filter_types
|
||||||
WHERE id = ".(int)$rule["filter_type"]);
|
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() {
|
function printRuleName() {
|
||||||
|
|
|
@ -2060,7 +2060,7 @@
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
function search_to_sql($link, $search, $match_on) {
|
function search_to_sql($link, $search) {
|
||||||
|
|
||||||
$search_query_part = "";
|
$search_query_part = "";
|
||||||
|
|
||||||
|
@ -2107,13 +2107,9 @@
|
||||||
//$k = date("Y-m-d", strtotime(substr($k, 1)));
|
//$k = date("Y-m-d", strtotime(substr($k, 1)));
|
||||||
|
|
||||||
array_push($query_keywords, "(".SUBSTRING_FOR_DATE."(updated,1,LENGTH('$k')) $not = '$k')");
|
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%')
|
array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
|
||||||
OR UPPER(ttrss_entries.content) $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%'))");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2150,7 +2146,7 @@
|
||||||
return $rv;
|
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"];
|
if (!$owner_uid) $owner_uid = $_SESSION["uid"];
|
||||||
|
|
||||||
|
@ -2167,7 +2163,7 @@
|
||||||
$search_query_part = "ref_id = -1 AND ";
|
$search_query_part = "ref_id = -1 AND ";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$search_query_part = search_to_sql($link, $search, $match_on);
|
$search_query_part = search_to_sql($link, $search);
|
||||||
$search_query_part .= " AND ";
|
$search_query_part .= " AND ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -341,14 +341,12 @@
|
||||||
|
|
||||||
if ($search) {
|
if ($search) {
|
||||||
$search_mode = 'this_feed';
|
$search_mode = 'this_feed';
|
||||||
$match_on = 'both';
|
|
||||||
} else {
|
} else {
|
||||||
$search_mode = '';
|
$search_mode = '';
|
||||||
$match_on = '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$qfh_ret = queryFeedHeadlines($link, $feed_id, $limit,
|
$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);
|
"score DESC, date_entered ".(mobile_get_pref($link, 'REVERSE_HEADLINES') ? 'ASC' : 'DESC'), $offset);
|
||||||
|
|
||||||
$result = $qfh_ret[0];
|
$result = $qfh_ret[0];
|
||||||
|
|
Loading…
Reference in New Issue