diff --git a/mobile/functions.php b/mobile/functions.php
index 790cf5473..1806e0eda 100644
--- a/mobile/functions.php
+++ b/mobile/functions.php
@@ -1,5 +1,4 @@
0;
}
+ function render_flat_feed_list($link) {
+ $owner_uid = $_SESSION["uid"];
+
+ $result = db_query($link, "SELECT id,
+ title,
+ (SELECT COUNT(id) FROM ttrss_entries,ttrss_user_entries
+ WHERE feed_id = ttrss_feeds.id AND unread = true
+ AND ttrss_user_entries.ref_id = ttrss_entries.id
+ AND owner_uid = '$owner_uid') as unread
+ FROM ttrss_feeds
+ WHERE
+ ttrss_feeds.hidden = false AND
+ ttrss_feeds.owner_uid = '$owner_uid' AND
+ parent_feed IS NULL
+ ORDER BY unread DESC,title");
+
+ print '
';
+
+ // print "- ".__('Actions...')."
";
+
+ while ($line = db_fetch_assoc($result)) {
+ $id = $line["id"];
+ $unread = $line["unread"];
+
+ // $unread = rand(0, 100);
+
+ if ($unread > 0) {
+ $line["title"] = $line["title"] . " ($unread)";
+ $class = '';
+ } else {
+ $class = 'oldItem';
+ }
+
+ if (mobile_feed_has_icon($id)) {
+ $icon_url = "../".ICONS_URL."/$id.ico";
+ } else {
+ $icon_url = "../images/blank_icon.gif";
+ }
+
+ print "- " .
+ "".
+ $line["title"] . "
";
+ }
+
+ print "
";
+
+
+
+ }
+
function render_category($link, $cat_id) {
$owner_uid = $_SESSION["uid"];
@@ -223,10 +272,15 @@
$result = $qfh_ret[0];
$feed_title = $qfh_ret[1];
- $cat_title = getCategoryTitle($link, $cat_id);
+ if ($cat_id) {
+ $cat_title = getCategoryTitle($link, $cat_id);
- print "";
+ print "";
+ } else {
+ print "";
+ }
while ($line = db_fetch_assoc($result)) {
$id = $line["id"];
diff --git a/mobile/home.php b/mobile/home.php
index 3ec09c032..0ac313ac0 100644
--- a/mobile/home.php
+++ b/mobile/home.php
@@ -20,5 +20,11 @@
login_sequence($link, true);
- render_categories_list($link);
+ $use_cats = get_pref($link, 'ENABLE_FEED_CATS');
+
+ if ($use_cats) {
+ render_categories_list($link);
+ } else {
+ render_flat_feed_list($link);
+ }
?>
diff --git a/mobile/index.php b/mobile/index.php
index 5a2ed97e6..3b933f96d 100644
--- a/mobile/index.php
+++ b/mobile/index.php
@@ -67,8 +67,16 @@
Logout
-
-
+
+