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:
parent
22417a9342
commit
3be9501d41
17 changed files with 59 additions and 46 deletions
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/perl
|
||||
require "include.pl";
|
||||
require "functions.pl";
|
||||
|
||||
#initialize session data
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/perl
|
||||
require "include.pl";
|
||||
require "functions.pl";
|
||||
|
||||
#initialize session data
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/perl
|
||||
require "include.pl";
|
||||
|
||||
sub get_userinfo_from_sid
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/perl
|
||||
require "include.pl";
|
||||
require "functions.pl";
|
||||
|
||||
#create or resume session
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
#!/usr/bin/perl
|
||||
require "include.pl";
|
||||
|
||||
#create or resume session
|
||||
CGI::Session->name($session_name);
|
||||
my $session = new CGI::Session;
|
||||
|
|
|
@ -123,9 +123,9 @@
|
|||
<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_5">This is page 5 of 5.</string>
|
||||
<string id="button_page_1">go to page 1</string>
|
||||
<string id="button_page_3">go to page 3</string>
|
||||
<string id="button_page_4">go to page 4</string>
|
||||
<string id="button_page_1">back to page 1</string>
|
||||
<string id="button_page_3">back to page 3</string>
|
||||
<string id="button_page_4">back to page 4</string>
|
||||
|
||||
<!-- languages -->
|
||||
<string id="language_en-us">English</string>
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/perl
|
||||
require "include.pl";
|
||||
require "functions.pl";
|
||||
|
||||
#initialize session data
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/perl
|
||||
require "include.pl";
|
||||
require "functions.pl";
|
||||
|
||||
#initialize session data
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
require "include.pl";
|
||||
require "functions.pl";
|
||||
|
||||
#initialize session data
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<str id="page_login">/login.pl</str>
|
||||
<str id="page_login-openid">/login.pl?action=openid</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_source-code">http://yolanda.mister-muffin.de/trac/browser/trunk</str>
|
||||
<str id="page_register">/register.pl</str>
|
||||
|
|
|
@ -207,6 +207,7 @@ img
|
|||
span.code
|
||||
{
|
||||
font-family: monospace;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
span.heading
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/perl
|
||||
require "include.pl";
|
||||
require "functions.pl";
|
||||
|
||||
#create or resume session
|
||||
|
@ -15,7 +13,47 @@ if($userinfo->{'username'})
|
|||
{
|
||||
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'))
|
||||
{
|
||||
|
@ -37,11 +75,9 @@ if($userinfo->{'username'})
|
|||
{
|
||||
$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.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.Source'} = $query->param('DC.Source');
|
||||
$page->{'uploadform'}->{'DC.Language'} = $query->param('DC.Language');
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/perl
|
||||
require "include.pl";
|
||||
require "functions.pl";
|
||||
|
||||
CGI::Session->name($session_name);
|
||||
|
@ -22,7 +20,7 @@ sub hook
|
|||
|
||||
@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
|
||||
my $dbh = DBI->connect("DBI:mysql:$database:$host", $dbuser, $dbpass) or die $dbh->errstr;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
require "include.pl";
|
||||
require "functions.pl";
|
||||
|
||||
#initialize session data
|
||||
|
|
|
@ -208,7 +208,7 @@
|
|||
<xsl:call-template name="uploadform"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="//search">
|
||||
<xsl:call-template name="search"/>
|
||||
<xsl:call-template name="results"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="//video">
|
||||
<xsl:call-template name="video"/>
|
||||
|
@ -255,12 +255,6 @@
|
|||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="search">
|
||||
|
||||
<xsl:call-template name="results"/>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="logo-small">
|
||||
|
||||
<a href="/">
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
<xsl:value-of select="rdf:RDF/cc:Work/dc:identifier" />
|
||||
</xsl:when>
|
||||
<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:choose>
|
||||
</xsl:attribute>
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
</xsl:attribute>
|
||||
</input>
|
||||
<fieldset>
|
||||
<input type="hidden" name="page" value="2" />
|
||||
<div>
|
||||
<xsl:value-of select="$locale_strings[@id='instruction_title']" />
|
||||
<br />
|
||||
|
@ -186,6 +185,7 @@
|
|||
<xsl:value-of select="$locale_strings[@id='instruction_language']" />
|
||||
<br />
|
||||
<select name="DC.Language">
|
||||
<option></option>
|
||||
<option>
|
||||
<xsl:value-of select="$locale_strings[@id='language_en-us']" />
|
||||
</option>
|
||||
|
@ -385,7 +385,7 @@
|
|||
<xsl:value-of select="$locale_strings[@id='DC.Title']" />:
|
||||
</td>
|
||||
<td class="rightcell">
|
||||
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:title" />
|
||||
<xsl:value-of select="//uploadform/@DC.Title" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -393,7 +393,7 @@
|
|||
<xsl:value-of select="$locale_strings[@id='DC.Subject']" />:
|
||||
</td>
|
||||
<td class="rightcell">
|
||||
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:subject" />
|
||||
<xsl:value-of select="//uploadform/@DC.Subject" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -401,7 +401,7 @@
|
|||
<xsl:value-of select="$locale_strings[@id='DC.Description']" />:
|
||||
</td>
|
||||
<td class="rightcell">
|
||||
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:description" />
|
||||
<xsl:value-of select="//uploadform/@DC.Description" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -418,7 +418,7 @@
|
|||
<xsl:value-of select="$locale_strings[@id='DC.Creator']" />:
|
||||
</td>
|
||||
<td class="rightcell">
|
||||
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:creator" />
|
||||
<xsl:value-of select="//uploadform/@DC.Creator" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -426,7 +426,7 @@
|
|||
<xsl:value-of select="$locale_strings[@id='DC.Source']" />:
|
||||
</td>
|
||||
<td class="rightcell">
|
||||
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:source" />
|
||||
<xsl:value-of select="//uploadform/@DC.Source" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -434,7 +434,7 @@
|
|||
<xsl:value-of select="$locale_strings[@id='DC.Language']" />:
|
||||
</td>
|
||||
<td class="rightcell">
|
||||
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:language" />
|
||||
<xsl:value-of select="//uploadform/@DC.Language" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -442,7 +442,7 @@
|
|||
<xsl:value-of select="$locale_strings[@id='DC.Coverage']" />:
|
||||
</td>
|
||||
<td class="rightcell">
|
||||
<xsl:value-of select="//video/rdf:RDF/cc:Work/dc:coverage" />
|
||||
<xsl:value-of select="//uploadform/@DC.Coverage" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -525,4 +525,4 @@
|
|||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
</xsl:stylesheet>
|
||||
|
|
Loading…
Reference in a new issue