]> git.wh0rd.org - tt-rss.git/blobdiff - mobile/classic/functions.php
reduce the number of always included libraries
[tt-rss.git] / mobile / classic / functions.php
index e7d14da6fbae52fb3c54a3d4753c09e6941d182c..5e1ba8009700f1600fdbb1ae25eb71b129ce75a6 100644 (file)
                                FROM ttrss_feeds LEFT JOIN ttrss_feed_categories 
                                        ON (ttrss_feed_categories.id = cat_id)                          
                                WHERE 
-                                       ttrss_feeds.hidden = false AND
-                                       ttrss_feeds.owner_uid = '$owner_uid' AND parent_feed IS NULL
+                                       ttrss_feeds.owner_uid = '$owner_uid'
                                ORDER BY $order_by_qpart"); 
 
                        $actid = $_GET["actid"];
                                        $rtl_tag = "";
                                }
 
-                               $tmp_result = db_query($link,
-                                       "SELECT id,COUNT(unread) AS unread
-                                       FROM ttrss_feeds LEFT JOIN ttrss_user_entries 
-                                               ON (ttrss_feeds.id = ttrss_user_entries.feed_id) 
-                                       WHERE parent_feed = '$feed_id' AND unread = true 
-                                       GROUP BY ttrss_feeds.id");
-                       
-                               if (db_num_rows($tmp_result) > 0) {                             
-                                       while ($l = db_fetch_assoc($tmp_result)) {
-                                               $unread += $l["unread"];
-                                       }
-                               }
-
                                $cat_id = $line["cat_id"];
 
                                $tmp_category = $line["category"];
                $feed = "<a href=\"?go=vf&id=$feed_id\">$feed_title</a>";
 
                print "<li class=\"$class\">";
-               if (get_pref($link, 'ENABLE_FEED_ICONS')) {
-                       print "$feed_icon";
-               }
-
+               print "$feed_icon";
                print "<span $rtl_tag>$feed</span> ";
 
                if ($unread != 0) {
                }
 
                if ($catchup_op == "selection") {
-                       $ids_to_mark = array_keys($_GET["sel_ids"]);
-                       if ($ids_to_mark) {
-                               foreach ($ids_to_mark as $id) {
-                                       db_query($link, "UPDATE ttrss_user_entries SET 
-                                               unread = false,last_read = NOW()
-                                               WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+                       if (is_array($_GET["sel_ids"])) {
+                               $ids_to_mark = array_keys($_GET["sel_ids"]);
+                               if ($ids_to_mark) {
+                                       foreach ($ids_to_mark as $id) {
+                                               db_query($link, "UPDATE ttrss_user_entries SET 
+                                                       unread = false,last_read = NOW()
+                                                       WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+                                       }
                                }
                        }
                }
                                $content_link = "<a href=\"?go=view&id=$id&cat=$cat_view&ret_feed=$feed&feed=$feed_id\">" .
                                        $line["title"] . "</a>";
 
-                               if (get_pref($link, 'HEADLINES_SMART_DATE')) {
-                                       $updated_fmt = smart_date_time(strtotime($line["updated"]));
-                               } else {
-                                       $short_date = get_pref($link, 'SHORT_DATE_FORMAT');
-                                       $updated_fmt = date($short_date, strtotime($line["updated"]));
-                               }                               
-                               
+                               $updated_fmt = make_local_datetime($link, $line['updated'], false);
+
                                print "<li class='$class' id=\"HROW-$id\">";
 
                                print "<input type=\"checkbox\" name=\"sel_ids[$id]\"