summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG1
-rw-r--r--lib/playlist.lib.php6
-rw-r--r--lib/search.php9
-rw-r--r--search.php7
-rw-r--r--templates/show_search.inc.php (renamed from templates/show_search.inc)7
-rw-r--r--templates/sidebar_home.inc.php6
6 files changed, 17 insertions, 19 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index e36d5d51..f391a9a7 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,7 @@
--------------------------------------------------------------------------
v.3.4-Alpha2
+ - Fixed searching via quicksearch bar
- Added 'Your' playlists to leftbar with play and view links
- Fixed clear now playing
- Fixed now playing issues with Audacious 1.3.x office space style
diff --git a/lib/playlist.lib.php b/lib/playlist.lib.php
index 5889a4b6..c695579b 100644
--- a/lib/playlist.lib.php
+++ b/lib/playlist.lib.php
@@ -145,12 +145,12 @@ function show_playlist_select($playlist_id=0,$type='') {
$where_sql = '1=1';
}
else {
- $where_sql = " `user` = '" . sql_escape($GLOBALS['user']->id) . "'";
+ $where_sql = " `user` = '" . Dba::escape($GLOBALS['user']->id) . "'";
}
$sql = "SELECT id,name FROM playlist " .
- "WHERE " . $where_sql . " ORDER BY name";
- $db_results = mysql_query($sql,dbh());
+ "WHERE " . $where_sql . " ORDER BY `name`";
+ $db_results = Dba::query($sql);
echo "<select name=\"playlist_id\">\n";
diff --git a/lib/search.php b/lib/search.php
index 061f8572..e9f76461 100644
--- a/lib/search.php
+++ b/lib/search.php
@@ -42,7 +42,7 @@ function run_search($data) {
if ($prefix == 's_' AND strlen($value)) {
$true_name = substr($key,2,strlen($key));
- $search[$true_name] = sql_escape($value);
+ $search[$true_name] = Dba::escape($value);
}
} // end foreach
@@ -219,11 +219,10 @@ function search_song($data,$operator,$method,$limit) {
*/
$_SESSION['userdata']['stored_search'] = $sql;
- //echo "DEBUG: $sql<br />"; flush();
- $db_results = mysql_query($sql, dbh());
+ $db_results = Dba::query($sql);
- while ($r = mysql_fetch_assoc($db_results)) {
- $results[] = new Song($r['id']);
+ while ($row = Dba::fetch_assoc($db_results)) {
+ $results[] = $row['id'];
}
return $results;
diff --git a/search.php b/search.php
index 7e2af8a6..a6ef9b64 100644
--- a/search.php
+++ b/search.php
@@ -41,9 +41,10 @@ switch ($_REQUEST['action']) {
break;
}
case 'search':
- show_template('show_search');
+ require_once Config::get('prefix') . '/templates/show_search.inc.php';
$results = run_search($_REQUEST);
- show_search($_REQUEST['object_type'],$results);
+ Browse::set_type('song');
+ Browse::show_objects($results);
break;
case 'save_as_track':
$playlist_id = save_search($_REQUEST);
@@ -51,7 +52,7 @@ switch ($_REQUEST['action']) {
show_confirmation("Search Saved","Your Search has been saved as a track in $playlist->name",conf('web_path') . "/search.php");
break;
default:
- show_template('show_search');
+ require_once Config::get('prefix') . '/templates/show_search.inc.php';
break;
}
diff --git a/templates/show_search.inc b/templates/show_search.inc.php
index ee30e90e..c97f7535 100644
--- a/templates/show_search.inc
+++ b/templates/show_search.inc.php
@@ -24,7 +24,7 @@
*/
?>
<?php show_box_top(_('Search Ampache') . "..."); ?>
-<form name="search" method="post" action="<?php echo conf('web_path'); ?>/search.php" enctype="multipart/form-data" style="Display:inline">
+<form name="search" method="post" action="<?php echo Config::get('web_path'); ?>/search.php" enctype="multipart/form-data" style="Display:inline">
<table class="tabledata" cellspacing="0" cellpadding="3" border="0">
<tr class="table-header">
<td colspan="4">&nbsp;</td>
@@ -133,7 +133,6 @@
<td>&nbsp;</td>
<td>
<input class="button" type="submit" value="<?php echo _('Search'); ?>" />&nbsp;&nbsp;
- <input class="button" type="reset" value="<?php echo _('Reset Form');?>" />
<input type="hidden" name="action" value="search" />
</td>
<td colspan="2">&nbsp;</td>
@@ -143,9 +142,9 @@
<?php if ($_REQUEST['action'] == 'search' || $_REQUEST['action'] == 'quick_search') { ?>
<br />
-<form method="post" action="<?php echo conf('web_path'); ?>/playlist.php?action=add_dyn_song">
+<form method="post" action="<?php echo Config::get('web_path'); ?>/playlist.php?action=add_dyn_song">
<?php echo _('Save Search As Track on'); ?>:
<?php show_playlist_select($_SESSION['data']['playlist_id'],'dynamic'); ?>
<input class="button" type="submit" value="<?php echo _('Save'); ?>" /></form>
<?php } ?>
-<?php require (conf('prefix') . '/templates/show_box_bottom.inc.php'); ?>
+<?php show_box_bottom(); ?>
diff --git a/templates/sidebar_home.inc.php b/templates/sidebar_home.inc.php
index 4cd948c9..694fdc3c 100644
--- a/templates/sidebar_home.inc.php
+++ b/templates/sidebar_home.inc.php
@@ -3,12 +3,9 @@
<span><a href="<?php echo $web_path; ?>/stats.php"><?php echo _('Statistics'); ?></a></span>
<span><a href="<?php echo $web_path; ?>/radio.php?action=show_create"><?php echo _('Add Radio Station'); ?></a></span>
<hr />
-<!-- RANDOM, Hidden for now cause its broken
-<h4><?php echo _('Search'); ?></h4>
<div id="sidebar_subsearch">
- <form name="sub_search" method="post" action="<?php echo $web_path; ?>/search.php" enctype="multipart/form-data" style="Display:inline">
+ <form name="search" method="post" action="<?php echo $web_path; ?>/search.php" enctype="multipart/form-data" style="Display:inline">
<input type="text" name="search_string" value="" size="5" />
-<br />
<input class="smallbutton" type="submit" value="<?php echo _('Search'); ?>" />
<input type="hidden" name="action" value="quick_search" />
<input type="hidden" name="method" value="fuzzy" />
@@ -16,6 +13,7 @@
</form>
</div>
<hr />
+<!-- RANDOM, Hidden for now cause its broken
<h4><?php echo _('Random'); ?></h4>
<form name="sub_random" method="post" enctype="multipart/form-data" action="<?php echo $web_path; ?>/song.php?action=random&amp;method=stream" style="Display:inline">
<select name="random" style="width:80px;">