From d719b062404f551594bbe5ee37f1eb306061c118 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 2 Apr 2013 14:41:41 +0400 Subject: [PATCH] rpc: move setScore to article --- classes/article.php | 11 +++++++++++ classes/rpc.php | 11 ----------- js/viewfeed.js | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/classes/article.php b/classes/article.php index 79c94f59..6e423693 100644 --- a/classes/article.php +++ b/classes/article.php @@ -208,5 +208,16 @@ class Article extends Handler_Protected { } + function setScore() { + $ids = db_escape_string($this->link, $_REQUEST['id']); + $score = (int)db_escape_string($this->link, $_REQUEST['score']); + + db_query($this->link, "UPDATE ttrss_user_entries SET + score = '$score' WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]); + + print json_encode(array("id" => $id, + "score_pic" => get_score_pic($score))); + } + } diff --git a/classes/rpc.php b/classes/rpc.php index 64e09d1e..d61b2891 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -632,17 +632,6 @@ class RPC extends Handler_Protected { return; } - function setScore() { - $ids = db_escape_string($this->link, $_REQUEST['id']); - $score = (int)db_escape_string($this->link, $_REQUEST['score']); - - db_query($this->link, "UPDATE ttrss_user_entries SET - score = '$score' WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]); - - print json_encode(array("id" => $id, - "score_pic" => get_score_pic($score))); - } - function setpanelmode() { $wide = (int) $_REQUEST["wide"]; diff --git a/js/viewfeed.js b/js/viewfeed.js index e3d73b89..be2b88f4 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -2020,7 +2020,7 @@ function setSelectionScore() { var score = prompt(__("Please enter new score for selected articles:"), score); if (score != undefined) { - var query = "op=rpc&method=setScore&id=" + param_escape(ids.toString()) + + var query = "op=article&method=setScore&id=" + param_escape(ids.toString()) + "&score=" + param_escape(score); new Ajax.Request("backend.php", { @@ -2063,7 +2063,7 @@ function changeScore(id, pic) { if (new_score != undefined) { - var query = "op=rpc&method=setScore&id=" + param_escape(id) + + var query = "op=article&method=setScore&id=" + param_escape(id) + "&score=" + param_escape(new_score); new Ajax.Request("backend.php", { -- 2.39.5