From 38426fb135bab4146d9e545be32a3ed6d93e4bf3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 27 Jan 2008 11:58:03 +0100 Subject: [PATCH] feed browser details fixes --- modules/pref-feed-browser.php | 99 +++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 46 deletions(-) diff --git a/modules/pref-feed-browser.php b/modules/pref-feed-browser.php index 0241139a..6e4abce3 100644 --- a/modules/pref-feed-browser.php +++ b/modules/pref-feed-browser.php @@ -13,58 +13,65 @@ print "
"; print "".__('Feed information:').""; - print "
"; $result = db_query($link, "SELECT feed_url,site_url, - SUBSTRING(last_updated,1,19) AS last_updated - FROM ttrss_feeds WHERE id = '$id'"); + SUBSTRING(last_updated,1,19) AS last_updated + FROM ttrss_feeds WHERE id = '$id' AND + auth_login = '' AND auth_pass = ''"); - $feed_url = db_fetch_result($result, 0, "feed_url"); - $site_url = db_fetch_result($result, 0, "site_url"); - $last_updated = db_fetch_result($result, 0, "last_updated"); + if (db_num_rows($result) == 1) { - if (get_pref($link, 'HEADLINES_SMART_DATE')) { - $last_updated = smart_date_time(strtotime($last_updated)); - } else { - $short_date = get_pref($link, 'SHORT_DATE_FORMAT'); - $last_updated = date($short_date, strtotime($last_updated)); - } - - print "Site: $site_url ". - "(feed), ". - "Last updated: $last_updated"; - - print "
"; - - $result = db_query($link, "SELECT - ttrss_entries.title, - content,link, - substring(date_entered,1,19) as date_entered, - substring(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 "
    "; - while ($line = db_fetch_assoc($result)) { - - if (get_pref($link, 'HEADLINES_SMART_DATE')) { - $entry_dt = smart_date_time(strtotime($line["updated"])); - } else { - $short_date = get_pref($link, 'SHORT_DATE_FORMAT'); - $entry_dt = date($short_date, strtotime($line["updated"])); - } - - print "
  • " . $line["title"] . "" . - " ($entry_dt)
  • "; - } - print "
"; + + $feed_url = db_fetch_result($result, 0, "feed_url"); + $site_url = db_fetch_result($result, 0, "site_url"); + $last_updated = db_fetch_result($result, 0, "last_updated"); + + if (get_pref($link, 'HEADLINES_SMART_DATE')) { + $last_updated = smart_date_time(strtotime($last_updated)); + } else { + $short_date = get_pref($link, 'SHORT_DATE_FORMAT'); + $last_updated = date($short_date, strtotime($last_updated)); + } + + print __("Site:")." $site_url ". + "(feed), ". + __("Last updated:")." $last_updated"; + + print "
"; + + $result = db_query($link, "SELECT + ttrss_entries.title, + content,link, + substring(date_entered,1,19) as date_entered, + substring(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 "
"; + } + } else { + print "

".__("Feed not found.")."

"; } print ""; -- 2.39.5