update feedbrowser

This commit is contained in:
Andrew Dolgov 2011-04-21 08:43:37 +04:00
parent 2b9c4bae07
commit 1c36d3aaa9
1 changed files with 24 additions and 62 deletions

View File

@ -1545,14 +1545,14 @@
AND owner_uid = '$owner_uid') $search_qpart AND owner_uid = '$owner_uid') $search_qpart
ORDER BY subscribers DESC LIMIT $limit"); */ ORDER BY subscribers DESC LIMIT $limit"); */
$result = db_query($link, "SELECT feed_url, title, SUM(subscribers) AS subscribers FROM $result = db_query($link, "SELECT feed_url, site_url, title, SUM(subscribers) AS subscribers FROM
(SELECT feed_url, title, subscribers FROM ttrss_feedbrowser_cache UNION ALL (SELECT feed_url, site_url, title, subscribers FROM ttrss_feedbrowser_cache UNION ALL
SELECT feed_url, title, subscribers FROM ttrss_linked_feeds) AS qqq SELECT feed_url, site_url, title, subscribers FROM ttrss_linked_feeds) AS qqq
WHERE WHERE
(SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf
WHERE tf.feed_url = qqq.feed_url WHERE tf.feed_url = qqq.feed_url
AND owner_uid = '$owner_uid') $search_qpart 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) { } else if ($mode == 2) {
$result = db_query($link, "SELECT *, $result = db_query($link, "SELECT *,
@ -1574,66 +1574,33 @@
if ($mode == 1) { if ($mode == 1) {
$feed_url = $line["feed_url"]; $feed_url = htmlspecialchars($line["feed_url"]);
$site_url = htmlspecialchars($line["site_url"]);
$subscribers = $line["subscribers"]; $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 = "<img style=\"vertical-align : middle\" class=\"tinyFeedIcon\" src=\"" . ICONS_URL .
"/".$details["id"].".ico\">";
} else {
$feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
}
$check_box = "<input onclick='toggleSelectListRow2(this)' $check_box = "<input onclick='toggleSelectListRow2(this)'
dojoType=\"dijit.form.CheckBox\" dojoType=\"dijit.form.CheckBox\"
type=\"checkbox\" \">"; type=\"checkbox\" \">";
$class = ($feedctr % 2) ? "even" : "odd"; $class = ($feedctr % 2) ? "even" : "odd";
$feed_url = htmlspecialchars($line["feed_url"]); $site_url = "<a target=\"_blank\"
href=\"$site_url\">
<span class=\"fb_feedTitle\">".
htmlspecialchars($line["title"])."</span></a>";
if ($details["site_url"]) { $feed_url = "<a target=\"_blank\" class=\"fb_feedUrl\"
$site_url = "<a target=\"_blank\" href=\"". href=\"$feed_url\"><img src='images/feed-icon-12x12.png'
htmlspecialchars($details["site_url"])."\"> style='vertical-align : middle'></a>";
<img style='border-width : 0px' src='images/www.png' alt='www'></a>";
} else {
$site_url = "";
}
$feed_url = "<a class=\"fb_feedUrl\" target=\"_blank\" $rv .= "<li>$check_box $feed_url $site_url".
href=\"$feed_url\"><img "&nbsp;<span class='subscribers'>($subscribers)</span></li>";
style='border-width : 0px; vertical-align : middle'
src='images/feed-icon-12x12.png'></a>";
$rv .= "<li title=\"".htmlspecialchars($details["site_url"])."\">
$check_box".
"$feed_icon $feed_url " .
"<span class=\"fb_feedTitle\">".htmlspecialchars($line["title"]).
"</span>".
"&nbsp;<span class='subscribers'>($subscribers)</span>
$site_url</li>";
} else if ($mode == 2) { } else if ($mode == 2) {
$feed_url = htmlspecialchars($line["feed_url"]); $feed_url = htmlspecialchars($line["feed_url"]);
$site_url = htmlspecialchars($line["site_url"]); $site_url = htmlspecialchars($line["site_url"]);
$title = htmlspecialchars($line["title"]); $title = htmlspecialchars($line["title"]);
$icon_file = ICONS_DIR . "/" . $line["id"] . ".ico";
if (file_exists($icon_file) && filesize($icon_file) > 0) {
$feed_icon = "<img class=\"tinyFeedIcon\" src=\"" . ICONS_URL .
"/".$line["id"].".ico\">";
} else {
$feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
}
$check_box = "<input onclick='toggleSelectListRow2(this)' dojoType=\"dijit.form.CheckBox\" $check_box = "<input onclick='toggleSelectListRow2(this)' dojoType=\"dijit.form.CheckBox\"
type=\"checkbox\">"; type=\"checkbox\">";
@ -1646,23 +1613,18 @@
$archived = ''; $archived = '';
} }
if ($line["site_url"]) { $site_url = "<a target=\"_blank\"
$site_url = "<a target=\"_blank\" href=\"$site_url\"> href=\"$site_url\">
<img style='border-width : 0px' src='images/www.png' alt='www'></a>"; <span class=\"fb_feedTitle\">".
} else { htmlspecialchars($line["title"])."</span></a>";
$site_url = "";
}
$feed_url = "<a target=\"_blank\" href=\"$feed_url\"><img $feed_url = "<a target=\"_blank\" class=\"fb_feedUrl\"
style='border-width : 0px; vertical-align : middle' href=\"$feed_url\"><img src='images/feed-icon-12x12.png'
src='images/feed-icon-12x12.png'></a>"; style='vertical-align : middle'></a>";
$rv .= "<li title='".$line['site_url']."' class='$class'
id=\"FBROW-".$line["id"]."\">".
$check_box . "$feed_icon $feed_url " . $title .
$archived . $site_url . "</li>";
$rv .= "<li id=\"FBROW-".$line["id"]."\">".
"$check_box $feed_url $site_url $archived</li>";
} }
++$feedctr; ++$feedctr;