started upload backend, several little fixes

git-svn-id: http://yolanda.mister-muffin.de/svn@197 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2007-12-11 15:05:33 +00:00
parent 22417a9342
commit 3be9501d41
17 changed files with 59 additions and 46 deletions

View file

@ -1,5 +1,3 @@
#!/usr/bin/perl
require "include.pl";
require "functions.pl"; require "functions.pl";
#initialize session data #initialize session data

View file

@ -1,5 +1,3 @@
#!/usr/bin/perl
require "include.pl";
require "functions.pl"; require "functions.pl";
#initialize session data #initialize session data

View file

@ -1,4 +1,3 @@
#!/usr/bin/perl
require "include.pl"; require "include.pl";
sub get_userinfo_from_sid sub get_userinfo_from_sid

View file

@ -1,5 +1,3 @@
#!/usr/bin/perl
require "include.pl";
require "functions.pl"; require "functions.pl";
#create or resume session #create or resume session

View file

@ -1,6 +1,3 @@
#!/usr/bin/perl
require "include.pl";
#create or resume session #create or resume session
CGI::Session->name($session_name); CGI::Session->name($session_name);
my $session = new CGI::Session; my $session = new CGI::Session;

View file

@ -123,9 +123,9 @@
<string id="this_is_page_3">This is page 3 of 5.</string> <string id="this_is_page_3">This is page 3 of 5.</string>
<string id="this_is_page_4">This is page 4 of 5.</string> <string id="this_is_page_4">This is page 4 of 5.</string>
<string id="this_is_page_5">This is page 5 of 5.</string> <string id="this_is_page_5">This is page 5 of 5.</string>
<string id="button_page_1">go to page 1</string> <string id="button_page_1">back to page 1</string>
<string id="button_page_3">go to page 3</string> <string id="button_page_3">back to page 3</string>
<string id="button_page_4">go to page 4</string> <string id="button_page_4">back to page 4</string>
<!-- languages --> <!-- languages -->
<string id="language_en-us">English</string> <string id="language_en-us">English</string>

View file

@ -1,5 +1,3 @@
#!/usr/bin/perl
require "include.pl";
require "functions.pl"; require "functions.pl";
#initialize session data #initialize session data

View file

@ -1,5 +1,3 @@
#!/usr/bin/perl
require "include.pl";
require "functions.pl"; require "functions.pl";
#initialize session data #initialize session data

View file

@ -1,4 +1,3 @@
require "include.pl";
require "functions.pl"; require "functions.pl";
#initialize session data #initialize session data

View file

@ -16,7 +16,7 @@
<str id="page_login">/login.pl</str> <str id="page_login">/login.pl</str>
<str id="page_login-openid">/login.pl?action=openid</str> <str id="page_login-openid">/login.pl?action=openid</str>
<str id="page_logout">/login.pl?action=logout</str> <str id="page_logout">/login.pl?action=logout</str>
<str id="page_authors">INSERT LINK TO YOLANDA AUTHORS HERE</str> <str id="page_authors">http://yolanda.mister-muffin.de/trac</str>
<str id="page_license">http://www.fsf.org/licensing/licenses/agpl-3.0.html</str> <str id="page_license">http://www.fsf.org/licensing/licenses/agpl-3.0.html</str>
<str id="page_source-code">http://yolanda.mister-muffin.de/trac/browser/trunk</str> <str id="page_source-code">http://yolanda.mister-muffin.de/trac/browser/trunk</str>
<str id="page_register">/register.pl</str> <str id="page_register">/register.pl</str>

View file

@ -207,6 +207,7 @@ img
span.code span.code
{ {
font-family: monospace; font-family: monospace;
font-weight: normal;
} }
span.heading span.heading

View file

@ -1,5 +1,3 @@
#!/usr/bin/perl
require "include.pl";
require "functions.pl"; require "functions.pl";
#create or resume session #create or resume session
@ -15,7 +13,47 @@ if($userinfo->{'username'})
{ {
if($query->param('2')) if($query->param('2'))
{ {
$page->{'uploadform'}->{'page'} = '2'; if($query->param('DC.Title')&&$query->param('DC.Subject')&&$query->param('DC.Description'))
{
$page->{'innerresults'} = [''];
my @args = ();
#build mysql query
$dbquery = "select v.id, v.title, v.description, u.username,
from_unixtime( v.timestamp ), v.creator, v.subject,
v.contributor, v.source, v.language, v.coverage, v.rights,
v.license, filesize, duration, width, height, fps, viewcount,
downloadcount,
match(v.title, v.description, v.subject)
against( ? in boolean mode) as relevance
from videos as v, users as u where u.id = v.userid
and match(v.title, v.description, v.subject)
against( ? in boolean mode)";
push @args, $query->param('DC.Title'), $query->param('DC.Title');
fill_results(@args);
$page->{'uploadform'}->{'page'} = '2';
}
else
{
if(!$query->param('DC.Title'))
{
$page->{'message'}->{'type'} = "error";
$page->{'message'}->{'text'} = "error_missing_DC.Title";
}
elsif(!$query->param('DC.Subject'))
{
$page->{'message'}->{'type'} = "error";
$page->{'message'}->{'text'} = "error_missing_DC.Subject";
}
elsif(!$query->param('DC.Description'))
{
$page->{'message'}->{'type'} = "error";
$page->{'message'}->{'text'} = "error_missing_DC.Description";
}
$page->{'uploadform'}->{'page'} = '1';
}
} }
elsif($query->param('3')) elsif($query->param('3'))
{ {
@ -37,11 +75,9 @@ if($userinfo->{'username'})
{ {
$page->{'uploadform'}->{'page'} = '1'; $page->{'uploadform'}->{'page'} = '1';
} }
$temp = $query->param('DC.Description');
$temp =~ s/\r\n/\n/g;
$page->{'uploadform'}->{'DC.Title'} = $query->param('DC.Title'); $page->{'uploadform'}->{'DC.Title'} = $query->param('DC.Title');
$page->{'uploadform'}->{'DC.Subject'} = $query->param('DC.Subject'); $page->{'uploadform'}->{'DC.Subject'} = $query->param('DC.Subject');
$page->{'uploadform'}->{'DC.Description'} = $temp; $page->{'uploadform'}->{'DC.Description'} = $query->param('DC.Description');
$page->{'uploadform'}->{'DC.Creator'} = $query->param('DC.Creator'); $page->{'uploadform'}->{'DC.Creator'} = $query->param('DC.Creator');
$page->{'uploadform'}->{'DC.Source'} = $query->param('DC.Source'); $page->{'uploadform'}->{'DC.Source'} = $query->param('DC.Source');
$page->{'uploadform'}->{'DC.Language'} = $query->param('DC.Language'); $page->{'uploadform'}->{'DC.Language'} = $query->param('DC.Language');

View file

@ -1,5 +1,3 @@
#!/usr/bin/perl
require "include.pl";
require "functions.pl"; require "functions.pl";
CGI::Session->name($session_name); CGI::Session->name($session_name);
@ -22,7 +20,7 @@ sub hook
@page = get_page_array(@userinfo); @page = get_page_array(@userinfo);
if($userinfo->{'id'}) if($userinfo->{'id'}&&$query->param("DC.Title") && $query->param("DC.Description") && $query->param("DC.Subject"))
{ {
#connect to db #connect to db
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;

View file

@ -1,4 +1,3 @@
require "include.pl";
require "functions.pl"; require "functions.pl";
#initialize session data #initialize session data

View file

@ -208,7 +208,7 @@
<xsl:call-template name="uploadform"/> <xsl:call-template name="uploadform"/>
</xsl:when> </xsl:when>
<xsl:when test="//search"> <xsl:when test="//search">
<xsl:call-template name="search"/> <xsl:call-template name="results"/>
</xsl:when> </xsl:when>
<xsl:when test="//video"> <xsl:when test="//video">
<xsl:call-template name="video"/> <xsl:call-template name="video"/>
@ -255,12 +255,6 @@
</html> </html>
</xsl:template> </xsl:template>
<xsl:template name="search">
<xsl:call-template name="results"/>
</xsl:template>
<xsl:template name="logo-small"> <xsl:template name="logo-small">
<a href="/"> <a href="/">

View file

@ -59,7 +59,7 @@
<xsl:value-of select="rdf:RDF/cc:Work/dc:identifier" /> <xsl:value-of select="rdf:RDF/cc:Work/dc:identifier" />
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="concat(rdf:RDF/cc:Work/dc:identifier, '/action=edit')" /> <xsl:value-of select="concat(rdf:RDF/cc:Work/dc:identifier, 'action=edit')" />
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:attribute> </xsl:attribute>

View file

@ -43,7 +43,6 @@
</xsl:attribute> </xsl:attribute>
</input> </input>
<fieldset> <fieldset>
<input type="hidden" name="page" value="2" />
<div> <div>
<xsl:value-of select="$locale_strings[@id='instruction_title']" /> <xsl:value-of select="$locale_strings[@id='instruction_title']" />
<br /> <br />
@ -186,6 +185,7 @@
<xsl:value-of select="$locale_strings[@id='instruction_language']" /> <xsl:value-of select="$locale_strings[@id='instruction_language']" />
<br /> <br />
<select name="DC.Language"> <select name="DC.Language">
<option></option>
<option> <option>
<xsl:value-of select="$locale_strings[@id='language_en-us']" /> <xsl:value-of select="$locale_strings[@id='language_en-us']" />
</option> </option>
@ -385,7 +385,7 @@
<xsl:value-of select="$locale_strings[@id='DC.Title']" />: <xsl:value-of select="$locale_strings[@id='DC.Title']" />:
</td> </td>
<td class="rightcell"> <td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:title" /> <xsl:value-of select="//uploadform/@DC.Title" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -393,7 +393,7 @@
<xsl:value-of select="$locale_strings[@id='DC.Subject']" />: <xsl:value-of select="$locale_strings[@id='DC.Subject']" />:
</td> </td>
<td class="rightcell"> <td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:subject" /> <xsl:value-of select="//uploadform/@DC.Subject" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -401,7 +401,7 @@
<xsl:value-of select="$locale_strings[@id='DC.Description']" />: <xsl:value-of select="$locale_strings[@id='DC.Description']" />:
</td> </td>
<td class="rightcell"> <td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:description" /> <xsl:value-of select="//uploadform/@DC.Description" />
</td> </td>
</tr> </tr>
</table> </table>
@ -418,7 +418,7 @@
<xsl:value-of select="$locale_strings[@id='DC.Creator']" />: <xsl:value-of select="$locale_strings[@id='DC.Creator']" />:
</td> </td>
<td class="rightcell"> <td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:creator" /> <xsl:value-of select="//uploadform/@DC.Creator" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -426,7 +426,7 @@
<xsl:value-of select="$locale_strings[@id='DC.Source']" />: <xsl:value-of select="$locale_strings[@id='DC.Source']" />:
</td> </td>
<td class="rightcell"> <td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:source" /> <xsl:value-of select="//uploadform/@DC.Source" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -434,7 +434,7 @@
<xsl:value-of select="$locale_strings[@id='DC.Language']" />: <xsl:value-of select="$locale_strings[@id='DC.Language']" />:
</td> </td>
<td class="rightcell"> <td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:language" /> <xsl:value-of select="//uploadform/@DC.Language" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -442,7 +442,7 @@
<xsl:value-of select="$locale_strings[@id='DC.Coverage']" />: <xsl:value-of select="$locale_strings[@id='DC.Coverage']" />:
</td> </td>
<td class="rightcell"> <td class="rightcell">
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:coverage" /> <xsl:value-of select="//uploadform/@DC.Coverage" />
</td> </td>
</tr> </tr>
</table> </table>
@ -525,4 +525,4 @@
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>