diff --git a/trunk/locale/en-US.xml b/trunk/locale/en-US.xml index 808d000..071bf24 100755 --- a/trunk/locale/en-US.xml +++ b/trunk/locale/en-US.xml @@ -57,6 +57,17 @@ results for query + ordered by + ascending + descending + results on + pages + relevance + duration + filesize + viewcount + downloadcount + timestamp search @@ -101,6 +112,9 @@ language coverage righs holder + + duration + viewcount diff --git a/trunk/search.pl b/trunk/search.pl index 14d49e0..0c1590f 100644 --- a/trunk/search.pl +++ b/trunk/search.pl @@ -21,6 +21,7 @@ if($query->param('query') or $query->param('orderby')) { $page->{results}->{query} = $query->param('query'); $page->{results}->{orderby} = $query->param('orderby'); + $page->{results}->{sort} = $query->param('sort'); #connect to db my $dbh = DBI->connect("DBI:mysql:$database:$dbhost", $dbuser, $dbpass) or die $dbh->errstr; @@ -28,7 +29,7 @@ if($query->param('query') or $query->param('orderby')) my @args = (); #build mysql query - $dbquery = "select v.id, v.title, v.description, u.username, from_unixtime( v.timestamp )"; + $dbquery = "select v.id, v.title, v.creator, v.description, u.username, from_unixtime( v.timestamp ), v.duration, v.viewcount"; if($query->param('query')) { @@ -91,7 +92,9 @@ if($query->param('query') or $query->param('orderby')) $rowsperpage = 2; - $lastpage = int($resultcount/2); + #rediculous but funny round up, will fail with 1000000000000000 results per page + #on 0.00000000000001% of all queries - this is a risk we can handle + $lastpage = int($resultcount/$rowsperpage+0.999999999999999); $currentpage = $query->param('page') or $currentpage = 1; @@ -105,22 +108,27 @@ if($query->param('query') or $query->param('orderby')) $page->{'results'}->{'lastpage'} = $lastpage; $page->{'results'}->{'currentpage'} = $currentpage; + $page->{'results'}->{'resultcount'} = $resultcount; #get every returned value - while (my ($id, $title, $description, $username, $timestamp, $relevance) = $sth->fetchrow_array()) + while (my ($id, $title, $creator, $description, $username, $timestamp, $duration, $viewcount, $relevance) = $sth->fetchrow_array()) { #before code cleanup, this was a really obfuscated array/hash creation push @{ $page->{'results'}->{'result'} }, { - 'thumbnail' => ["./video-stills/$id"], + 'thumbnail' => "./video-stills/$id", + 'duration' => $duration, + 'viewcount' => $viewcount, 'rdf:RDF' => { 'cc:Work' => { - 'rdf:about' => "./video.pl?title=$title&id=$id", - 'dc:title' => [$title], - 'dc:date' => [$timestamp], - 'dc:publisher' => [$username] + 'rdf:about' => "$domain/download/$id", + 'dc:title' => [$title], + 'dc:creator' => [$creator], + 'dc:date' => [$timestamp], + 'dc:identifier' => ["$domain/video/$title/$id"], + 'dc:publisher' => [$username] }, 'cc:License' => { diff --git a/trunk/site/gnutube.xml b/trunk/site/gnutube.xml index f4fd474..d8be7df 100755 --- a/trunk/site/gnutube.xml +++ b/trunk/site/gnutube.xml @@ -23,7 +23,7 @@ search.pl?query= upload.pl uploader.pl - search.pl?sort=desc + search.pl?query=&orderby=timestamp&sort=desc diff --git a/trunk/style/gnutube.css b/trunk/style/gnutube.css index d22d3ec..f2413f3 100755 --- a/trunk/style/gnutube.css +++ b/trunk/style/gnutube.css @@ -260,4 +260,9 @@ span.protip:after span.protip:before { content: "( "; -} \ No newline at end of file +} + +td +{ + vertical-align: top; +} diff --git a/trunk/xsl/xhtml.xsl b/trunk/xsl/xhtml.xsl index c9e5b7b..65ed9ec 100755 --- a/trunk/xsl/xhtml.xsl +++ b/trunk/xsl/xhtml.xsl @@ -17,8 +17,8 @@ omit-xml-declaration="no" /> - - + + @@ -34,20 +34,20 @@ - + - - + - + - - + "" - + - - + @@ -60,32 +60,32 @@ - + - + - + - + - + - + - + - + - + - + @@ -93,39 +93,39 @@ - + - + - + - + - + - + - + - + - + user/ - + - + - + @@ -138,23 +138,23 @@ @@ -172,18 +172,18 @@ - + - + - + @@ -193,14 +193,14 @@ - + - + - - - - + + + + @@ -214,10 +214,10 @@ - + - : + : @@ -247,7 +247,7 @@ - + @@ -269,7 +269,7 @@ - + tag: @@ -281,9 +281,7 @@ - - - + @@ -292,13 +290,13 @@ - + << - + < @@ -307,7 +305,7 @@ - + @@ -315,7 +313,7 @@ - + @@ -325,7 +323,7 @@ - + @@ -333,7 +331,7 @@ - + @@ -345,25 +343,124 @@ - + > - + >> - _ + + + + + - : - "" + + + + "" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + the oldest videos + + + the newest videos + + + + + + + the least downloaded videos + + + the most downloaded videos + + + + + + + the least viewed videos + + + the most viewed videos + + + + + + + the shortest videos + + + the lengthest videos + + + + + + + the smallest videos + + + the biggest videos + + + + + + - + + results on pages + + + + + @@ -373,7 +470,7 @@ - + @@ -381,14 +478,108 @@ - - : - : - : + + + + + + + + + + + : + + + + + + + + + + + : + + + + + + + + + + + + + + + + + + order by: + + + + + selected + + + + + + + selected + + + + + + selected + + + + + + selected + + + + + + selected + + + + + + selected + + + + + + + + selected + + + + + + selected + + + + + + + + @@ -440,7 +631,7 @@ - + @@ -449,7 +640,7 @@ - : + : @@ -507,7 +698,7 @@ - : + : @@ -515,7 +706,7 @@ - : + : @@ -523,7 +714,7 @@ - : + : @@ -531,7 +722,7 @@ - : + : @@ -539,7 +730,7 @@ - : + : @@ -547,7 +738,7 @@ - : + : @@ -555,7 +746,7 @@ - : + : @@ -563,7 +754,7 @@ - : + : @@ -590,7 +781,7 @@ - + @@ -620,7 +811,7 @@ - + @@ -635,20 +826,20 @@ - + - : + : - : + : - + @@ -664,38 +855,38 @@ - + - : + : - : + : - + - + - : + : - + @@ -712,29 +903,29 @@ - + - + - + - + - + - + @@ -743,37 +934,37 @@ - + - + - + - + - + - + - + - +