summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-10 13:56:42 +0300
committerAndrew Dolgov <[email protected]>2010-11-10 13:56:42 +0300
commitb3990c92e7dc4dc051aac0a444e8f6e13777ecc6 (patch)
tree3139367e48e8235d557e15b61adffc84f0bcf759 /functions.php
parent5414ad4c80e5bb5c973d2299aa5500623ce07452 (diff)
add option to sort headlines by feed-specified date (bump schema)
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/functions.php b/functions.php
index 835398cd6..a5d3a7cf6 100644
--- a/functions.php
+++ b/functions.php
@@ -3460,10 +3460,16 @@
$query_strategy_part = "id > 0"; // dumb
}
+ if (get_pref($link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
+ $date_sort_field = "updated";
+ } else {
+ $date_sort_field = "date_entered";
+ }
+
if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) {
- $order_by = "date_entered";
+ $order_by = "$date_sort_field";
} else {
- $order_by = "date_entered DESC";
+ $order_by = "$date_sort_field DESC";
}
if ($view_mode != "noscores") {
@@ -3593,9 +3599,15 @@
if (!$limit) $limit = 30;
+ if (get_pref($link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
+ $date_sort_field = "updated";
+ } else {
+ $date_sort_field = "date_entered";
+ }
+
$qfh_ret = queryFeedHeadlines($link, $feed,
$limit, $view_mode, $is_cat, $search, $search_mode,
- $match_on, "date_entered DESC", 0, $owner_uid);
+ $match_on, "$date_sort_field DESC", 0, $owner_uid);
$result = $qfh_ret[0];
$feed_title = htmlspecialchars($qfh_ret[1]);