handle site_url in ttrss_feeds (and display in feed details)
This commit is contained in:
parent
4fec9fd779
commit
f324892e58
15
backend.php
15
backend.php
|
@ -2175,7 +2175,7 @@
|
||||||
|
|
||||||
$result = db_query($link,
|
$result = db_query($link,
|
||||||
"SELECT
|
"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
|
(SELECT COUNT(int_id) FROM ttrss_user_entries
|
||||||
WHERE feed_id = id) AS total,
|
WHERE feed_id = id) AS total,
|
||||||
(SELECT COUNT(int_id) FROM ttrss_user_entries
|
(SELECT COUNT(int_id) FROM ttrss_user_entries
|
||||||
|
@ -2194,7 +2194,7 @@
|
||||||
$total = db_fetch_result($result, 0, "total");
|
$total = db_fetch_result($result, 0, "total");
|
||||||
$unread = db_fetch_result($result, 0, "unread");
|
$unread = db_fetch_result($result, 0, "unread");
|
||||||
$marked = db_fetch_result($result, 0, "marked");
|
$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
|
$result = db_query($link, "SELECT COUNT(id) AS subscribed
|
||||||
FROM ttrss_feeds WHERE feed_url = '$feed_url'");
|
FROM ttrss_feeds WHERE feed_url = '$feed_url'");
|
||||||
|
@ -2216,8 +2216,15 @@
|
||||||
|
|
||||||
print "<table width='100%'>";
|
print "<table width='100%'>";
|
||||||
|
|
||||||
print "<tr><td width='30%'>Feed URL</td>
|
if ($site_url) {
|
||||||
<td><a href=\"$feed_url\">$feed_url</a></td></tr>";
|
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>Last updated</td><td>$last_updated</td></tr>";
|
||||||
print "<tr><td>Total articles</td><td>$total</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>Unread articles</td><td>$unread</td></tr>";
|
||||||
|
|
|
@ -180,14 +180,23 @@
|
||||||
check_feed_favicon($feed_url, $feed, $link);
|
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");
|
$registered_title = db_fetch_result($result, 0, "title");
|
||||||
$orig_icon_url = db_fetch_result($result, 0, "icon_url");
|
$orig_icon_url = db_fetch_result($result, 0, "icon_url");
|
||||||
|
$orig_site_url = db_fetch_result($result, 0, "site_url");
|
||||||
|
|
||||||
if (!$registered_title) {
|
if (!$registered_title) {
|
||||||
$feed_title = db_escape_string($rss->channel["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"];
|
// print "I: " . $rss->channel["image"]["url"];
|
||||||
|
|
Loading…
Reference in New Issue