summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-11-29 18:38:46 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-11-29 18:38:46 +0000
commit245b69d645b0b00ef52063f08466e11e3bf09ccc (patch)
tree3deb277e6ae05d4821dcb5bdf86d34262c9f65cf
parent73809f0c1dd345e572b2cea9503454f3a1bb2a12 (diff)
downloadampache-245b69d645b0b00ef52063f08466e11e3bf09ccc.tar.gz
ampache-245b69d645b0b00ef52063f08466e11e3bf09ccc.tar.bz2
ampache-245b69d645b0b00ef52063f08466e11e3bf09ccc.zip
some other minor changes, nothing big
-rw-r--r--admin/users.php14
-rw-r--r--lib/class/api.class.php2
-rw-r--r--lib/class/tag.class.php3
-rw-r--r--lib/search.php11
4 files changed, 8 insertions, 22 deletions
diff --git a/admin/users.php b/admin/users.php
index 72e99132..0255df6a 100644
--- a/admin/users.php
+++ b/admin/users.php
@@ -131,27 +131,17 @@ switch ($_REQUEST['action']) {
case 'enable':
$client = new User($_REQUEST['user_id']);
$client->enable();
- show_confirmation(_('User Enabled'),'','admin/users.php');
+ show_confirmation(_('User Enabled'),$client->fullname . ' (' . $client->username . ')','admin/users.php');
break;
case 'disable':
$client = new User($_REQUEST['user_id']);
if ($client->disable()) {
- show_confirmation(_('User Disabled'),'','admin/users.php');
+ show_confirmation(_('User Disabled'),$client->fullname . ' (' . $client->username . ')','admin/users.php');
}
else {
show_confirmation(_('Error'),_('Unable to Disabled last Administrator'),'admin/users.php');
}
break;
-
-} // End Work Switch
-
-
-/**
- * This is the second half, it handles displaying anything
- * the first half (work half) potentially has 'adjusted' the user
- * input
- */
-switch ($_REQUEST['action']) {
case 'show_edit':
if (Config::get('demo_mode')) { break; }
$client = new User($_REQUEST['user_id']);
diff --git a/lib/class/api.class.php b/lib/class/api.class.php
index 7da358f5..6d65ec24 100644
--- a/lib/class/api.class.php
+++ b/lib/class/api.class.php
@@ -49,7 +49,7 @@ class Api {
if (intval($version) < self::$version) {
debug_event('API','Login Failed version too old','1');
- Error::add('api','Login Failed versoin too old');
+ Error::add('api','Login Failed version too old');
return false;
}
diff --git a/lib/class/tag.class.php b/lib/class/tag.class.php
index 0350e438..5018dbee 100644
--- a/lib/class/tag.class.php
+++ b/lib/class/tag.class.php
@@ -109,6 +109,9 @@ class Tag extends database_object {
$data = self::get_top_tags($type,$object_id);
}
+ // If nothing is found, then go ahead and return false
+ if (!is_array($data) OR !count($data)) { return false; }
+
$this->weight = $data[$this->id]['count'];
if (in_array($GLOBALS['user']->id,$data[$this->id]['users'])) {
diff --git a/lib/search.php b/lib/search.php
index fe01ad0d..885dc27e 100644
--- a/lib/search.php
+++ b/lib/search.php
@@ -124,15 +124,8 @@ function search_song($data,$operator,$method,$limit) {
{
if($ii++ > 0)
$where_sql .= " AND ";
- $where_sql .= "
- (
- song.title LIKE '%$word%' OR
- album2.name LIKE '%$word%' OR
- artist2.name LIKE '%$word%' OR
- song.year LIKE '%$word%' OR
- song.file LIKE '%$word%' OR
- tag2.name LIKE '%$word%'
- ) ";
+ $where_sql .= "(song.title LIKE '%$word%' OR album2.name LIKE '%$word%' OR artist2.name LIKE '%$word%' OR
+ song.year LIKE '%$word%' OR song.file LIKE '%$word%' OR tag2.name LIKE '%$word%') ";
}
$where_sql .= " ) $operator";
$table_sql .= " LEFT JOIN `album` as `album2` ON `song`.`album`=`album2`.`id`";