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 @@ <xsl:choose> <xsl:when test="boolean(//frontpage)"> - <xsl:value-of select="$site_strings/str[@id='site_name']" /> + <xsl:value-of select="$site_strings[@id='site_name']" /> - - <xsl:value-of select="$site_strings/str[@id='site_motto']" /> + <xsl:value-of select="$site_strings[@id='site_motto']" /> </xsl:when> <xsl:when test="boolean(//resultspage)"> - <xsl:value-of select="$site_strings/str[@id='site_name']" /> + <xsl:value-of select="$site_strings[@id='site_name']" /> - - <xsl:value-of select="$locale_strings/str[@id='results_for_query']" /> + <xsl:value-of select="$locale_strings[@id='results_for_query']" /> "<xsl:value-of select="//resultspage/@query" />" </xsl:when> <xsl:otherwise> - <xsl:value-of select="$site_strings/str[@id='site_name']" /> + <xsl:value-of select="$site_strings[@id='site_name']" /> - - <xsl:value-of select="$site_strings/str[@id='site_motto']" /> + <xsl:value-of select="$site_strings[@id='site_motto']" /> </xsl:otherwise> </xsl:choose> @@ -60,32 +60,32 @@ @@ -93,39 +93,39 @@ @@ -138,23 +138,23 @@ @@ -172,18 +172,18 @@ @@ -449,7 +640,7 @@ - : + :
@@ -507,7 +698,7 @@