mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-16 01:35:56 +00:00
feed details enabled for several selected feeds
This commit is contained in:
178
backend.php
178
backend.php
@@ -3302,103 +3302,109 @@
|
|||||||
|
|
||||||
if ($op == "feed-details") {
|
if ($op == "feed-details") {
|
||||||
|
|
||||||
$feed_id = $_GET["id"];
|
// $feed_id = $_GET["id"];
|
||||||
|
|
||||||
$result = db_query($link,
|
$feed_ids = split(",", db_escape_string($_GET["id"]));
|
||||||
"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");
|
|
||||||
|
|
||||||
print "<div class=\"infoBoxContents\">";
|
print "<div class=\"infoBoxContents\">";
|
||||||
|
|
||||||
$icon_file = ICONS_DIR . "/$feed_id.ico";
|
foreach ($feed_ids as $feed_id) {
|
||||||
|
|
||||||
if (file_exists($icon_file) && filesize($icon_file) > 0) {
|
$result = db_query($link,
|
||||||
$feed_icon = "<img width=\"16\" height=\"16\"
|
"SELECT
|
||||||
src=\"" . ICONS_URL . "/$feed_id.ico\">";
|
title,feed_url,
|
||||||
} else {
|
SUBSTRING(last_updated,1,16) as last_updated,
|
||||||
$feed_icon = "";
|
icon_url,site_url,
|
||||||
}
|
(SELECT COUNT(int_id) FROM ttrss_user_entries
|
||||||
|
WHERE feed_id = id) AS total,
|
||||||
print "<h1>$feed_icon $title</h1>";
|
(SELECT COUNT(int_id) FROM ttrss_user_entries
|
||||||
|
WHERE feed_id = id AND unread = true) AS unread,
|
||||||
print "<table width='100%'>";
|
(SELECT COUNT(int_id) FROM ttrss_user_entries
|
||||||
|
WHERE feed_id = id AND marked = true) AS marked
|
||||||
if ($site_url) {
|
FROM ttrss_feeds
|
||||||
print "<tr><td width='30%'>Link</td>
|
WHERE id = '$feed_id' AND owner_uid = ".$_SESSION["uid"]);
|
||||||
<td><a href=\"$site_url\">$site_url</a>
|
|
||||||
<a href=\"$feed_url\">(feed)</a></td>
|
|
||||||
</td></tr>";
|
|
||||||
} else {
|
|
||||||
print "<tr><td width='30%'>Feed URL</td>
|
|
||||||
<td><a href=\"$feed_url\">$feed_url</a></td></tr>";
|
|
||||||
}
|
|
||||||
print "<tr><td>Last updated</td><td>$last_updated</td></tr>";
|
|
||||||
print "<tr><td>Total articles</td><td>$total</td></tr>";
|
|
||||||
print "<tr><td>Unread articles</td><td>$unread</td></tr>";
|
|
||||||
print "<tr><td>Starred articles</td><td>$marked</td></tr>";
|
|
||||||
print "<tr><td>Subscribed users</td><td>$subscribed</td></tr>";
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
$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 "<h1>Latest headlines</h1>";
|
|
||||||
|
|
||||||
print "<ul class=\"nomarks\">";
|
|
||||||
|
|
||||||
while ($line = db_fetch_assoc($result)) {
|
if (db_num_rows($result) == 0) return;
|
||||||
if ($line["unread"] == "t" || $line["unread"] == "1") {
|
|
||||||
$line["title"] = "<b>" . $line["title"] . "</b>";
|
$title = db_unescape_string(db_fetch_result($result, 0, "title"));
|
||||||
}
|
$last_updated = date(get_pref($link, 'LONG_DATE_FORMAT'),
|
||||||
print "<li>" . $line["title"].
|
strtotime(db_fetch_result($result, 0, "last_updated")));
|
||||||
" <span class=\"insensitive\">(" .
|
$feed_url = db_fetch_result($result, 0, "feed_url");
|
||||||
date(get_pref($link, 'SHORT_DATE_FORMAT'),
|
$icon_url = db_fetch_result($result, 0, "icon_url");
|
||||||
strtotime($line["updated"])).
|
$total = db_fetch_result($result, 0, "total");
|
||||||
")</span></li>";
|
$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 = "<img width=\"16\" height=\"16\"
|
||||||
|
src=\"" . ICONS_URL . "/$feed_id.ico\">";
|
||||||
|
} else {
|
||||||
|
$feed_icon = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</ul>";
|
print "<h1>$feed_icon $title</h1>";
|
||||||
|
|
||||||
print "</div>";
|
print "<table width='100%'>";
|
||||||
|
|
||||||
print "<div align='center'>
|
if ($site_url) {
|
||||||
<input type='submit' class='button'
|
print "<tr><td width='30%'>Link</td>
|
||||||
onclick=\"closeInfoBox()\" value=\"Close this window\"></div>";
|
<td><a href=\"$site_url\">$site_url</a>
|
||||||
|
<a href=\"$feed_url\">(feed)</a></td>
|
||||||
|
</td></tr>";
|
||||||
|
} else {
|
||||||
|
print "<tr><td width='30%'>Feed URL</td>
|
||||||
|
<td><a href=\"$feed_url\">$feed_url</a></td></tr>";
|
||||||
|
}
|
||||||
|
print "<tr><td>Last updated</td><td>$last_updated</td></tr>";
|
||||||
|
print "<tr><td>Total articles</td><td>$total</td></tr>";
|
||||||
|
print "<tr><td>Unread articles</td><td>$unread</td></tr>";
|
||||||
|
print "<tr><td>Starred articles</td><td>$marked</td></tr>";
|
||||||
|
print "<tr><td>Subscribed users</td><td>$subscribed</td></tr>";
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
/* $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 "<h1>Latest headlines</h1>";
|
||||||
|
|
||||||
|
print "<ul class=\"nomarks\">";
|
||||||
|
|
||||||
|
while ($line = db_fetch_assoc($result)) {
|
||||||
|
if ($line["unread"] == "t" || $line["unread"] == "1") {
|
||||||
|
$line["title"] = "<b>" . $line["title"] . "</b>";
|
||||||
|
}
|
||||||
|
print "<li>" . $line["title"].
|
||||||
|
" <span class=\"insensitive\">(" .
|
||||||
|
date(get_pref($link, 'SHORT_DATE_FORMAT'),
|
||||||
|
strtotime($line["updated"])).
|
||||||
|
")</span></li>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</ul>";
|
||||||
|
|
||||||
|
} */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
print "<div align='center'>
|
||||||
|
<input type='submit' class='button'
|
||||||
|
onclick=\"closeInfoBox()\" value=\"Close this window\"></div>";
|
||||||
|
}
|
||||||
|
|
||||||
db_close($link);
|
db_close($link);
|
||||||
?>
|
?>
|
||||||
|
|||||||
13
prefs.js
13
prefs.js
@@ -1000,16 +1000,17 @@ function selectedFeedDetails() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rows.length > 1) {
|
// if (rows.length > 1) {
|
||||||
notify("Please select one feed.");
|
// notify("Please select one feed.");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
var id = rows[0];
|
// var id = rows[0];
|
||||||
|
|
||||||
notify("");
|
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.onreadystatechange=infobox_callback;
|
||||||
xmlhttp.send(null);
|
xmlhttp.send(null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user