ttrss_entries,ttrss_user_entries,ttrss_feeds
WHERE
$group_limit_part
- ttrss_feeds.hidden = false AND
+ ttrss_feeds.hidden = false AND
+ score >= -500 AND
ttrss_user_entries.feed_id = ttrss_feeds.id AND
ttrss_user_entries.ref_id = ttrss_entries.id AND
ttrss_user_entries.owner_uid = '$owner_uid' AND
FROM
ttrss_entries,ttrss_user_entries,ttrss_tags
WHERE
- ref_id = ttrss_entries.id AND
+ ref_id = ttrss_entries.id AND
+ score >= -500 AND
ttrss_user_entries.owner_uid = '$owner_uid' AND
post_int_id = int_id AND tag_name = '$feed' AND
$view_query_part
$score = $line["score"];
- if ($score < 100) $score_pic = "score_low
+ if ($score > 100) {
+ $score_pic = "score_high.png";
+ } else {
+ $score_pic = "score_neutral.png";
+ }
+
+ $score_title = __("(Click to change)");
+
+ $score_pic = "<img src=\"images/$score_pic\"
+ onclick=\"adjustArticleScore($id, $score)\" title=\"$score $score_title\">";
$entry_author = $line["author"];
# truncate_string($line["feed_title"],30)."</a> </td>";
# } else {
- print "<td class='hlContent' valign='middle'>";
+
+ if ($score > 500) {
+ $hlc_suffix = "H";
+ } else if ($score < -100) {
+ $hlc_suffix = "L";
+ } else {
+ $hlc_suffix = "";
+ }
+
+ print "<td class='hlContent$hlc_suffix' valign='middle'>";
print "<a href=\"javascript:view($id,$feed_id);\">" .
$line["title"];
# }
print "<td class=\"hlUpdated\"><nobr>$updated_fmt </nobr></td>";
-
+
+ print "<td class='hlMarkedPic'>$score_pic</td>";
+
print "</tr>";
} else {
return;
}
+ if ($subop == "setScore") {
+ $id = db_escape_string($_REQUEST["id"]);
+ $score = sprintf("%d", $_REQUEST["score"]);
+
+ $result = db_query($link, "UPDATE ttrss_user_entries SET score = '$score'
+ WHERE ref_id = '$id' AND owner_uid = ".$_SESSION["uid"]);
+
+ print "<rpc-reply><message>Acknowledged.</message></rpc-reply>";
+
+ return;
+
+ }
+
print "<rpc-reply><error>Unknown method: $subop</error></rpc-reply>";
}
?>
cache_empty();
return viewCurrentFeed(0, '')
}
+
+function adjustArticleScore(id, score) {
+ try {
+
+ var pr = prompt(__("Assign score to article:"), score);
+
+ if (pr != undefined) {
+ var query = "backend.php?op=rpc&subop=setScore&id=" + id + "&score=" + pr;
+
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ viewCurrentFeed();
+ } });
+
+ }
+ } catch (e) {
+ exception_error(e, "adjustArticleScore");
+ }
+}