";
print "".__('Feed information:')."";
$result = db_query($link, "SELECT
feed_url,site_url,
".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
FROM ttrss_feeds WHERE id = '$id' AND
auth_login = '' AND auth_pass = '' AND private IS NOT true
AND feed_url NOT LIKE '%:%@%/%'");
if (db_num_rows($result) == 1) {
print "
";
$result = db_query($link, "SELECT
ttrss_entries.title,
content,link,
".SUBSTRING_FOR_DATE."(date_entered,1,19) as date_entered,
".SUBSTRING_FOR_DATE."(updated,1,19) as updated
FROM ttrss_entries,ttrss_user_entries
WHERE ttrss_entries.id = ref_id AND feed_id = '$id'
ORDER BY updated DESC LIMIT 5");
if (db_num_rows($result) > 0) {
print "".__('Last headlines:')." ";
print "
";
}
print "";
return;
}
set_pref($link, "_PREFS_ACTIVE_TAB", "feedBrowser");
$limit = db_escape_string($_GET["limit"]);
$browser_search = db_escape_string($_GET["search"]);
if (array_key_exists("search", $_GET)) {
$_SESSION["prefs_browser_search"] = $browser_search;
} else {
$browser_search = $_SESSION["prefs_browser_search"];
}
if (!$limit) $limit = 25;
$owner_uid = $_SESSION["uid"];
/* $result = db_query($link, "SELECT feed_url,COUNT(id) AS subscribers
FROM ttrss_feeds WHERE (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf
WHERE tf.feed_url = ttrss_feeds.feed_url
AND (private IS true OR feed_url LIKE '%:%@%/%' OR
owner_uid = '$owner_uid')) GROUP BY feed_url
ORDER BY subscribers DESC LIMIT $limit"); */
$result = db_query($link, "SELECT COUNT(feed_url) AS cfu FROM
ttrss_feedbrowser_cache");
$cfu = db_fetch_result($result, 0, "cfu");
if ($cfu == 0) {
print_warning(__("Feed browser cache information is missing. Please refer to the wiki for more information."));
return;
}
/* print "
".__('This panel shows feeds subscribed by other users of this system, just in case you are interested in them too.')."
"; */
print "
";
print "
".__('Top')."
";
if ($browser_search) {
$search_qpart = " AND (
UPPER(ttrss_feedbrowser_cache.feed_url) LIKE UPPER('%$browser_search%') OR
UPPER(title) LIKE UPPER('%$browser_search%'))";
} else {
$search_qpart = "";
}
$result = db_query($link, "SELECT ttrss_feedbrowser_cache.feed_url,
subscribers,title
FROM
ttrss_feedbrowser_cache
WHERE
(SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf
WHERE tf.feed_url = ttrss_feedbrowser_cache.feed_url
AND owner_uid = '$owner_uid')
$search_qpart
ORDER BY subscribers DESC LIMIT $limit");
print " ";
if (db_num_rows($result) > 0) {
print "
";
print "
";
$feedctr = 0;
while ($line = db_fetch_assoc($result)) {
$feed_url = db_escape_string($line["feed_url"]);
$subscribers = $line["subscribers"];
// mysql returns NULL records first by default
if (DB_TYPE == "mysql") $order_fix = "DESC";
$det_result = db_query($link, "SELECT site_url,title,id
FROM ttrss_feeds WHERE feed_url = '$feed_url'
ORDER BY last_updated $order_fix LIMIT 1");
$details = db_fetch_assoc($det_result);
if ($details) {
$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";
print "