diff --git a/trunk/apache.conf b/trunk/apache.conf new file mode 100644 index 0000000..7bd178f --- /dev/null +++ b/trunk/apache.conf @@ -0,0 +1,25 @@ +NameVirtualHost * + + ServerAdmin webmaster@localhost + + DocumentRoot /var/www/yolanda/ + + Options FollowSymLinks + AllowOverride None + + + AllowEncodedSlashes On + + RewriteEngine On + RewriteRule ^/video/(.*)/([0-9]*)/(.*)$ /video.pl?title=$1&id=$2&$3 + RewriteRule ^/embedded/(.*)/([0-9]*)/(.*)$ /video.pl?title=$1&id=$2&embed=true&$3 + RewriteRule ^/download/([0-9]+)/(.*)$ /download.pl?id=$1&$2 + + ErrorLog /var/log/apache2/error.log + + LogLevel warn + + CustomLog /var/log/apache2/access.log combined + ServerSignature On + + diff --git a/trunk/functions.pl b/trunk/functions.pl index 12337ff..67f0c60 100644 --- a/trunk/functions.pl +++ b/trunk/functions.pl @@ -127,7 +127,7 @@ sub fill_results { 'cc:Work' => { - 'rdf:about' => "$domain/download/$id", + 'rdf:about' => "$domain/download/$id/", 'dc:title' => [$title], 'dc:creator' => [$creator], 'dc:subject' => [$subject], @@ -135,7 +135,7 @@ sub fill_results 'dc:publisher' => [$publisher], 'dc:contributor' => [$contributor], 'dc:date' => [$timestamp], - 'dc:identifier' => ["$domain/video/$title/$id" . ($duration == 0 ? "/action=edit" : "")], + 'dc:identifier' => ["$domain/video/".urlencode($title)."/$id/" . ($duration == 0 ? "/action=edit" : "")], 'dc:source' => [$source], 'dc:language' => [$language], 'dc:coverage' => [$coverage], @@ -155,3 +155,11 @@ sub fill_results #close db $dbh->disconnect() or die $dbh->errstr; } + +#replace chars in url as said in this rfc: http://www.rfc-editor.org/rfc/rfc1738.txt +sub urlencode +{ + my ($url) = @_[0]; + $url =~ s/([^A-Za-z0-9_\$\-.+!*'()])/sprintf("%%%02X", ord($1))/eg; + return $url; +} diff --git a/trunk/style/default.css b/trunk/style/default.css index ce32447..d2d939b 100755 --- a/trunk/style/default.css +++ b/trunk/style/default.css @@ -241,4 +241,4 @@ table.videometadata td { vertical-align: top; -} \ No newline at end of file +} diff --git a/trunk/video.pl b/trunk/video.pl index 148f21f..16befcf 100644 --- a/trunk/video.pl +++ b/trunk/video.pl @@ -59,7 +59,7 @@ elsif($query->url_param('title') or $query->url_param('id')) $dbquery .= " from videos as v, users as u where u.id = v.userid"; $dbquery .= " and match(v.title, v.description, v.subject) against( ? in boolean mode)"; - @args = ($query->url_param('title')); + @args = ($query->url_param('title'), $query->url_param('title')); $sth = $dbh->prepare($dbquery); $rowcount = $sth->execute(@args) or die $dbh->errstr; @@ -140,7 +140,7 @@ elsif($query->url_param('title') or $query->url_param('id')) { 'cc:Work' => { - 'rdf:about' => "$domain/download/$id", + 'rdf:about' => "$domain/download/$id/", 'dc:title' => [$title], 'dc:creator' => [$creator], 'dc:subject' => [$subject], @@ -148,7 +148,7 @@ elsif($query->url_param('title') or $query->url_param('id')) 'dc:publisher' => [$publisher], 'dc:contributor' => [$contributor], 'dc:date' => [$timestamp], - 'dc:identifier' => ["$domain/video/$title/$id"], + 'dc:identifier' => ["$domain/video/".urlencode($title)."/$id/"], 'dc:source' => [$source], 'dc:language' => [$language], 'dc:coverage' => [$coverage], diff --git a/trunk/xsl/xhtml/video.xsl b/trunk/xsl/xhtml/video.xsl index 2ca0420..0d070e9 100644 --- a/trunk/xsl/xhtml/video.xsl +++ b/trunk/xsl/xhtml/video.xsl @@ -62,10 +62,10 @@ - + - + @@ -90,7 +90,7 @@ - + @@ -137,35 +137,33 @@ - +
- +