summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-01-27 15:42:53 +0100
committerYorhel <git@yorhel.nl>2011-01-27 15:43:03 +0100
commit007eed45f58817bc29443dd3b39d40ceceeadea4 (patch)
tree0e49cf94e70e0d891145dfebd7b7597f0c80f89a
parent11ba55dfc97565ec17fd4828b407d477d2844147 (diff)
Order "all notifications" with new notifications first
That's more what you'd expect from a list that functions somewhat as a short-lived FIFO "archive".
-rw-r--r--ChangeLog1
-rw-r--r--lib/VNDB/DB/Users.pm6
-rw-r--r--lib/VNDB/Handler/Users.pm1
3 files changed, 5 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index af8578e5..c10f4378 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
- Slightly re-organized lang.txt
- Fixed perl warning on /u+/votes batchedit with nothing selected
- Switched to TUWF
+ - Order "all notifications" with new notifications first
- Bugfix: Correctly randomize screenshots on homepage with filters
- Bugfix: Don't show NSFW screenshots on homepage with filters
- Bugfix-API: Use ~ for the get vn search filter instead of =
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm
index bd7db201..36ae02af 100644
--- a/lib/VNDB/DB/Users.pm
+++ b/lib/VNDB/DB/Users.pm
@@ -178,7 +178,7 @@ sub dbSessionUpdateLastUsed {
}
-# %options->{ uid id what results page }
+# %options->{ uid id what results page reverse }
# what: titles
sub dbNotifyGet {
my($s, %o) = @_;
@@ -210,8 +210,8 @@ sub dbNotifyGet {
FROM notifications n
!s
!W
- ORDER BY n.id
- |, join(', ', @select), join(' ', @join), \%where);
+ ORDER BY n.id !s
+ |, join(', ', @select), join(' ', @join), \%where, $o{reverse} ? 'DESC' : 'ASC');
return wantarray ? ($r, $np) : $r;
}
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index 44ffa60b..d46d6c22 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -586,6 +586,7 @@ sub notifies {
results => 25,
what => 'titles',
read => $f->{r} == 1 ? undef : 0,
+ reverse => $f->{r} == 1,
);
$self->htmlHeader(title => mt('_usern_title'), noindex => 1);