$feed_id = db_escape_string($_GET["feed"]);
$result = db_query($link,
- "SELECT feed_url FROM ttrss_feeds WHERE id = '$feed_id'");
+ "SELECT feed_url FROM ttrss_feeds WHERE id = '$feed_id'
+ AND owner_uid = " . $_SESSION["uid"]);
if (db_num_rows($result) > 0) {
$feed_url = db_fetch_result($result, 0, "feed_url");
-// update_rss_feed($link, $feed_url, $feed_id);
+ update_rss_feed($link, $feed_url, $feed_id);
}
- print "DONE-$feed_id";
-
+ print "<rpc-reply>";
+ getFeedCounter($link, $feed_id);
+ print "</rpc-reply>";
+
return;
}
if ($subop == "unread") {
$ids = split(",", $_GET["ids"]);
foreach ($ids as $id) {
- db_query($link, "UPDATE ttrss_entries SET unread = true WHERE feed_id = '$id'");
+ db_query($link, "UPDATE ttrss_user_entries SET unread = true
+ WHERE feed_id = '$id' AND owner_uid = ".$_SESSION["uid"]);
}
- print "Marked selected feeds as read.";
+ print "Marked selected feeds as unread.";
}
if ($subop == "read") {
$ids = split(",", $_GET["ids"]);
foreach ($ids as $id) {
- db_query($link, "UPDATE ttrss_entries
- SET unread = false,last_read = NOW() WHERE feed_id = '$id'");
+ db_query($link, "UPDATE ttrss_user_entries
+ SET unread = false,last_read = NOW() WHERE
+ feed_id = '$id' AND owner_uid = ".$_SESSION["uid"]);
}
- print "Marked selected feeds as unread.";
+ print "Marked selected feeds as read.";
}