From a72cd54ce142425e6dd36bf7c6c0badb61b96a3f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Jun 2015 22:04:32 +0300 Subject: bayes: properly reset score when going good -> ugly article: add helper to refresh article score pic, properly set scorepic title --- classes/article.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'classes/article.php') diff --git a/classes/article.php b/classes/article.php index 9aef107ec..d43c04f24 100644 --- a/classes/article.php +++ b/classes/article.php @@ -215,6 +215,18 @@ class Article extends Handler_Protected { score = '$score' WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]); print json_encode(array("id" => $ids, + "score" => (int)$score, + "score_pic" => get_score_pic($score))); + } + + function getScore() { + $id = $this->dbh->escape_string($_REQUEST['id']); + + $result = $this->dbh->query("SELECT score FROM ttrss_user_entries WHERE ref_id = $id AND owner_uid = " . $_SESSION["uid"]); + $score = $this->dbh->fetch_result($result, 0, "score"); + + print json_encode(array("id" => $id, + "score" => (int)$score, "score_pic" => get_score_pic($score))); } -- cgit v1.2.3-54-g00ecf