diff options
author | Andrew Dolgov <[email protected]> | 2010-11-05 18:48:55 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-11-05 18:48:55 +0300 |
commit | f0855b88af1ee551d6591eb64a9bdecb2f4a7833 (patch) | |
tree | b3bac4ef267e92c8fe26593a4f82756b58b5ef43 /functions.php | |
parent | 9798b2b4c659ba7f626c5cdad68453def0f01fc2 (diff) |
slightly better prompt when no feeds are subscribed
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/functions.php b/functions.php index 3223a55eb..a11d9e59c 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 "</div>"; } - 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 "<li>".__('No feeds to display.')."</li>"; + + if (!get_pref($link, 'ENABLE_FEED_CATS')) { + print "<li style='text-align : center'><a href=\"#\" + onclick=\"quickAddFeed()\">". + __('Subscribe to feed...')."</a></li>"; + } else { + printCategoryHeader($link, -1, false, false, "Feeds"); + + print "<li><a href=\"#\" + onclick=\"quickAddFeed()\">". + __('Subscribe to feed...')."</a></li>"; + + print "</ul>"; + } } } else { |