diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-06-22 16:27:35 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-06-22 16:27:35 +0000 |
commit | 328da9378b3350602445b48fbe4976b8f55476bb (patch) | |
tree | ff0666f15c291c57d24738a81046bcc5e568f9b0 | |
parent | 8371bcafe75ec3427530c378f2ff2600c91dc56a (diff) | |
download | ampache-328da9378b3350602445b48fbe4976b8f55476bb.tar.gz ampache-328da9378b3350602445b48fbe4976b8f55476bb.tar.bz2 ampache-328da9378b3350602445b48fbe4976b8f55476bb.zip |
fixed keyword searches
-rwxr-xr-x | docs/CHANGELOG | 5 | ||||
-rw-r--r-- | lib/general.lib.php | 23 | ||||
-rw-r--r-- | lib/init.php | 2 | ||||
-rw-r--r-- | search.php | 5 | ||||
-rw-r--r-- | templates/show_search.inc | 2 | ||||
-rw-r--r-- | templates/sidebar.inc.php | 5 |
6 files changed, 22 insertions, 20 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index dac099f5..184fda93 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -3,6 +3,11 @@ -------------------------------------------------------------------------- -------------------------------------------------------------------------- + v.3.3.2 + - Fixed issue with Keywords search that cropped up when I removed + the checkboxes. + +-------------------------------------------------------------------------- v.3.3.2-Beta3 - Fixed file-based parsing so that it can now be given priority over the tags in the files using tag_order in the config diff --git a/lib/general.lib.php b/lib/general.lib.php index b8e8d1e8..c3c1e061 100644 --- a/lib/general.lib.php +++ b/lib/general.lib.php @@ -596,13 +596,12 @@ function cleanup_and_exit($playing_id) { */ function get_global_popular($type) { - $dbh = dbh(); - + /* Select out the most popular based on object_count */ $sql = "SELECT object_id, SUM(count) as count FROM object_count" . " WHERE object_type = '$type'" . " GROUP BY object_id" . " ORDER BY count DESC LIMIT " . conf('popular_threshold'); - $db_result = mysql_query($sql, $dbh); + $db_result = mysql_query($sql,dbh()); $items = array(); $web_path = conf('web_path'); @@ -614,33 +613,33 @@ function get_global_popular($type) { $artist = $song->get_artist_name(); $text = "$artist - $song->title"; /* Add to array */ - $items[] = "<li> <a href=\"$web_path/song.php?action=single_song&song_id=$song->id\" title=\"". htmlspecialchars($text) ."\">" . - htmlspecialchars(truncate_with_ellipse($text, conf('ellipse_threshold_title')+3)) . " ($r->count)</a> </li>"; + $items[] = "<li> <a href=\"$web_path/song.php?action=single_song&song_id=$song->id\" title=\"". scrub_out($text) ."\">" . + scrub_out(truncate_with_ellipse($text, conf('ellipse_threshold_title')+3)) . " ($r->count)</a> </li>"; } // if it's a song /* If Artist */ elseif ( $type == 'artist' ) { $artist = get_artist_name($r->object_id); - $items[] = "<li> <a href=\"$web_path/artists.php?action=show&artist=$r->object_id\" title=\"". htmlspecialchars($artist) ."\">" . - htmlspecialchars(truncate_with_ellipse($artist, conf('ellipse_threshold_artist')+3)) . " ($r->count)</a> </li>"; + $items[] = "<li> <a href=\"$web_path/artists.php?action=show&artist=$r->object_id\" title=\"". scrub_out($artist) ."\">" . + scrub_out(truncate_with_ellipse($artist, conf('ellipse_threshold_artist')+3)) . " ($r->count)</a> </li>"; } // if type isn't artist /* If Album */ elseif ( $type == 'album' ) { $album = new Album($r->object_id); - $items[] = "<li> <a href=\"$web_path/albums.php?action=show&album=$r->object_id\" title=\"". htmlspecialchars($album->name) ."\">" . - htmlspecialchars(truncate_with_ellipse($album->name,conf('ellipse_threshold_album')+3)) . " ($r->count)</a> </li>"; + $items[] = "<li> <a href=\"$web_path/albums.php?action=show&album=$r->object_id\" title=\"". scrub_out($album->name) ."\">" . + scrub_out(truncate_with_ellipse($album->name,conf('ellipse_threshold_album')+3)) . " ($r->count)</a> </li>"; } // else not album elseif ($type == 'genre') { $genre = new Genre($r->object_id); - $items[] = "<li> <a href=\"$web_path/browse.php?action=genre&genre=$r->object_id\" title=\"" . htmlspecialchars($genre->name) . "\">" . - htmlspecialchars(truncate_with_ellipse($genre->name,conf('ellipse_threshold_title')+3)) . " ($r->count)</a> </li>"; + $items[] = "<li> <a href=\"$web_path/browse.php?action=genre&genre=$r->object_id\" title=\"" . scrub_out($genre->name) . "\">" . + scrub_out(truncate_with_ellipse($genre->name,conf('ellipse_threshold_title')+3)) . " ($r->count)</a> </li>"; } // end if genre } // end while if (count($items) == 0) { - $items[] = "<li style=\"list-style-type: none\"><span class=\"error\">" . _("Not Enough Data") . "</span></li>\n"; + $items[] = "<li style=\"list-style-type: none\"><span class=\"error\">" . _('Not Enough Data') . "</span></li>\n"; } return $items; diff --git a/lib/init.php b/lib/init.php index 45d71625..9fbf8e6f 100644 --- a/lib/init.php +++ b/lib/init.php @@ -80,7 +80,7 @@ if (!$results['allow_stream_playback']) { /** This is the version.... fluf nothing more... **/ -$results['version'] = '3.3.2-Beta3'; +$results['version'] = '3.3.2 Build (001)'; $results['raw_web_path'] = $results['web_path']; $results['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path']; @@ -41,9 +41,8 @@ switch ($action) { * they used the quick search to search on until after they've * submited it */ - $string_name = $_REQUEST['search_object'][0] . '_string'; - $_REQUEST[$string_name] = $_REQUEST['search_string']; - unset($string_name); + $_REQUEST['s_all'] = $_REQUEST['search_string']; + if (strlen($_REQUEST['search_string']) < 1) { $GLOBALS['error']->add_error('keyword',_("Error: No Keyword Entered")); show_template('show_search'); diff --git a/templates/show_search.inc b/templates/show_search.inc index 76b270c0..5ed3e676 100644 --- a/templates/show_search.inc +++ b/templates/show_search.inc @@ -33,7 +33,7 @@ <tr class="<?php echo flip_class(); ?>"> <td><?php echo _('Keywords') ?></td> <td> - <input type="text" id="s_keywords" name="s_keywords" value="<?php echo scrub_out($_REQUEST['s_keywords']); ?>"/> + <input type="text" id="s_all" name="s_all" value="<?php echo scrub_out($_REQUEST['s_keywords']); ?>"/> </td> <td><?php echo _('Comment'); ?></td> <td> diff --git a/templates/sidebar.inc.php b/templates/sidebar.inc.php index f9a7ea92..5449baef 100644 --- a/templates/sidebar.inc.php +++ b/templates/sidebar.inc.php @@ -137,12 +137,11 @@ switch ($location['page']) { <?php if ($GLOBALS['theme']['orientation'] != 'horizontal') { ?> <li> <form name="sub_search" method="post" action="<?php echo $web_path; ?>/search.php" enctype="multipart/form-data" style="Display:inline"> - <input type="text" name="search_string" value="<?php echo scrub_out($_REQUEST['search_string']); ?>" size="5" /> - <input class="smallbutton" type="submit" value="<?php echo _("Search"); ?>" /> + <input type="text" name="search_string" value="" size="5" /> + <input class="smallbutton" type="submit" value="<?php echo _('Search'); ?>" /> <input type="hidden" name="action" value="quick_search" /> <input type="hidden" name="method" value="fuzzy" /> <input type="hidden" name="object_type" value="song" /> - <input type="hidden" name="search_object[]" value="all" /> </form> </li> <?php } // end if ($GLOBALS['theme']['orientation'] != 'horizontal')?> |