diff options
author | Yorhel <git@yorhel.nl> | 2009-08-08 16:41:34 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-08-08 16:41:34 +0200 |
commit | 1e2a5c75f0154a12af7d19929153c27c75d193b1 (patch) | |
tree | d3a949969ef8ecc8d3c06f70238c8e5fe439e65f /lib/VNDB/DB/Discussions.pm | |
parent | c90e590bdbe7933df8e8a0d83c82dddfa22afc37 (diff) |
Converted threads_posts.date and edited to timestamptz
Everything still seems to be working fine so far.
Diffstat (limited to 'lib/VNDB/DB/Discussions.pm')
-rw-r--r-- | lib/VNDB/DB/Discussions.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/VNDB/DB/Discussions.pm b/lib/VNDB/DB/Discussions.pm index 5e371fbc..26beaaee 100644 --- a/lib/VNDB/DB/Discussions.pm +++ b/lib/VNDB/DB/Discussions.pm @@ -32,8 +32,8 @@ sub dbThreadGet { my @select = ( qw|t.id t.title t.count t.locked t.hidden|, - $o{what} =~ /firstpost/ ? ('tpf.uid AS fuid', 'tpf.date AS fdate', 'uf.username AS fusername') : (), - $o{what} =~ /lastpost/ ? ('tpl.uid AS luid', 'tpl.date AS ldate', 'ul.username AS lusername') : (), + $o{what} =~ /firstpost/ ? ('tpf.uid AS fuid', q|EXTRACT('epoch' from tpf.date) AS fdate|, 'uf.username AS fusername') : (), + $o{what} =~ /lastpost/ ? ('tpl.uid AS luid', q|EXTRACT('epoch' from tpl.date) AS ldate|, 'ul.username AS lusername') : (), ); my @join = ( @@ -170,7 +170,7 @@ sub dbPostGet { $o{uid} ? ( 'tp.uid = ?' => $o{uid} ) : (), $o{mindate} ? ( - 'tp.date > ?' => $o{mindate} ) : (), + 'tp.date > to_timestamp(?)' => $o{mindate} ) : (), $o{hide} ? ( 'tp.hidden = FALSE' => 1 ) : (), $o{hide} && $o{what} =~ /thread/ ? ( @@ -178,7 +178,7 @@ sub dbPostGet { ); my @select = ( - qw|tp.num tp.date tp.edited tp.msg tp.hidden|, + qw|tp.num tp.msg tp.hidden|, q|extract('epoch' from tp.date) as date|, q|extract('epoch' from tp.edited) as edited|, $o{what} =~ /user/ ? qw|tp.uid u.username| : (), $o{what} =~ /thread/ ? (qw|tp.tid t.title|, 't.hidden AS thread_hidden') : (), ); @@ -206,7 +206,7 @@ sub dbPostEdit { my %set = ( 'msg = ?' => $o{msg}, - 'edited = ?' => $o{lastmod}, + 'edited = to_timestamp(?)' => $o{lastmod}, 'hidden = ?' => $o{hidden}?1:0, ); |