diff options
author | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-05-20 17:46:52 +0000 |
---|---|---|
committer | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-05-20 17:46:52 +0000 |
commit | c2615af845fef85c048d3d1b2e0fd83b701dc4e1 (patch) | |
tree | ffd38c74eee923eedbb6cec3294165dcd5fa733f /lib/VNDB.pm | |
parent | 2ce770e7e5817f8838fdaf7bc7eda2a8da972962 (diff) |
Several bugfixes, xml extention to rss feeds, noindex on user forms, client side filter selection, and how the fuck did the "Finished" status get lost!?
git-svn-id: svn://vndb.org/vndb@14 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'lib/VNDB.pm')
-rw-r--r-- | lib/VNDB.pm | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/VNDB.pm b/lib/VNDB.pm index 93f9e190..5ac3bc87 100644 --- a/lib/VNDB.pm +++ b/lib/VNDB.pm @@ -79,7 +79,6 @@ my %VNDBuris = ( # wildcards: * -> (.+), + -> ([0-9]+) v => { '/' => sub { shift->VNBrowse }, new => sub { shift->VNEdit(0); }, - #search => sub { shift->VNSearch }, '*' => sub { $_[2] =~ /^([a-z0]|all|search)$/ ? shift->VNBrowse($_[1]) : shift->ResNotFound; }, }, 'v+' => { @@ -135,10 +134,21 @@ my %OLDuris = ( '*' => sub { shift->ResRedirect('/v/'.$_[1], 'perm') }, }, v => { - cat => sub { }, + cat => sub { + my $f = $_[0]->FormCheck({name=>'i',required=>0},{name=>'e',required=>0},{name=>'l',required=>0}, + {name=>'p',required=>0},{name=>'o',required=>0},{name=>'s',required=>0}); + my %f; + $f{$_} = $f->{$_} for (qw|p o s|); + $f{q} = join ' ', (map $VNDB::CAT->{substr($_,0,1)}[1]{substr($_,1,2)}, split /,/, $f->{i}), + (map '-'.$VNDB::CAT->{substr($_,0,1)}[1]{substr($_,1,2)}, split /,/, $f->{e}), + (map $VNDB::LANG->{$_}, split /,/, $f->{l}); + !$f{$_}&&delete $f{$_} for keys %f; + $_[0]->ResRedirect('/v/search'.(!(keys %f)?'':'?'.join(';', map $_.'='.$f{$_}, keys %f) ), 'perm'); + }, }, 'v+' => { votes => sub { shift->ResRedirect('/v'.(shift).'/stats', 'perm') }, + hist=>{rss => sub { shift->ResRedirect('/v'.(shift).'/hist/rss.xml', 'perm') } }, }, u => { '*' => { @@ -151,7 +161,14 @@ my %OLDuris = ( } }, } - } + }, + 'u+' => { + hist=>{rss => sub { shift->ResRedirect('/u'.(shift).'/hist/rss.xml', 'perm') } }, + }, + 'p+' => { + hist=>{rss => sub { shift->ResRedirect('/p'.(shift).'/hist/rss.xml', 'perm') } }, + }, + hist=>{rss => sub { shift->ResRedirect('/hist/rss.xml', 'perm') } }, ); |