diff --git a/backend.php b/backend.php
index cd7d65c2d..9f328bf43 100644
--- a/backend.php
+++ b/backend.php
@@ -2175,7 +2175,7 @@
$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
@@ -2194,7 +2194,7 @@
$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'");
@@ -2216,8 +2216,15 @@
print "
";
- print "Feed URL |
- $feed_url |
";
+ 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 |
";
diff --git a/functions.php b/functions.php
index 37ad6c1d4..77388106c 100644
--- a/functions.php
+++ b/functions.php
@@ -180,14 +180,23 @@
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"];