changed caption to description

git-svn-id: http://yolanda.mister-muffin.de/svn@86 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2007-10-18 09:53:32 +00:00
parent ddea677b1c
commit 50dd246404
6 changed files with 20 additions and 20 deletions

View file

@ -44,9 +44,9 @@ $dbh = DBI->connect("DBI:mysql:$database:$dbhost", $dbuser, $dbpass) or interrup
while(1) while(1)
{ {
#get fresh video id from db #get fresh video id from db
my $sth = $dbh->prepare(qq{select id, title, caption, userid, timestamp from uploaded where status = 0 limit 1}) or interrupt $dbh->errstr; my $sth = $dbh->prepare(qq{select id, title, description, userid, timestamp from uploaded where status = 0 limit 1}) or interrupt $dbh->errstr;
$sth->execute() or interrupt $dbh->errstr; $sth->execute() or interrupt $dbh->errstr;
my ($id, $title, $caption, $userid, $timestamp) = $sth->fetchrow_array(); my ($id, $title, $description, $userid, $timestamp) = $sth->fetchrow_array();
$sth->finish() or interrupt $dbh->errstr; $sth->finish() or interrupt $dbh->errstr;
if($id) if($id)
@ -139,10 +139,10 @@ while(1)
$sth->finish() or interrupt $dbh->errstr; $sth->finish() or interrupt $dbh->errstr;
#add video to videos table #add video to videos table
$sth = $dbh->prepare(qq{insert into videos (id, title, caption, userid, timestamp, $sth = $dbh->prepare(qq{insert into videos (id, title, description, userid, timestamp,
hash, filesize, duration, width, height, fps) hash, filesize, duration, width, height, fps)
values (?, ?, ?, ?, ?, ?, ?, time_to_sec( ? ), ?, ?, ?)}) or interrupt $dbh->errstr; values (?, ?, ?, ?, ?, ?, ?, time_to_sec( ? ), ?, ?, ?)}) or interrupt $dbh->errstr;
$sth->execute($id, $title, $caption, $userid, $timestamp, $sha, $filesize, $duration, $width, $height, $fps) or interrupt $dbh->errstr; $sth->execute($id, $title, $description, $userid, $timestamp, $sha, $filesize, $duration, $width, $height, $fps) or interrupt $dbh->errstr;
$sth->finish() or interrupt $dbh->errstr; $sth->finish() or interrupt $dbh->errstr;
#move video #move video
@ -159,10 +159,10 @@ while(1)
$sth->finish() or interrupt $dbh->errstr; $sth->finish() or interrupt $dbh->errstr;
#add video to videos table #add video to videos table
$sth = $dbh->prepare(qq{insert into videos (id, title, caption, userid, timestamp, $sth = $dbh->prepare(qq{insert into videos (id, title, description, userid, timestamp,
hash, filesize, duration, width, height, fps) hash, filesize, duration, width, height, fps)
values (?, ?, ?, ?, ?, ?, ?, time_to_sec( ? ), ?, ?, ?)}) or interrupt $dbh->errstr; values (?, ?, ?, ?, ?, ?, ?, time_to_sec( ? ), ?, ?, ?)}) or interrupt $dbh->errstr;
$sth->execute($id, $title, $caption, $userid, $timestamp, $sha, $filesize, $duration, $width, $height, $fps) or interrupt $dbh->errstr; $sth->execute($id, $title, $description, $userid, $timestamp, $sha, $filesize, $duration, $width, $height, $fps) or interrupt $dbh->errstr;
$sth->finish() or interrupt $dbh->errstr; $sth->finish() or interrupt $dbh->errstr;
#delete temp file #delete temp file

View file

@ -46,7 +46,7 @@ $dbh->do(qq{create table
( (
id int auto_increment not null, id int auto_increment not null,
title varchar(255) not null, title varchar(255) not null,
caption text not null, description text not null,
userid int not null, userid int not null,
status int not null, status int not null,
timestamp datetime not null, timestamp datetime not null,
@ -59,7 +59,7 @@ $dbh->do(qq{create table
( (
id int auto_increment not null, id int auto_increment not null,
title varchar(255) not null, title varchar(255) not null,
caption text not null, description text not null,
userid int not null, userid int not null,
hash char(64) not null, hash char(64) not null,
timestamp datetime not null, timestamp datetime not null,
@ -69,7 +69,7 @@ $dbh->do(qq{create table
height smallint not null, height smallint not null,
fps float not null, fps float not null,
primary key (id), primary key (id),
fulltext (title, caption) fulltext (title, description)
) )
}) or die $dbh->errstr; }) or die $dbh->errstr;

View file

@ -25,13 +25,13 @@ if($query->param('query'))
my $dbh = DBI->connect("DBI:mysql:$database:$dbhost", $dbuser, $dbpass) or die $dbh->errstr; my $dbh = DBI->connect("DBI:mysql:$database:$dbhost", $dbuser, $dbpass) or die $dbh->errstr;
#prepare query #prepare query
my $sth = $dbh->prepare(qq{select id, title, caption, userid, timestamp from videos where match(title, caption) against( ? ) }) or die $dbh->errstr; my $sth = $dbh->prepare(qq{select id, title, description, userid, timestamp from videos where match(title, description) against( ? ) }) or die $dbh->errstr;
#execute it #execute it
$sth->execute($query->param('query')) or die $dbh->errstr; $sth->execute($query->param('query')) or die $dbh->errstr;
#get every returned value #get every returned value
while (my ($id, $title, $caption, $userid, $timestamp) = $sth->fetchrow_array()) while (my ($id, $title, $description, $userid, $timestamp) = $sth->fetchrow_array())
{ {
#before code cleanup, this was a really obfuscated array/hash creation #before code cleanup, this was a really obfuscated array/hash creation
push @{ $page->{'results'}->{'result'} }, push @{ $page->{'results'}->{'result'} },

View file

@ -26,8 +26,8 @@ if($userid)
my $dbh = DBI->connect("DBI:mysql:$database:$host", $dbuser, $dbpass) or die $dbh->errstr; my $dbh = DBI->connect("DBI:mysql:$database:$host", $dbuser, $dbpass) or die $dbh->errstr;
#make new entry for video into the databse #make new entry for video into the databse
my $sth = $dbh->prepare(qq{insert into uploaded (title, caption, userid, status, timestamp) values ( ?, ?, ?, 0, now())}) or die $dbh->errstr; my $sth = $dbh->prepare(qq{insert into uploaded (title, description, userid, status, timestamp) values ( ?, ?, ?, 0, now())}) or die $dbh->errstr;
$sth->execute($query->param("title"), $query->param("caption"), $userid) or die $dbh->errstr; $sth->execute($query->param("title"), $query->param("description"), $userid) or die $dbh->errstr;
$sth->finish() or die $dbh->errstr; $sth->finish() or die $dbh->errstr;
#get the id of the inserted db entry #get the id of the inserted db entry

View file

@ -25,21 +25,21 @@ if($query->param('title') or $query->param('id'))
if($query->param('id')) if($query->param('id'))
{ {
#prepare query #prepare query
$sth = $dbh->prepare(qq{select id, title, caption, userid, timestamp from videos where id = ? }) or die $dbh->errstr; $sth = $dbh->prepare(qq{select id, title, description, userid, timestamp from videos where id = ? }) or die $dbh->errstr;
#execute it #execute it
$rowcount = $sth->execute($query->param('id')) or die $dbh->errstr; $rowcount = $sth->execute($query->param('id')) or die $dbh->errstr;
} }
else else
{ {
#prepare query #prepare query
$sth = $dbh->prepare(qq{select id, title, caption, userid, timestamp from videos where title = ? }) or die $dbh->errstr; $sth = $dbh->prepare(qq{select id, title, description, userid, timestamp from videos where title = ? }) or die $dbh->errstr;
#execute it #execute it
$rowcount = $sth->execute($query->param('title')) or die $dbh->errstr; $rowcount = $sth->execute($query->param('title')) or die $dbh->errstr;
} }
if($rowcount == 1) if($rowcount == 1)
{ {
my ($id, $title, $caption, $userid, $timestamp) = $sth->fetchrow_array(); my ($id, $title, $description, $userid, $timestamp) = $sth->fetchrow_array();
#before code cleanup, this was a really obfuscated array/hash creation #before code cleanup, this was a really obfuscated array/hash creation
push @{ $page->{'video'} }, push @{ $page->{'video'} },
@ -53,7 +53,7 @@ if($query->param('title') or $query->param('id'))
'dc:title' => [$title], 'dc:title' => [$title],
'dc:date' => [$timestamp], 'dc:date' => [$timestamp],
'dc:publisher' => [get_username_from_id($userid)], 'dc:publisher' => [get_username_from_id($userid)],
'dc:description'=> [$caption] 'dc:description'=> [$description]
}, },
'cc:License' => 'cc:License' =>
{ {
@ -66,7 +66,7 @@ if($query->param('title') or $query->param('id'))
{ {
$page->{results}->{query} = decode_utf8($query->param('title')); $page->{results}->{query} = decode_utf8($query->param('title'));
#get every returned value #get every returned value
while (my ($id, $title, $caption, $userid, $timestamp) = $sth->fetchrow_array()) while (my ($id, $title, $description, $userid, $timestamp) = $sth->fetchrow_array())
{ {
#before code cleanup, this was a really obfuscated array/hash creation #before code cleanup, this was a really obfuscated array/hash creation
push @{ $page->{'results'}->{'result'} }, push @{ $page->{'results'}->{'result'} },
@ -80,7 +80,7 @@ if($query->param('title') or $query->param('id'))
'dc:title' => [$title], 'dc:title' => [$title],
'dc:date' => [$timestamp], 'dc:date' => [$timestamp],
'dc:publisher' => [get_username_from_id($userid)], 'dc:publisher' => [get_username_from_id($userid)],
'dc:description'=> [$caption] 'dc:description'=> [$description]
}, },
'cc:License' => 'cc:License' =>
{ {

View file

@ -453,7 +453,7 @@
<br /> <br />
<xsl:value-of select="$locale_strings/str[@id='DC.description']" />: <xsl:value-of select="$locale_strings/str[@id='DC.description']" />:
<br /> <br />
<input name="caption" type="text" size="30" /> <input name="description" type="text" size="30" />
<br /> <br />
<input type="submit" name="submit" > <input type="submit" name="submit" >
<xsl:attribute name="value"> <xsl:attribute name="value">