diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-03-09 00:54:41 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-03-09 00:54:41 +0000 |
commit | 6dbd87e0784732b2efee402b693143b71d1462d8 (patch) | |
tree | 29a9e79c3194161bbfd9f18dfdba4239dc27dd8d /lib/search.php | |
parent | 98f41161aa63d82710bf1a8278bb7443dcfea8c6 (diff) | |
download | ampache-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.php | 8 |
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; |