order feed output by date_entered instead of updated to properly keep new stuff topmost; support REVERSE_HEADLINES in more headline output modes

This commit is contained in:
Andrew Dolgov 2010-10-18 18:32:26 +04:00
parent 98d684f99b
commit 7b20c97780
2 changed files with 15 additions and 7 deletions

View File

@ -319,18 +319,26 @@
switch ($order_by) { switch ($order_by) {
case "date": case "date":
if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) { if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) {
$override_order = "updated"; $override_order = "date_entered";
} else { } else {
$override_order = "updated DESC"; $override_order = "date_entered DESC";
} }
break; break;
case "title": case "title":
$override_order = "updated DESC"; if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) {
$override_order = "title DESC, date_entered";
} else {
$override_order = "title, date_entered DESC";
}
break; break;
case "score": case "score":
$override_order = "score DESC"; if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) {
$override_order = "score, date_entered";
} else {
$override_order = "score DESC, date_entered DESC";
}
break; break;
} }

View File

@ -3512,9 +3512,9 @@
} }
if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) { if (get_pref($link, 'REVERSE_HEADLINES', $owner_uid)) {
$order_by = "updated"; $order_by = "date_entered";
} else { } else {
$order_by = "updated DESC"; $order_by = "date_entered DESC";
} }
if ($view_mode != "noscores") { if ($view_mode != "noscores") {
@ -3645,7 +3645,7 @@
if (!$limit) $limit = 30; if (!$limit) $limit = 30;
$qfh_ret = queryFeedHeadlines($link, $feed, $qfh_ret = queryFeedHeadlines($link, $feed,
$limit, false, $is_cat, $search, $search_mode, $match_on, "updated DESC", 0, $limit, false, $is_cat, $search, $search_mode, $match_on, "date_entered DESC", 0,
$owner_uid); $owner_uid);
$result = $qfh_ret[0]; $result = $qfh_ret[0];