changed caption to description
git-svn-id: http://yolanda.mister-muffin.de/svn@86 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
parent
ddea677b1c
commit
50dd246404
6 changed files with 20 additions and 20 deletions
|
@ -44,9 +44,9 @@ $dbh = DBI->connect("DBI:mysql:$database:$dbhost", $dbuser, $dbpass) or interrup
|
|||
while(1)
|
||||
{
|
||||
#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;
|
||||
my ($id, $title, $caption, $userid, $timestamp) = $sth->fetchrow_array();
|
||||
my ($id, $title, $description, $userid, $timestamp) = $sth->fetchrow_array();
|
||||
$sth->finish() or interrupt $dbh->errstr;
|
||||
|
||||
if($id)
|
||||
|
@ -139,10 +139,10 @@ while(1)
|
|||
$sth->finish() or interrupt $dbh->errstr;
|
||||
|
||||
#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)
|
||||
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;
|
||||
|
||||
#move video
|
||||
|
@ -159,10 +159,10 @@ while(1)
|
|||
$sth->finish() or interrupt $dbh->errstr;
|
||||
|
||||
#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)
|
||||
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;
|
||||
|
||||
#delete temp file
|
||||
|
|
|
@ -46,7 +46,7 @@ $dbh->do(qq{create table
|
|||
(
|
||||
id int auto_increment not null,
|
||||
title varchar(255) not null,
|
||||
caption text not null,
|
||||
description text not null,
|
||||
userid int not null,
|
||||
status int not null,
|
||||
timestamp datetime not null,
|
||||
|
@ -59,7 +59,7 @@ $dbh->do(qq{create table
|
|||
(
|
||||
id int auto_increment not null,
|
||||
title varchar(255) not null,
|
||||
caption text not null,
|
||||
description text not null,
|
||||
userid int not null,
|
||||
hash char(64) not null,
|
||||
timestamp datetime not null,
|
||||
|
@ -69,7 +69,7 @@ $dbh->do(qq{create table
|
|||
height smallint not null,
|
||||
fps float not null,
|
||||
primary key (id),
|
||||
fulltext (title, caption)
|
||||
fulltext (title, description)
|
||||
)
|
||||
}) or die $dbh->errstr;
|
||||
|
||||
|
|
|
@ -25,13 +25,13 @@ if($query->param('query'))
|
|||
my $dbh = DBI->connect("DBI:mysql:$database:$dbhost", $dbuser, $dbpass) or die $dbh->errstr;
|
||||
|
||||
#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
|
||||
$sth->execute($query->param('query')) or die $dbh->errstr;
|
||||
|
||||
#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
|
||||
push @{ $page->{'results'}->{'result'} },
|
||||
|
|
|
@ -26,8 +26,8 @@ if($userid)
|
|||
my $dbh = DBI->connect("DBI:mysql:$database:$host", $dbuser, $dbpass) or die $dbh->errstr;
|
||||
|
||||
#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;
|
||||
$sth->execute($query->param("title"), $query->param("caption"), $userid) 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("description"), $userid) or die $dbh->errstr;
|
||||
$sth->finish() or die $dbh->errstr;
|
||||
|
||||
#get the id of the inserted db entry
|
||||
|
|
|
@ -25,21 +25,21 @@ if($query->param('title') or $query->param('id'))
|
|||
if($query->param('id'))
|
||||
{
|
||||
#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
|
||||
$rowcount = $sth->execute($query->param('id')) or die $dbh->errstr;
|
||||
}
|
||||
else
|
||||
{
|
||||
#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
|
||||
$rowcount = $sth->execute($query->param('title')) or die $dbh->errstr;
|
||||
}
|
||||
|
||||
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
|
||||
push @{ $page->{'video'} },
|
||||
|
@ -53,7 +53,7 @@ if($query->param('title') or $query->param('id'))
|
|||
'dc:title' => [$title],
|
||||
'dc:date' => [$timestamp],
|
||||
'dc:publisher' => [get_username_from_id($userid)],
|
||||
'dc:description'=> [$caption]
|
||||
'dc:description'=> [$description]
|
||||
},
|
||||
'cc:License' =>
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ if($query->param('title') or $query->param('id'))
|
|||
{
|
||||
$page->{results}->{query} = decode_utf8($query->param('title'));
|
||||
#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
|
||||
push @{ $page->{'results'}->{'result'} },
|
||||
|
@ -80,7 +80,7 @@ if($query->param('title') or $query->param('id'))
|
|||
'dc:title' => [$title],
|
||||
'dc:date' => [$timestamp],
|
||||
'dc:publisher' => [get_username_from_id($userid)],
|
||||
'dc:description'=> [$caption]
|
||||
'dc:description'=> [$description]
|
||||
},
|
||||
'cc:License' =>
|
||||
{
|
||||
|
|
|
@ -453,7 +453,7 @@
|
|||
<br />
|
||||
<xsl:value-of select="$locale_strings/str[@id='DC.description']" />:
|
||||
<br />
|
||||
<input name="caption" type="text" size="30" />
|
||||
<input name="description" type="text" size="30" />
|
||||
<br />
|
||||
<input type="submit" name="submit" >
|
||||
<xsl:attribute name="value">
|
||||
|
|
Loading…
Reference in a new issue