From f0855b88af1ee551d6591eb64a9bdecb2f4a7833 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 5 Nov 2010 18:48:55 +0300 Subject: [PATCH] slightly better prompt when no feeds are subscribed --- functions.php | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/functions.php b/functions.php index 3223a55e..a11d9e59 100644 --- a/functions.php +++ b/functions.php @@ -1894,21 +1894,13 @@ function initialize_user($link, $uid) { -/* db_query($link, "INSERT INTO ttrss_labels2 (owner_uid, caption) - VALUES ('$uid', 'All Articles')"); - - db_query($link, "INSERT INTO ttrss_filters - (owner_uid, feed_id, filter_type, reg_exp, enabled, - action_id, action_param, filter_param) - VALUES ('$uid', NULL, 1, '.', true, 7, 'All Articles', 'before')"); */ - db_query($link, "insert into ttrss_feeds (owner_uid,title,feed_url) values ('$uid', 'Tiny Tiny RSS: New Releases', 'http://tt-rss.org/releases.rss')"); db_query($link, "insert into ttrss_feeds (owner_uid,title,feed_url) values ('$uid', 'Tiny Tiny RSS: Forum', - 'http://tt-rss.org/forum/rss.php')"); + 'http://tt-rss.org/forum/rss.php')"); } function logout_user() { @@ -4240,9 +4232,13 @@ print ""; } - function printCategoryHeader($link, $cat_id, $hidden = false, $can_browse = true) { + function printCategoryHeader($link, $cat_id, $hidden = false, $can_browse = true, + $title_override = false) { - $tmp_category = getCategoryTitle($link, $cat_id); + if (!$title_override) + $tmp_category = getCategoryTitle($link, $cat_id); + else + $tmp_category = $title_override; if ($cat_id > 0) { $cat_unread = ccache_find($link, $cat_id, $_SESSION["uid"], true); @@ -4482,7 +4478,20 @@ } if (db_num_rows($result) == 0) { - print "
  • ".__('No feeds to display.')."
  • "; + + if (!get_pref($link, 'ENABLE_FEED_CATS')) { + print "
  • ". + __('Subscribe to feed...')."
  • "; + } else { + printCategoryHeader($link, -1, false, false, "Feeds"); + + print "
  • ". + __('Subscribe to feed...')."
  • "; + + print ""; + } } } else { -- 2.39.5