diff options
author | Andrew Dolgov <[email protected]> | 2005-11-28 10:57:47 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-11-28 10:57:47 +0100 |
commit | f56ec297e429f9b6185960929af129d4d82b437d (patch) | |
tree | e45fbfb1f7da393f54e245ca394287d99e9cfdb9 | |
parent | 12d7c4cdeed12543c4b282f46294af0afee19f29 (diff) |
headlines: hide subtoolbar when there are no articles to display
-rw-r--r-- | backend.php | 83 |
1 files changed, 39 insertions, 44 deletions
diff --git a/backend.php b/backend.php index e22dfe8ef..7ea9bb2f8 100644 --- a/backend.php +++ b/backend.php @@ -915,48 +915,6 @@ $feed_title = "?"; } - print "<table class=\"headlinesSubToolbar\" - width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>"; - - print "<td class=\"headlineActions\"> - Select: - <a href=\"javascript:selectTableRowsByIdPrefix('headlinesList', - 'RROW-', 'RCHK-', true)\">All</a>, - <a href=\"javascript:selectTableRowsByIdPrefix('headlinesList', - 'RROW-', 'RCHK-', true, 'Unread')\">Unread</a>, - <a href=\"javascript:selectTableRowsByIdPrefix('headlinesList', - 'RROW-', 'RCHK-', false)\">None</a> - - Toggle: <a href=\"javascript:toggleUnread()\">Unread</a>, - <a href=\"javascript:toggleStarred()\">Starred</a>"; - -/* print " - View: - <a href=\"javascript:limitView('All')\">All</a>, - <a href=\"javascript:limitView('Unread')\">Unread</a>, - <a href=\"javascript:limitView('Starred')\">Starred</a> - - Feed: - <a href=\"javascript:updateCurrentFeed()\">Update</a>, - <a href=\"javascript:catchupCurrentFeed()\">Mark as read</a>"; */ - - print "</td>"; - - print "<td class=\"headlineTitle\">"; - - if ($feed_site_url) { - print "<a target=\"_blank\" href=\"$feed_site_url\">$feed_title</a>"; - } else { - print $feed_title; - } - - print "</td>"; - print "</tr></table>"; - - print "<table class=\"headlinesList\" id=\"headlinesList\" - cellspacing=\"0\" width=\"100%\">"; - - if ($feed < -10) error_reporting (0); if (sprintf("%d", $feed) != 0) { @@ -1018,11 +976,48 @@ } if (!$result) { - print "<tr><td colspan='4' align='center'> - Could not display feed (query failed). Please check match syntax or local configuration.</td></tr>"; + print "<div align='center'> + Could not display feed (query failed). Please check match syntax or local configuration.</div>"; return; } + if (db_num_rows($result) > 0) { + + print "<table class=\"headlinesSubToolbar\" + width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>"; + + print "<td class=\"headlineActions\"> + Select: + <a href=\"javascript:selectTableRowsByIdPrefix('headlinesList', + 'RROW-', 'RCHK-', true)\">All</a>, + <a href=\"javascript:selectTableRowsByIdPrefix('headlinesList', + 'RROW-', 'RCHK-', true, 'Unread')\">Unread</a>, + <a href=\"javascript:selectTableRowsByIdPrefix('headlinesList', + 'RROW-', 'RCHK-', false)\">None</a> + + Toggle: <a href=\"javascript:toggleUnread()\">Unread</a>, + <a href=\"javascript:toggleStarred()\">Starred</a>"; + + print "</td>"; + + print "<td class=\"headlineTitle\">"; + + if ($feed_site_url) { + print "<a target=\"_blank\" href=\"$feed_site_url\">$feed_title</a>"; + } else { + print $feed_title; + } + + print "</td>"; + print "</tr></table>"; + + } + + print "<table class=\"headlinesList\" id=\"headlinesList\" + cellspacing=\"0\" width=\"100%\">"; + + + $lnum = 0; error_reporting (DEFAULT_ERROR_LEVEL); |