1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 07:25:54 +00:00

bayes: properly reset score when going good -> ugly

article: add helper to refresh article score pic, properly set scorepic title
This commit is contained in:
Andrew Dolgov
2015-06-17 22:04:32 +03:00
parent 308c55c0f1
commit a72cd54ce1
4 changed files with 45 additions and 3 deletions

View File

@@ -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)));
}