From 5defc29ff832d4c7bfb40cab0df1a34d0664409f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 22 Mar 2013 09:49:45 +0400 Subject: [PATCH] remove PTITLE kludge; use ajax --- classes/feeds.php | 3 --- classes/rpc.php | 7 ++++--- include/functions.php | 30 ------------------------------ js/functions.js | 29 ++++++++++++++++++++--------- js/viewfeed.js | 2 +- 5 files changed, 25 insertions(+), 46 deletions(-) diff --git a/classes/feeds.php b/classes/feeds.php index 3a1ac2f5b..7f4c1d6c0 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -533,9 +533,6 @@ class Feeds extends Handler_Protected { $reply['content'] .= ""; - $reply['content'] .= "
" . - htmlspecialchars(strip_tags($line['title'])) . "
"; - $reply['content'] .= " diff --git a/classes/rpc.php b/classes/rpc.php index 6f9064079..ee5a9e68a 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -829,16 +829,17 @@ class RPC extends Handler_Protected { } } - function getlinkbyid() { + function getlinktitlebyid() { $id = db_escape_string($this->link, $_REQUEST['id']); - $result = db_query($this->link, "SELECT link FROM ttrss_entries, ttrss_user_entries + $result = db_query($this->link, "SELECT link, title FROM ttrss_entries, ttrss_user_entries WHERE ref_id = '$id' AND ref_id = id AND owner_uid = ". $_SESSION["uid"]); if (db_num_rows($result) != 0) { $link = db_fetch_result($result, 0, "link"); + $title = db_fetch_result($result, 0, "title"); - echo json_encode(array("link" => $link)); + echo json_encode(array("link" => $link, "title" => $title)); } else { echo json_encode(array("error" => "ARTICLE_NOT_FOUND")); } diff --git a/include/functions.php b/include/functions.php index 7d4ce2918..238ba0121 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2989,11 +2989,6 @@ "; } - $title_escaped = htmlspecialchars($line['title']); - - $rv['content'] .= "
" . - strip_tags($line['title']) . "
"; - $rv['content'] .= "
"; $rv['content'] .= "
"; @@ -3091,31 +3086,6 @@ $rv['content'] .= "
"; - // N-grams - - if (DB_TYPE == "pgsql" and defined('_NGRAM_TITLE_RELATED_THRESHOLD')) { - - $ngram_result = db_query($link, "SELECT id,title FROM - ttrss_entries,ttrss_user_entries - WHERE ref_id = id AND updated >= NOW() - INTERVAL '7 day' - AND similarity(title, '$title_escaped') >= "._NGRAM_TITLE_RELATED_THRESHOLD." - AND title != '$title_escaped' - AND owner_uid = $owner_uid"); - - if (db_num_rows($ngram_result) > 0) { - $rv['content'] .= "
". - "" . __('Related').""; - $rv['content'] .= "
"; - - while ($nline = db_fetch_assoc($ngram_result)) { - $rv['content'] .= "
".$nline['title']."
"; - - } - $rv['content'] .= "