added random search

git-svn-id: http://yolanda.mister-muffin.de/svn@327 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2008-04-27 20:27:21 +00:00
parent e7dbb39515
commit 07f6ffc2c2
2 changed files with 5 additions and 1 deletions

View file

@ -18,7 +18,7 @@
<string id="search_frontpage_size">3</string> <string id="search_frontpage_size">3</string>
<string id="search_results_default">10</string> <string id="search_results_default">10</string>
<string id="search_results_max">500</string> <string id="search_results_max">500</string>
<string id="search_order_default">relevance</string><!-- a v.column in the videos table or relevance --> <string id="search_order_default">relevance</string><!-- a v.column in the videos table or relevance or random -->
<string id="search_sort_default">desc</string><!-- asc or desc --> <string id="search_sort_default">desc</string><!-- asc or desc -->
<!-- general page settings --> <!-- general page settings -->

View file

@ -252,6 +252,10 @@ sub get_sqlquery
{ {
$dbquery .= " order by relevance"; $dbquery .= " order by relevance";
} }
elsif($order eq 'random')
{
$dbquery .= " order by rand()";
}
else else
{ {
$dbquery .= " order by $config->{'search_order_default'}"; $dbquery .= " order by $config->{'search_order_default'}";