diff options
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/include/functions.php b/include/functions.php index 32fc5ae2a..b52531f66 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2039,6 +2039,7 @@ $data['cdm_expanded'] = get_pref($link, 'CDM_EXPANDED'); $data['dep_ts'] = calculate_dep_timestamp(); + $data['reload_on_ts_change'] = !defined('_NO_RELOAD_ON_TS_CHANGE'); if (file_exists(LOCK_DIRECTORY . "/update_daemon.lock")) { @@ -2235,14 +2236,29 @@ if ($search) { $view_query_part = " "; } else if ($feed != -1) { - $unread = getFeedUnread($link, $feed, $cat_view); - if ($cat_view && $feed > 0 && $include_children) - $unread += getCategoryChildrenUnread($link, $feed); + if (get_pref($link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) { + $a_date_sort_field = "updated"; + } else { + $a_date_sort_field = "date_entered"; + } + + if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) { + $a_order_by = "$a_date_sort_field"; + } else { + $a_order_by = "$a_date_sort_field DESC"; + } - if ($unread > 0) { - $view_query_part = " unread = true AND "; + if (!$override_order) { + $override_order = "unread DESC, $a_order_by"; } + + if (!$ignore_vfeed_group && ($is_cat || $feed_id < 0) && + get_pref($link, 'VFEED_GROUP_BY_FEED', $owner_uid)) { + + $override_order = "ttrss_feeds.title, $override_order"; + } + } } |