| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
define('STATION_PLAYLIST_CVS_ID', '$Id: station_playlist.module,v 1.14 2008/05/26 21:28:34 drewish Exp $'); |
define('STATION_PLAYLIST_CVS_ID', '$Id: station_playlist.module,v 1.14.2.1 2009/04/22 18:55:35 drewish Exp $'); |
| 4 |
|
|
| 5 |
if (module_exists('views')) { |
if (module_exists('views')) { |
| 6 |
require_once(drupal_get_path('module', 'station_playlist') .'/views.inc'); |
require_once(drupal_get_path('module', 'station_playlist') .'/views.inc'); |
| 534 |
*/ |
*/ |
| 535 |
function station_playlist_autocomplete($field = '', $string = '') { |
function station_playlist_autocomplete($field = '', $string = '') { |
| 536 |
$matches = array(); |
$matches = array(); |
| 537 |
if (in_array($field, array('artist', 'title', 'album', 'label'))) { |
if (in_array($field, array('artist', 'album', 'label'))) { |
| 538 |
$result = db_query_range('SELECT DISTINCT %s AS val FROM {station_playlist_track} WHERE LOWER(%s) LIKE LOWER("%s%%") ORDER BY val', $field, $field, $string, 0, 10); |
$result = db_query_range('SELECT DISTINCT %s AS val FROM {station_playlist_track} WHERE LOWER(%s) LIKE LOWER("%s%%") ORDER BY val', $field, $field, $string, 0, 10); |
| 539 |
while ($item = db_fetch_object($result)) { |
while ($item = db_fetch_object($result)) { |
| 540 |
$matches[$item->val] = check_plain($item->val); |
$matches[$item->val] = check_plain($item->val); |