From 95004daf9dcb46fc0e74f631e184ea4aea46ffd5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 18 Dec 2009 15:19:34 +0300 Subject: mobile: implement WIP pagination for flat feedlist --- mobile/functions.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'mobile/functions.php') diff --git a/mobile/functions.php b/mobile/functions.php index 4880e1f57..30200a136 100644 --- a/mobile/functions.php +++ b/mobile/functions.php @@ -22,8 +22,11 @@ return file_exists($filename) && filesize($filename) > 0; } - function render_flat_feed_list($link) { + function render_flat_feed_list($link, $offset) { $owner_uid = $_SESSION["uid"]; + $limit = 30; + + if (!$offset) $offset = 0; if (mobile_get_pref($link, "SORT_FEEDS_UNREAD")) { $order_by = "unread DESC, title"; @@ -42,13 +45,15 @@ ttrss_feeds.hidden = false AND ttrss_feeds.owner_uid = '$owner_uid' AND parent_feed IS NULL - ORDER BY $order_by"); + ORDER BY $order_by LIMIT $limit OFFSET $offset"); - print '"; + $next_offset = $offset + $num_feeds; + + print "
  • Show more feeds...
  • "; + if (!$offset) print ""; } -- cgit v1.2.3