From da7e3e91bf6051d342819d596b76dd4e05740cd6 Mon Sep 17 00:00:00 2001 From: Grant Pannell Date: Sun, 2 Nov 2014 16:40:10 +1030 Subject: Fix allow duplicate posts feature with optimizations from 1.14 --- include/rssfuncs.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/rssfuncs.php') diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 6d9247a7b..1a3c2bc43 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -707,7 +707,11 @@ db_query("UPDATE ttrss_entries SET date_updated = NOW() WHERE id = '$base_entry_id'"); - continue; + // if we allow duplicate posts, we have to continue to + // create the user entries for this feed + if (!get_pref("ALLOW_DUPLICATE_POSTS", $owner_uid, false)) { + continue; + } } _debug("hash differs, applying plugin filters:", $debug_enabled); -- cgit v1.2.3-54-g00ecf From 6383c9c53a280e50216fea88a9852fee46b41229 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Nov 2014 19:36:58 +0300 Subject: when registering feed title, consider its maximum length (closes #818) --- include/rssfuncs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/rssfuncs.php') diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 6d9247a7b..1c1f18269 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -481,7 +481,7 @@ if (!$registered_title || $registered_title == "[Unknown]") { - $feed_title = db_escape_string($rss->get_title()); + $feed_title = db_escape_string(mb_substr($rss->get_title(), 0, 199); if ($feed_title) { _debug("registering title: $feed_title", $debug_enabled); -- cgit v1.2.3-54-g00ecf From e44280a0bd650239ef1d931d1d41cb0379df4eb9 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Nov 2014 20:08:58 +0300 Subject: fix typo (refs #818) --- include/rssfuncs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/rssfuncs.php') diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 807b041a3..4cd0f6888 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -481,7 +481,7 @@ if (!$registered_title || $registered_title == "[Unknown]") { - $feed_title = db_escape_string(mb_substr($rss->get_title(), 0, 199); + $feed_title = db_escape_string(mb_substr($rss->get_title(), 0, 199)); if ($feed_title) { _debug("registering title: $feed_title", $debug_enabled); @@ -707,7 +707,7 @@ db_query("UPDATE ttrss_entries SET date_updated = NOW() WHERE id = '$base_entry_id'"); - // if we allow duplicate posts, we have to continue to + // if we allow duplicate posts, we have to continue to // create the user entries for this feed if (!get_pref("ALLOW_DUPLICATE_POSTS", $owner_uid, false)) { continue; -- cgit v1.2.3-54-g00ecf From c9299c28c67a2694d4eb75ea7824a5cab5c58a2e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 19 Jan 2015 12:51:59 +0300 Subject: comment out old-school test trgm code --- include/rssfuncs.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/rssfuncs.php') diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 4cd0f6888..9d3d89c7f 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -683,6 +683,7 @@ "link" => $entry_link, "tags" => $entry_tags, "author" => $entry_author, + "force_catchup" => false, // ugly hack for the time being "language" => $entry_language, // read only "feed" => array("id" => $feed, "fetch_url" => $fetch_url, @@ -737,6 +738,9 @@ $entry_author = db_escape_string($article["author"]); $entry_link = db_escape_string($article["link"]); $entry_content = $article["content"]; // escaped below + $entry_force_catchup = $article["force_catchup"]; + + _debug("force catchup: $entry_force_catchup"); if ($cache_images && is_writable(CACHE_DIR . '/images')) cache_images($entry_content, $site_url, $debug_enabled); @@ -861,7 +865,7 @@ _debug("user record not found, creating...", $debug_enabled); - if ($score >= -500 && !find_article_filter($article_filters, 'catchup')) { + if ($score >= -500 && !find_article_filter($article_filters, 'catchup') && !$entry_force_catchup) { $unread = 'true'; $last_read_qpart = 'NULL'; } else { @@ -883,7 +887,7 @@ // N-grams - if (DB_TYPE == "pgsql" and defined('_NGRAM_TITLE_DUPLICATE_THRESHOLD')) { + /* if (DB_TYPE == "pgsql" and defined('_NGRAM_TITLE_DUPLICATE_THRESHOLD')) { $result = db_query("SELECT COUNT(*) AS similar FROM ttrss_entries,ttrss_user_entries @@ -898,7 +902,7 @@ if ($ngram_similar > 0) { $unread = 'false'; } - } + } */ $last_marked = ($marked == 'true') ? 'NOW()' : 'NULL'; $last_published = ($published == 'true') ? 'NOW()' : 'NULL'; -- cgit v1.2.3-54-g00ecf