From cd2518d9e3efc175e08f3bd8e29c0087ac8bdbcc Mon Sep 17 00:00:00 2001 From: josch Date: Wed, 24 Oct 2007 12:56:56 +0000 Subject: [PATCH] added correct paths git-svn-id: http://yolanda.mister-muffin.de/svn@135 7eef14d0-6ed0-489d-bf55-20463b2d70db --- trunk/include.pl | 5 +++-- trunk/login.pl | 4 ++-- trunk/video.pl | 21 ++++++++++++--------- trunk/xsl/xhtml.xsl | 22 +++++++++++----------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/trunk/include.pl b/trunk/include.pl index 4a8974c..c354cc3 100644 --- a/trunk/include.pl +++ b/trunk/include.pl @@ -17,10 +17,11 @@ $database = 'gnutube'; $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; +$domain = 'http://localhost'; $session_name = 'sid'; -$XMLDecl = ''; +$XMLDecl = qq{}; $locale = "en-US"; -$stylesheet = "./style/gnutube.css"; +$stylesheet = "/style/gnutube.css"; $xmlns_dc = "http://purl.org/dc/elements/1.1/"; $xmlns_cc = "http://web.resource.org/cc/"; $xmlns_rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; diff --git a/trunk/login.pl b/trunk/login.pl index cc8443a..1d8073d 100644 --- a/trunk/login.pl +++ b/trunk/login.pl @@ -46,7 +46,7 @@ if($query->param('action')) cache => undef, # or File::Cache->new, args => $query, consumer_secret => $session->id, #is this save? don't know... - required_root => "http://localhost/" ); + required_root => $domain ); #is an openid passed? if($query->param('user')) @@ -60,7 +60,7 @@ if($query->param('action')) } $check_url = $claimed->check_url( return_to => "http://localhost/gnutube/login.pl?action=openid&ret=true", #on success return to this address - trust_root => "http://localhost/"); #this is the string the user will be asked to trust + trust_root => $domain); #this is the string the user will be asked to trust #redirect to openid server to check claim print $query->redirect($check_url); diff --git a/trunk/video.pl b/trunk/video.pl index 7268fef..da577ba 100644 --- a/trunk/video.pl +++ b/trunk/video.pl @@ -114,7 +114,7 @@ if($query->url_param('title') or $query->url_param('id')) #before code cleanup, this was a really obfuscated array/hash creation push @{ $page->{'video'} }, { - 'thumbnail' => "./video-stills/$id", + 'thumbnail' => "$domain/video-stills/$id", 'filesize' => $filesize, 'duration' => $duration, 'width' => $width, @@ -126,7 +126,7 @@ if($query->url_param('title') or $query->url_param('id')) { 'cc:Work' => { - 'rdf:about' => "download.pl?id=$id&view=true", + 'rdf:about' => "$domain/download/$id", 'dc:title' => [$title], 'dc:creator' => [$creator], 'dc:subject' => [$subject], @@ -134,7 +134,7 @@ if($query->url_param('title') or $query->url_param('id')) 'dc:publisher' => [$username], 'dc:contributor' => [$contributor], 'dc:date' => [$timestamp], - 'dc:identifier' => ["video.pl?title=$title&id=$id"], + 'dc:identifier' => ["$domain/video/$title/$id"], 'dc:source' => [$source], 'dc:language' => [$language], 'dc:coverage' => [$coverage], @@ -148,16 +148,17 @@ if($query->url_param('title') or $query->url_param('id')) }; #get comments - $sth = $dbh->prepare(qq{select comments.text, users.username, from_unixtime( comments.timestamp ) + $sth = $dbh->prepare(qq{select comments.id, comments.text, users.username, from_unixtime( comments.timestamp ) from comments, users where comments.videoid=? and users.id=comments.userid}) or die $dbh->errstr; $sth->execute($id) or die $dbh->errstr; - while (my ($text, $username, $timestamp) = $sth->fetchrow_array()) + while (my ($commentid, $text, $username, $timestamp) = $sth->fetchrow_array()) { push @{ $page->{'comments'}->{'comment'} }, { 'text' => [decode_utf8($text)], - 'username' => [$username], - 'timestamp' => [$timestamp] + 'username' => $username, + 'timestamp' => $timestamp, + 'id' => $commentid }; } @@ -212,10 +213,12 @@ if($query->url_param('title') or $query->url_param('id')) print $session->header(-type=>'text/xml'); #print xml - print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page'); + print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page', AttrIndent => 1); } else -{ +{ foreach $key (sort keys(%ENV)) { + print "$key = $ENV{$key}

"; + } %page = (); #if a username is associated with session id, username is nonempty diff --git a/trunk/xsl/xhtml.xsl b/trunk/xsl/xhtml.xsl index 12b5c05..b807acc 100755 --- a/trunk/xsl/xhtml.xsl +++ b/trunk/xsl/xhtml.xsl @@ -25,7 +25,7 @@ - + @@ -80,7 +80,7 @@ - open id logo + open id logo @@ -166,7 +166,7 @@

- GNUtube logo (320x100) + GNUtube logo (320x100)