diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-06-17 16:32:04 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-06-17 16:32:04 +0000 |
commit | e3734f063ed58356f9653a81f6dea86aa55931f4 (patch) | |
tree | 3aace945cfd5d8e988395170ff92ab75c0419819 /lib/search.php | |
parent | c6c2320170b488f64f1c67de23a35f4ca4de59de (diff) | |
download | ampache-e3734f063ed58356f9653a81f6dea86aa55931f4.tar.gz ampache-e3734f063ed58356f9653a81f6dea86aa55931f4.tar.bz2 ampache-e3734f063ed58356f9653a81f6dea86aa55931f4.zip |
moved init.php improved vainfo a bit, removed checkboxes from search page
Diffstat (limited to 'lib/search.php')
-rw-r--r-- | lib/search.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/search.php b/lib/search.php index 5ab121ba..203168a9 100644 --- a/lib/search.php +++ b/lib/search.php @@ -33,12 +33,20 @@ function run_search($data) { /* Create an array of the object we need to search on */ - foreach ($data['search_object'] as $type) { - /* generate the full name of the textbox */ - $fullname = $type . "_string"; - $search[$type] = sql_escape($data[$fullname]); + foreach ($data as $key=>$value) { + /* Get the first two chars to check + * and see if it's s_ + */ + $prefix = substr($key,0,2); + $value = trim($value); + + if ($prefix == 's_' AND strlen($value)) { + $true_name = substr($key,2,strlen($key)); + $search[$true_name] = sql_escape($value); + } + } // end foreach - + /* Figure out if they want a AND based search or a OR based search */ switch($_REQUEST['operator']) { case 'or': @@ -156,6 +164,9 @@ function search_song($data,$operator,$method,$limit) { case 'filename': $where_sql .= " song.file $value_string $operator"; break; + case 'comment': + $where_sql .= " song.comment $value_string $operator"; + break; case 'played': /* This is a 0/1 value so bool it */ $value = make_bool($value); |