$id = $this->dbh->escape_string($_REQUEST["id"]);
$cids = explode(",", $this->dbh->escape_string($_REQUEST["cids"]));
$mode = $this->dbh->escape_string($_REQUEST["mode"]);
- $omode = $this->dbh->escape_string($_REQUEST["omode"]);
// in prefetch mode we only output requested cids, main article
// just gets marked as read (it already exists in client cache)
// only check for our user data here, others might have shared this with different content etc
$result = db_query("SELECT id FROM ttrss_entries, ttrss_user_entries WHERE
- link = '$url' AND ref_id = id AND owner_uid = '$owner_uid' LIMIT 1");
+ guid = '$guid' AND ref_id = id AND owner_uid = '$owner_uid' LIMIT 1");
if (db_num_rows($result) != 0) {
$ref_id = db_fetch_result($result, 0, "id");
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)));
}