summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-07-13 11:35:46 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-07-13 11:35:46 +0000
commit444f1107fd8bb195324c960c384875ab2e0bbc12 (patch)
tree73de868cb75951fd4ee3941d67cc2b9676199ebe
parenta9de16e13ba4b2270794e2b1aef4f710fa143cbf (diff)
Re-added the vote stats to VN pages, Searching for 'Chinese' doesn't select 'NES' and Place/time category order on VN pages is now consistent
git-svn-id: svn://vndb.org/vndb@66 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
-rw-r--r--data/tpl/vnpage3
-rw-r--r--data/tpl/vnpage_stats13
-rw-r--r--lib/ChangeLog3
-rw-r--r--lib/VNDB/VN.pm8
-rw-r--r--lib/global.pl2
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',