diff --git a/trunk/functions.pl b/trunk/functions.pl index ce1349d..22987a2 100644 --- a/trunk/functions.pl +++ b/trunk/functions.pl @@ -167,10 +167,20 @@ sub output_page ) ); + if($query->param('cortado') eq 'true') + { + @cookies = [$session->cookie(-name=>$session_name, -value=>$session->id), $session->cookie(-name=>'cortado', -value=>'true')]; + } + elsif($query->param('cortado') eq 'false') + { + @cookies = [$session->cookie(-name=>$session_name, -value=>$session->id), $session->cookie(-name=>'cortado', -value=>'false')]; + } + #send everything including http headers to the user - if xslt chosen is xspf set download filename return $session->header( -type=>'text/xml', - -charset=>'UTF-8' + -charset=>'UTF-8', + -cookie=>@cookies ), $foo->toString; } diff --git a/trunk/init_sql.pl b/trunk/init_sql.pl index 7d780ad..80a8881 100644 --- a/trunk/init_sql.pl +++ b/trunk/init_sql.pl @@ -52,7 +52,7 @@ $dbh->do(qq{create table timestamp bigint not null, locale varchar(10) not null, pagesize tinyint unsigned default 5, - cortado tinyint default 1, + cortado varchar(5) default 'true', primary key (id) ) }) or die $dbh->errstr; diff --git a/trunk/search.pl b/trunk/search.pl index c57caac..9958c2f 100644 --- a/trunk/search.pl +++ b/trunk/search.pl @@ -18,9 +18,20 @@ if($query->param('query')) my @args = (); $strquery = $query->param('query'); + $strquery = s/%([0-9A-F]{2})/chr(hex($1))/eg; (@tags) = $strquery =~ /tag:(\w+)/gi; ($orderby) = $strquery =~ /orderby:(\w+)/i; ($sort) = $strquery =~ /sort:(\w+)/i; + #($title) = $strquery =~ /title:(\w+)/i; + #($description) = $strquery =~ /description:(\w+)/i; + #($creator) = $strquery =~ /creator:(\w+)/i; + #($language) = $strquery =~ /language:(\w+)/i; + #($coverage) = $strquery =~ /coverage:(\w+)/i; + #($rights) = $strquery =~ /rights:(\w+)/i; + #($license) = $strquery =~ /license:(\w+)/i; + #($filesize) = $strquery =~ /filesize:([<>]?\w+)/i; + #($duration) = $strquery =~ /duration:([<>]?\w+)/i; + #($timestamp) = $strquery =~ /timestamp:([<>]?\w+)/i; $strquery =~ s/(tag|orderby|sort):\w+//gi; $strquery =~ s/^\s*(.*?)\s*$/$1/; @@ -101,15 +112,20 @@ if($query->param('query')) { print $query->redirect("index.pl?warning=warning_no_results"); } - if(@{$page->{'results'}->{'result'}} == 1 or $query->param('lucky')) + elsif(@{$page->{'results'}->{'result'}} == 1 or $query->param('lucky')) { - print $query->redirect(@{$page->{'results'}->{'result'}}[0]->{'rdf:RDF'}->{'cc:Work'}->{'dc:identifier'}[0]); + print $query->redirect($page->{'results'}->{'result'}[0]->{'rdf:RDF'}->{'cc:Work'}->{'dc:identifier'}[0]); } else { print output_page(); } } +elsif($query->param('advanced')) +{ + $page->{'advancedsearch'} = ['']; + print output_page(); +} else { print $query->redirect("index.pl?error=error_no_query"); diff --git a/trunk/video.pl b/trunk/video.pl index ef4f2b5..68b6120 100644 --- a/trunk/video.pl +++ b/trunk/video.pl @@ -125,13 +125,21 @@ elsif($query->url_param('title') or $query->url_param('id')) } elsif($query->param('cortado') eq 'false') { - $cortado = 'false' + $cortado = 'false'; } - elsif($userinfo->{'cortado'} = 1) + elsif($userinfo->{'cortado'} eq 'true') { $cortado = 'true'; } - elsif($userinfo->{'cortado'} = 0) + elsif($userinfo->{'cortado'} eq 'false') + { + $cortado = 'false'; + } + elsif($query->cookie('cortado') eq 'true') + { + $cortado = 'true'; + } + elsif($query->cookie('cortado') eq 'false') { $cortado = 'false'; } diff --git a/trunk/xsl/xhtml.xsl b/trunk/xsl/xhtml.xsl index b6c59ae..c5bf555 100755 --- a/trunk/xsl/xhtml.xsl +++ b/trunk/xsl/xhtml.xsl @@ -24,6 +24,7 @@ + @@ -237,6 +238,9 @@ + + + diff --git a/trunk/xsl/xhtml/settings.xsl b/trunk/xsl/xhtml/settings.xsl index 9b6a5a3..7d9f9ab 100644 --- a/trunk/xsl/xhtml/settings.xsl +++ b/trunk/xsl/xhtml/settings.xsl @@ -59,8 +59,8 @@
- - + + checked @@ -69,8 +69,8 @@
- - + + checked