diff --git a/backend.php b/backend.php
index 9e206c93b..4831c201b 100644
--- a/backend.php
+++ b/backend.php
@@ -3302,103 +3302,109 @@
if ($op == "feed-details") {
- $feed_id = $_GET["id"];
+// $feed_id = $_GET["id"];
- $result = db_query($link,
- "SELECT
- title,feed_url,
- SUBSTRING(last_updated,1,16) as last_updated,
- icon_url,site_url,
- (SELECT COUNT(int_id) FROM ttrss_user_entries
- WHERE feed_id = id) AS total,
- (SELECT COUNT(int_id) FROM ttrss_user_entries
- WHERE feed_id = id AND unread = true) AS unread,
- (SELECT COUNT(int_id) FROM ttrss_user_entries
- WHERE feed_id = id AND marked = true) AS marked
- FROM ttrss_feeds
- WHERE id = '$feed_id' AND owner_uid = ".$_SESSION["uid"]);
-
- if (db_num_rows($result) == 0) return;
-
- $title = db_unescape_string(db_fetch_result($result, 0, "title"));
- $last_updated = date(get_pref($link, 'LONG_DATE_FORMAT'),
- strtotime(db_fetch_result($result, 0, "last_updated")));
- $feed_url = db_fetch_result($result, 0, "feed_url");
- $icon_url = db_fetch_result($result, 0, "icon_url");
- $total = db_fetch_result($result, 0, "total");
- $unread = db_fetch_result($result, 0, "unread");
- $marked = db_fetch_result($result, 0, "marked");
- $site_url = db_fetch_result($result, 0, "site_url");
-
- $result = db_query($link, "SELECT COUNT(id) AS subscribed
- FROM ttrss_feeds WHERE feed_url = '$feed_url'");
-
- $subscribed = db_fetch_result($result, 0, "subscribed");
+ $feed_ids = split(",", db_escape_string($_GET["id"]));
print "
";
- $icon_file = ICONS_DIR . "/$feed_id.ico";
+ foreach ($feed_ids as $feed_id) {
- if (file_exists($icon_file) && filesize($icon_file) > 0) {
- $feed_icon = "
";
- } else {
- $feed_icon = "";
- }
-
- print "
$feed_icon $title ";
-
- print "
";
-
- if ($site_url) {
- print "Link
- $site_url
- (feed)
- ";
- } else {
- print "Feed URL
- $feed_url ";
- }
- print "Last updated $last_updated ";
- print "Total articles $total ";
- print "Unread articles $unread ";
- print "Starred articles $marked ";
- print "Subscribed users $subscribed ";
-
- print "
";
-
- $result = db_query($link, "SELECT title,
- SUBSTRING(updated,1,16) AS updated,unread
- FROM ttrss_entries,ttrss_user_entries
- WHERE ref_id = id AND feed_id = '$feed_id'
- ORDER BY date_entered DESC LIMIT 5");
-
- if (db_num_rows($result) > 0) {
-
- print "
Latest headlines ";
-
- print "
";
+ $result = db_query($link,
+ "SELECT
+ title,feed_url,
+ SUBSTRING(last_updated,1,16) as last_updated,
+ icon_url,site_url,
+ (SELECT COUNT(int_id) FROM ttrss_user_entries
+ WHERE feed_id = id) AS total,
+ (SELECT COUNT(int_id) FROM ttrss_user_entries
+ WHERE feed_id = id AND unread = true) AS unread,
+ (SELECT COUNT(int_id) FROM ttrss_user_entries
+ WHERE feed_id = id AND marked = true) AS marked
+ FROM ttrss_feeds
+ WHERE id = '$feed_id' AND owner_uid = ".$_SESSION["uid"]);
- while ($line = db_fetch_assoc($result)) {
- if ($line["unread"] == "t" || $line["unread"] == "1") {
- $line["title"] = "" . $line["title"] . " ";
- }
- print "" . $line["title"].
- " (" .
- date(get_pref($link, 'SHORT_DATE_FORMAT'),
- strtotime($line["updated"])).
- ") ";
+ if (db_num_rows($result) == 0) return;
+
+ $title = db_unescape_string(db_fetch_result($result, 0, "title"));
+ $last_updated = date(get_pref($link, 'LONG_DATE_FORMAT'),
+ strtotime(db_fetch_result($result, 0, "last_updated")));
+ $feed_url = db_fetch_result($result, 0, "feed_url");
+ $icon_url = db_fetch_result($result, 0, "icon_url");
+ $total = db_fetch_result($result, 0, "total");
+ $unread = db_fetch_result($result, 0, "unread");
+ $marked = db_fetch_result($result, 0, "marked");
+ $site_url = db_fetch_result($result, 0, "site_url");
+
+ $result = db_query($link, "SELECT COUNT(id) AS subscribed
+ FROM ttrss_feeds WHERE feed_url = '$feed_url'");
+
+ $subscribed = db_fetch_result($result, 0, "subscribed");
+
+ $icon_file = ICONS_DIR . "/$feed_id.ico";
+
+ if (file_exists($icon_file) && filesize($icon_file) > 0) {
+ $feed_icon = " ";
+ } else {
+ $feed_icon = "";
}
- print " ";
+ print "
$feed_icon $title ";
- print "
";
+ print "";
+
+/* $result = db_query($link, "SELECT title,
+ SUBSTRING(updated,1,16) AS updated,unread
+ FROM ttrss_entries,ttrss_user_entries
+ WHERE ref_id = id AND feed_id = '$feed_id'
+ ORDER BY date_entered DESC LIMIT 5");
+
+ if (db_num_rows($result) > 0) {
+
+ print "Latest headlines ";
+
+ print "";
+
+ while ($line = db_fetch_assoc($result)) {
+ if ($line["unread"] == "t" || $line["unread"] == "1") {
+ $line["title"] = "" . $line["title"] . " ";
+ }
+ print "" . $line["title"].
+ " (" .
+ date(get_pref($link, 'SHORT_DATE_FORMAT'),
+ strtotime($line["updated"])).
+ ") ";
+ }
+
+ print " ";
+
+ } */
}
- }
+
+ print "";
+
+ print "
+
";
+ }
db_close($link);
?>
diff --git a/prefs.js b/prefs.js
index b2c15a23b..244a28862 100644
--- a/prefs.js
+++ b/prefs.js
@@ -1000,16 +1000,17 @@ function selectedFeedDetails() {
return;
}
- if (rows.length > 1) {
- notify("Please select one feed.");
- return;
- }
+// if (rows.length > 1) {
+// notify("Please select one feed.");
+// return;
+// }
- var id = rows[0];
+// var id = rows[0];
notify("");
- xmlhttp.open("GET", "backend.php?op=feed-details&id=" + id, true);
+ xmlhttp.open("GET", "backend.php?op=feed-details&id=" +
+ param_escape(rows.toString()), true);
xmlhttp.onreadystatechange=infobox_callback;
xmlhttp.send(null);