diff options
Diffstat (limited to 'lib/VNDB/Handler/Discussions.pm')
-rw-r--r-- | lib/VNDB/Handler/Discussions.pm | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm index c8431c2c..9cc83fc7 100644 --- a/lib/VNDB/Handler/Discussions.pm +++ b/lib/VNDB/Handler/Discussions.pm @@ -319,7 +319,7 @@ sub board { end; end; - _threadlist($self, $list, $f, $np, "/t/$type$iid") if @$list; + _threadlist($self, $list, $f, $np, "/t/$type$iid", $type.$iid) if @$list; $self->htmlFooter; } @@ -340,7 +340,7 @@ sub index { for (qw|an db v p u|) { my $list = $self->dbThreadGet( type => $_, - results => 5, + results => $_ eq 'db' || $_ eq 'v' ? 10 : 5, page => 1, what => 'firstpost lastpost boardtitles', sort => 'lastpost', reverse => 1, @@ -348,7 +348,7 @@ sub index { h1 class => 'boxtitle'; a href => "/t/$_", mt "_dboard_$_"; end; - _threadlist($self, $list, {p=>1}, 0, "/t"); + _threadlist($self, $list, {p=>1}, 0, "/t", $_); } $self->htmlFooter; @@ -356,7 +356,7 @@ sub index { sub _threadlist { - my($self, $list, $f, $np, $url) = @_; + my($self, $list, $f, $np, $url, $board) = @_; $self->htmlBrowse( items => $list, options => $f, @@ -374,6 +374,18 @@ sub _threadlist { Tr $n % 2 ? ( class => 'odd' ) : (); td class => 'tc1'; a $o->{locked} ? ( class => 'locked' ) : (), href => "/t$o->{id}", shorten $o->{title}, 50; + b class => 'boards'; + my $i = 1; + my @boards = sort { $a->{type}.$a->{iid} cmp $b->{type}.$b->{iid} } grep $_->{type}.($_->{iid}||'') ne $board, @{$o->{boards}}; + for(@boards) { + last if $i++ > 4; + txt ', ' if $i > 2; + a href => "/t/$_->{type}".($_->{iid}||''), + title => $_->{original}||mt("_dboard_$_->{type}"), + shorten $_->{title}||mt("_dboard_$_->{type}"), 30; + } + txt ', ...' if @boards > 4; + end; end; td class => 'tc2', $o->{count}-1; td class => 'tc3'; @@ -387,20 +399,6 @@ sub _threadlist { end; end; end; - Tr $n % 2 ? ( class => 'odd' ) : (); - td colspan => 4, class => 'boards'; - txt ' > '; - my $i = 1; - for(sort { $a->{type}.$a->{iid} cmp $b->{type}.$b->{iid} } @{$o->{boards}}) { - last if $i++ > 5; - txt ', ' if $i > 2; - a href => "/t/$_->{type}".($_->{iid}||''), - title => $_->{original}||mt("_dboard_$_->{type}"), - shorten $_->{title}||mt("_dboard_$_->{type}"), 30; - } - txt ', ...' if @{$o->{boards}} > 5; - end; - end; } ); } |