$result = db_query($link,
"SELECT
- title,feed_url,last_updated,icon_url,
+ title,feed_url,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
$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'");
print "<table width='100%'>";
- print "<tr><td width='30%'>Feed URL</td>
- <td><a href=\"$feed_url\">$feed_url</a></td></tr>";
+ if ($site_url) {
+ print "<tr><td width='30%'>Link</td>
+ <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>";
check_feed_favicon($feed_url, $feed, $link);
}
- $result = db_query($link, "SELECT title,icon_url FROM ttrss_feeds WHERE id = '$feed'");
+ $result = db_query($link, "SELECT title,icon_url,site_url
+ FROM ttrss_feeds WHERE id = '$feed'");
$registered_title = db_fetch_result($result, 0, "title");
$orig_icon_url = db_fetch_result($result, 0, "icon_url");
+ $orig_site_url = db_fetch_result($result, 0, "site_url");
if (!$registered_title) {
$feed_title = db_escape_string($rss->channel["title"]);
- db_query($link, "UPDATE ttrss_feeds SET title = '$feed_title' WHERE id = '$feed'");
+ db_query($link, "UPDATE ttrss_feeds SET
+ title = '$feed_title' WHERE id = '$feed'");
+ }
+
+ if (!$orig_site_url && $rss->channel["link"]) {
+ $site_url = db_escape_string($rss->channel["link"]);
+ db_query($link, "UPDATE ttrss_feeds SET
+ site_url = '$site_url' WHERE id = '$feed'");
}
// print "I: " . $rss->channel["image"]["url"];