diff options
author | Andrew Dolgov <[email protected]> | 2005-08-21 17:16:41 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-08-21 17:16:41 +0100 |
commit | ac53063ab9a0a2a13ea40cafd5e6e2b383976578 (patch) | |
tree | 9ce0d3295c76438884f17e9624a209e4ffa64487 /backend.php | |
parent | 40d13c283683b15d7a5d40cfcd158dc84c440085 (diff) |
basic functionality pass 4
Diffstat (limited to 'backend.php')
-rw-r--r-- | backend.php | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/backend.php b/backend.php index e89163dec..5386de0b3 100644 --- a/backend.php +++ b/backend.php @@ -88,8 +88,12 @@ $skip = $_GET["skip"]; $ext = $_GET["ext"]; + if (!$skip) $skip = 0; + if ($ext == "undefined") $ext = ""; + // FIXME: check for null value here + $result = pg_query("SELECT *, EXTRACT(EPOCH FROM NOW()) - EXTRACT(EPOCH FROM last_updated) as update_timeout FROM ttrss_feeds WHERE id = '$feed'"); @@ -113,11 +117,24 @@ } print "<table class=\"headlines\" width=\"100%\">"; +/* print "<tr><td class=\"search\"> + Search: <input onchange=\"javascript:search($feed,this);\"></td>"; + print "<td class=\"title\">" . $line["title"] . "</td></tr>"; */ + + print "<tr><td class=\"search\" colspan=\"2\"> + Search: <input onchange=\"javascript:search($feed,this);\"></td></tr>"; print "<tr><td colspan=\"2\" class=\"title\">" . $line["title"] . "</td></tr>"; + if ($ext == "SEARCH") { + $search = $_GET["search"]; + $search_query_part = "(upper(title) LIKE upper('%$search%') + OR content LIKE '%$search%') AND"; + } + $result = pg_query("SELECT id,title,updated,unread,feed_id FROM ttrss_entries WHERE - feed_id = '$feed' ORDER BY updated LIMIT ".HEADLINES_PER_PAGE." OFFSET $skip"); + $search_query_part + feed_id = '$feed' ORDER BY updated DESC LIMIT ".HEADLINES_PER_PAGE." OFFSET $skip"); $lnum = 0; @@ -139,6 +156,11 @@ ++$lnum; } + if ($lnum == 0) { + print "<tr><td align='center'>No entries found.</td></tr>"; + + } + print "<tr><td colspan=\"2\" class=\"headlineToolbar\">"; $next_skip = $skip + HEADLINES_PER_PAGE; @@ -150,7 +172,10 @@ print "<a class=\"button\" href=\"javascript:viewfeed($feed, $next_skip);\">Next Page</a>"; print " "; - + + print "<a class=\"button\" + href=\"javascript:viewfeed($feed, 0, '');\">Refresh</a>"; + print " "; print "<a class=\"button\" href=\"javascript:viewfeed($feed, 0, 'MarkAllRead');\">Mark all as read</a>"; |