From 1c36d3aaa957270a768043508c9b7384710f7700 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Apr 2011 08:43:37 +0400 Subject: [PATCH] update feedbrowser --- modules/pref-feeds.php | 86 ++++++++++++------------------------------ 1 file changed, 24 insertions(+), 62 deletions(-) diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 3211987c..794916c8 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -1545,14 +1545,14 @@ AND owner_uid = '$owner_uid') $search_qpart ORDER BY subscribers DESC LIMIT $limit"); */ - $result = db_query($link, "SELECT feed_url, title, SUM(subscribers) AS subscribers FROM - (SELECT feed_url, title, subscribers FROM ttrss_feedbrowser_cache UNION ALL - SELECT feed_url, title, subscribers FROM ttrss_linked_feeds) AS qqq + $result = db_query($link, "SELECT feed_url, site_url, title, SUM(subscribers) AS subscribers FROM + (SELECT feed_url, site_url, title, subscribers FROM ttrss_feedbrowser_cache UNION ALL + SELECT feed_url, site_url, title, subscribers FROM ttrss_linked_feeds) AS qqq WHERE (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf WHERE tf.feed_url = qqq.feed_url AND owner_uid = '$owner_uid') $search_qpart - GROUP BY feed_url, title ORDER BY subscribers DESC LIMIT $limit"); + GROUP BY feed_url, site_url, title ORDER BY subscribers DESC LIMIT $limit"); } else if ($mode == 2) { $result = db_query($link, "SELECT *, @@ -1574,66 +1574,33 @@ if ($mode == 1) { - $feed_url = $line["feed_url"]; + $feed_url = htmlspecialchars($line["feed_url"]); + $site_url = htmlspecialchars($line["site_url"]); $subscribers = $line["subscribers"]; - $det_result = db_query($link, "SELECT site_url,title,id - FROM ttrss_feeds WHERE feed_url = '$feed_url' LIMIT 1"); - - $details = db_fetch_assoc($det_result); - - $icon_file = ICONS_DIR . "/" . $details["id"] . ".ico"; - - if (file_exists($icon_file) && filesize($icon_file) > 0) { - $feed_icon = ""; - } else { - $feed_icon = ""; - } - $check_box = ""; $class = ($feedctr % 2) ? "even" : "odd"; - $feed_url = htmlspecialchars($line["feed_url"]); + $site_url = " + ". + htmlspecialchars($line["title"]).""; - if ($details["site_url"]) { - $site_url = " - www"; - } else { - $site_url = ""; - } - - $feed_url = ""; + $feed_url = ""; - $rv .= "
  • - $check_box". - "$feed_icon $feed_url " . - "".htmlspecialchars($line["title"]). - "". - " ($subscribers) - $site_url
  • "; + $rv .= "
  • $check_box $feed_url $site_url". + " ($subscribers)
  • "; } else if ($mode == 2) { $feed_url = htmlspecialchars($line["feed_url"]); $site_url = htmlspecialchars($line["site_url"]); $title = htmlspecialchars($line["title"]); - $icon_file = ICONS_DIR . "/" . $line["id"] . ".ico"; - - if (file_exists($icon_file) && filesize($icon_file) > 0) { - $feed_icon = ""; - } else { - $feed_icon = ""; - } - $check_box = ""; @@ -1646,23 +1613,18 @@ $archived = ''; } - if ($line["site_url"]) { - $site_url = " - www"; - } else { - $site_url = ""; - } - - $feed_url = ""; + $site_url = " + ". + htmlspecialchars($line["title"]).""; - $rv .= "
  • ". - $check_box . "$feed_icon $feed_url " . $title . - $archived . $site_url . "
  • "; + $feed_url = ""; + $rv .= "
  • ". + "$check_box $feed_url $site_url $archived
  • "; } ++$feedctr; -- 2.39.5