From a836bb89bf119ea739d60f99a8afd0b0a8a7500d Mon Sep 17 00:00:00 2001 From: Yorhel Date: Wed, 2 Feb 2011 17:03:26 +0100 Subject: Added /t/all - a listing of all recently replied to threads --- ChangeLog | 1 + data/lang.txt | 8 ++++++++ lib/VNDB/Handler/Discussions.pm | 13 +++++++------ lib/VNDB/Handler/Misc.pm | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c10f4378..d8ea794a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ - Fixed perl warning on /u+/votes batchedit with nothing selected - Switched to TUWF - Order "all notifications" with new notifications first + - Added /t/all - a listing of all recently replied to threads - 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/data/lang.txt b/data/lang.txt index 8d1a7890..410b3885 100644 --- a/data/lang.txt +++ b/data/lang.txt @@ -2453,6 +2453,14 @@ cs : Diskuse pro [_1] hu : [_1]-hoz kapcsolódó beszélgetések nl : Gerelateerde discussies voor [_1] +# also used on the discussion board index (/t) +:_disboard_item_all +en : All boards +ru*: +cs*: +hu*: +nl : Alle fora + :_disboard_rootlink en : Discussion board ru : Форум diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm index 845e8e19..6f6cb385 100644 --- a/lib/VNDB/Handler/Discussions.pm +++ b/lib/VNDB/Handler/Discussions.pm @@ -11,7 +11,7 @@ use VNDB::Func; TUWF::register( qr{t([1-9]\d*)(?:/([1-9]\d*))?} => \&thread, qr{t([1-9]\d*)\.([1-9]\d*)} => \&redirect, - qr{t/(db|an|ge|[vpu])([1-9]\d*)?} => \&board, + qr{t/(all|db|an|ge|[vpu])([1-9]\d*)?} => \&board, qr{t([1-9]\d*)/reply} => \&edit, qr{t([1-9]\d*)\.([1-9]\d*)/edit} => \&edit, qr{t/(db|an|ge|[vpu])([1-9]\d*)?/new} => \&edit, @@ -270,7 +270,7 @@ sub edit { sub board { my($self, $type, $iid) = @_; $iid ||= ''; - return $self->resNotFound if $type =~ /(db|an|ge)/ && $iid; + return $self->resNotFound if $type =~ /(db|an|ge|all)/ && $iid; my $f = $self->formValidate( { get => 'p', required => 0, default => 1, template => 'int' }, @@ -283,10 +283,10 @@ sub board { $self->dbVNGet(id => $iid)->[0]; return $self->resNotFound if $iid && !$obj; my $ititle = $obj && ($obj->{title}||$obj->{name}||$obj->{username}); - my $title = !$obj ? mt("_dboard_$type") : mt '_disboard_item_title', $ititle; + my $title = !$obj ? mt($type eq 'all' ? '_disboard_item_all' : "_dboard_$type") : mt '_disboard_item_title', $ititle; my($list, $np) = $self->dbThreadGet( - type => $type, + $type ne 'all' ? (type => $type) : (), $iid ? (iid => $iid) : (), results => 50, page => $f->{p}, @@ -302,7 +302,7 @@ sub board { p; a href => '/t', mt '_disboard_rootlink'; txt ' > '; - a href => "/t/$type", mt "_dboard_$type"; + a href => "/t/$type", mt $type eq 'all' ? '_disboard_item_all' : "_dboard_$type"; if($iid) { txt ' > '; a style => 'font-weight: bold', href => "/t/$type$iid", "$type$iid"; @@ -316,7 +316,7 @@ sub board { br; br; a href => "/t/$type$iid/new", mt '_disboard_createyourown'; } else { - a href => '/t/'.($iid ? $type.$iid : $type ne 'ge' ? 'db' : $type).'/new', mt '_disboard_startnew'; + a href => '/t/'.($iid ? $type.$iid : $type ne 'ge' ? 'db' : $type).'/new', mt '_disboard_startnew' if $type ne 'all'; } end; end 'div'; @@ -334,6 +334,7 @@ sub index { div class => 'mainbox'; h1 mt '_disindex_title'; p class => 'browseopts'; + a href => '/t/all', mt '_disboard_item_all'; a href => '/t/'.$_, mt "_dboard_$_" for (@{$self->{discussion_boards}}); end; diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm index e7797259..df5621d8 100644 --- a/lib/VNDB/Handler/Misc.pm +++ b/lib/VNDB/Handler/Misc.pm @@ -105,7 +105,7 @@ sub homepage { # Recent posts td; h1; - a href => '/t', mt '_home_recentposts'; txt ' '; + a href => '/t/all', mt '_home_recentposts'; txt ' '; a href => '/feeds/posts.atom'; cssicon 'feed', mt '_atom_feed'; end; end; my $posts = $self->dbThreadGet(what => 'lastpost boardtitles', results => 10, sort => 'lastpost', reverse => 1, notusers => 1); -- cgit v1.2.3