summaryrefslogtreecommitdiffstats
path: root/lib/search.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-03-25 19:44:22 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-03-25 19:44:22 +0000
commit6e3561114a5832e432793b11bc7b71926dc33c85 (patch)
treed2b5e051bc0c19ba11584bbd249e1a0355503e3b /lib/search.php
parent1eca8a9c7b499b5f4ec58dbd19170d4a642ad674 (diff)
downloadampache-6e3561114a5832e432793b11bc7b71926dc33c85.tar.gz
ampache-6e3561114a5832e432793b11bc7b71926dc33c85.tar.bz2
ampache-6e3561114a5832e432793b11bc7b71926dc33c85.zip
added ability to search year range
Diffstat (limited to 'lib/search.php')
-rw-r--r--lib/search.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/search.php b/lib/search.php
index 99897ec7..2e91a3ef 100644
--- a/lib/search.php
+++ b/lib/search.php
@@ -160,7 +160,12 @@ function search_song($data,$operator,$method,$limit) {
$table_sql .= "genre,";
break;
case 'year':
- $where_sql .= " song.year $value_string $operator";
+ if (empty($data["year2"]) && is_numeric($data["year"])) {
+ $where_sql .= " song.year $value_string $operator";
+ }
+ elseif (!empty($data["year"]) && is_numeric($data["year"]) && !empty($data["year2"]) && is_numeric($data["year2"])) {
+ $where_sql .= " (song.year BETWEEN ".$data["year"]." AND ".$data["year2"].") $operator";
+ }
break;
case 'filename':
$where_sql .= " song.file $value_string $operator";