diff options
-rw-r--r-- | data/tpl/vnpage | 3 | ||||
-rw-r--r-- | data/tpl/vnpage_stats | 13 | ||||
-rw-r--r-- | lib/ChangeLog | 3 | ||||
-rw-r--r-- | lib/VNDB/VN.pm | 8 | ||||
-rw-r--r-- | lib/global.pl | 2 |
5 files changed, 15 insertions, 14 deletions
diff --git a/data/tpl/vnpage b/data/tpl/vnpage index 19061249..123a3147 100644 --- a/data/tpl/vnpage +++ b/data/tpl/vnpage @@ -111,7 +111,8 @@ if($d{vn}{length} || $d{vn}{alias} || @links || $prod) { ]] <dt>[[: $VNDB::CAT->{$c}[0] ]]</dt><dd>[[= join(', ', @c) ]]</dd> [[ } } ]] [[ if(grep $_->[0] =~ /^[tl]/, @{$d{vn}{categories}}) { ]]- - <dt>Place/Time</dt><dd>[[= join ', ', map $VNDB::CAT->{substr($_->[0],0,1)}[1]{substr($_->[0],1,2)}, sort grep $_->[0] =~ /^[tl]/, @{$d{vn}{categories}} ]]</dd> + <dt>Place/Time</dt><dd>[[= join ', ', map $VNDB::CAT->{substr($_->[0],0,1)}[1]{substr($_->[0],1,2)}, + sort { $a->[0] cmp $b->[0] } grep $_->[0] =~ /^[tl]/, @{$d{vn}{categories}} ]]</dd> [[ } ]]- </dl> [[ } ]]- diff --git a/data/tpl/vnpage_stats b/data/tpl/vnpage_stats index d5d002a7..841fce37 100644 --- a/data/tpl/vnpage_stats +++ b/data/tpl/vnpage_stats @@ -2,16 +2,13 @@ [[ my $max = 1; my $total = 0; my $sum = 0; - - if($d{votes}{graph}) { - for (0..$#{$d{votes}{graph}}) { - $total += $d{votes}{graph}[$_]; - $max = $d{votes}{graph}[$_] if $d{votes}{graph}[$_] > $max; - $sum += ($_+1) * $d{votes}{graph}[$_]; - } + for (0..$#{$d{votes}{graph}}) { + $total += $d{votes}{graph}[$_]; + $max = $d{votes}{graph}[$_] if $d{votes}{graph}[$_] > $max; + $sum += ($_+1) * $d{votes}{graph}[$_]; } ]] -[[ if($d{votes}{graph} && $d{pv} && $d{user}{votes}) { ]]- +[[ if(!$d{user} || ($d{pv} && $d{user}{votes})) { ]]- <li><h3>Vote graph <p class="actions">[[= $total ]]- vote[[= $total==1?'':'s' ]]- total [[= $total ? sprintf(', average: %.1f.', $sum/$total) : '' ]]</p></h3> <table id="tvg"> diff --git a/lib/ChangeLog b/lib/ChangeLog index 06f828a6..ffc166a4 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -10,6 +10,9 @@ TODO: - Admins can change someone's username - Fixed the automatic relogin after changing password - Added lock indicator when browsing threads on a tag + - Re-added the vote stats to VN pages + - Searching for 'Chinese' doesn't select 'NES' + - Place/time category order on VN pages is now consistent 1.19 - 2008-07-08 (r62) - Integrated discussion board diff --git a/lib/VNDB/VN.pm b/lib/VNDB/VN.pm index 683aba67..edf644ab 100644 --- a/lib/VNDB/VN.pm +++ b/lib/VNDB/VN.pm @@ -49,10 +49,10 @@ sub VNPage { latest => scalar $self->DBGetVNList(vid => $id, results => 7, hide => 1), graph => $self->DBVNListStats(vid => $id), }, - #votes => { - # latest => scalar $self->DBGetVotes(vid => $id, results => 10, hide => 1), - # graph => $self->DBVoteStats(vid => $id), - #}, + votes => { + latest => scalar $self->DBGetVotes(vid => $id, results => 10, hide => 1), + graph => $self->DBVoteStats(vid => $id), + }, ) : (), }); } diff --git a/lib/global.pl b/lib/global.pl index 6b637375..999e082a 100644 --- a/lib/global.pl +++ b/lib/global.pl @@ -64,7 +64,7 @@ our $PLAT = { gba => 'Game Boy Advance', msx => 'MSX', nds => 'Nintendo DS', - nes => 'NES', + nes => 'Famicom', psp => 'Playstation Portable', ps1 => 'Playstation 1', ps2 => 'Playstation 2', |