]> git.wh0rd.org Git - tt-rss.git/commitdiff
Remove deprecated $match_on
authorJoschasa <joschasa@lavabit.com>
Wed, 20 Mar 2013 23:36:30 +0000 (00:36 +0100)
committerJoschasa <joschasa@lavabit.com>
Wed, 20 Mar 2013 23:36:30 +0000 (00:36 +0100)
classes/api.php
classes/feeds.php
classes/handler/public.php
classes/pref/filters.php
include/functions.php
mobile/mobile-functions.php

index 92e19e70a7bdbe37005f83fd3739783445fdd579..5e7ec6573ba711388d9059ac132e9e4ed4ba3676 100644 (file)
@@ -194,11 +194,10 @@ class API extends Handler {
 
                        $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);
@@ -584,11 +583,11 @@ class API extends Handler {
        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];
index 50a265544e1e4b3befdcc3099291d8797ebcb771..caf22322c50dbced0812be2def86a0f082b2ef38 100644 (file)
@@ -22,7 +22,7 @@ class Feeds extends Handler_Protected {
        }
 
        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)";
@@ -50,7 +50,7 @@ class Feeds extends Handler_Protected {
                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 = "";
                }
@@ -209,7 +209,6 @@ class Feeds extends Handler_Protected {
                }
 
                @$search_mode = db_escape_string($_REQUEST["search_mode"]);
-               $match_on = "both"; // deprecated, TODO: remove
 
                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);
                $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);
@@ -233,7 +232,7 @@ class Feeds extends Handler_Protected {
 
                $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);
index 4a9b0c48eeb6ad0a89b8d0f5648f0bd9dd892975..dc1e100498827cf9c64c9dd133af51765d5bfc49 100644 (file)
@@ -2,7 +2,7 @@
 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";
@@ -25,7 +25,7 @@ class Handler_Public extends Handler {
 
                $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];
@@ -314,7 +314,6 @@ class Handler_Public extends Handler {
                $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"]);
 
@@ -338,7 +337,7 @@ class Handler_Public extends Handler {
 
                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');
                }
index 20abae1d00cbd9a90a96017b8882490b0bff0aff..1921f2b97ab3f4ad49cb319b06b1d6b89bda68a0 100644 (file)
@@ -47,7 +47,7 @@ class Pref_Filters extends Handler_Protected {
                $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];
 
@@ -370,9 +370,9 @@ class Pref_Filters extends Handler_Protected {
 
                $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() {
index c917354882f9025d5bcb992da714c6cac882bc87..1a106be0b43134173afc000d6efebe19cc230a15 100644 (file)
                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 ";
                                }
 
index 65bba55df4e764df11f62fad4b3fdbf8118a357c..39b89fa9cb48e0a12dfceb36d9f1b80728069728 100644 (file)
 
                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];