summaryrefslogtreecommitdiffstats
path: root/lib/search.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-09 00:54:41 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-09 00:54:41 +0000
commit6dbd87e0784732b2efee402b693143b71d1462d8 (patch)
tree29a9e79c3194161bbfd9f18dfdba4239dc27dd8d /lib/search.php
parent98f41161aa63d82710bf1a8278bb7443dcfea8c6 (diff)
downloadampache-6dbd87e0784732b2efee402b693143b71d1462d8.tar.gz
ampache-6dbd87e0784732b2efee402b693143b71d1462d8.tar.bz2
ampache-6dbd87e0784732b2efee402b693143b71d1462d8.zip
add time range to advanced search, resolves #329
Diffstat (limited to 'lib/search.php')
-rw-r--r--lib/search.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/search.php b/lib/search.php
index 885dc27e..01946745 100644
--- a/lib/search.php
+++ b/lib/search.php
@@ -152,6 +152,14 @@ function search_song($data,$operator,$method,$limit) {
$where_sql .= " (song.year BETWEEN ".$data["year"]." AND ".$data["year2"].") $operator";
}
break;
+ case 'time':
+ if (!empty($data['time2'])) {
+ $where_sql .= " `song`.`time` <= " . Dba::escape(intval($data['time2'])*60) . " $operator";
+ }
+ if (!empty($data['time'])) {
+ $where_sql .= " `song`.`time` >= " . Dba::escape(intval($data['time'])*60) . " $operator";
+ }
+ break;
case 'filename':
$where_sql .= " song.file $value_string $operator";
break;