diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-09-25 03:35:08 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-09-25 03:35:08 +0000 |
commit | 4fecf43894deb10a980441edf72dfa567b64a23d (patch) | |
tree | 4bd468edb74ec28c648609baae6d9aa0a94e2b8c | |
parent | 0dce31de404c46555b0c0d9c58297b506e50e4f8 (diff) | |
download | ampache-4fecf43894deb10a980441edf72dfa567b64a23d.tar.gz ampache-4fecf43894deb10a980441edf72dfa567b64a23d.tar.bz2 ampache-4fecf43894deb10a980441edf72dfa567b64a23d.zip |
- Added ability to delete radio and playlist
- Tweaked Classic CSS to fix issue with larger fonts
- Fixed some javascript update issues due to quoting on the catalog
processes
- Fixed display of the MOTD
-rw-r--r-- | config/ampache.cfg.php.dist | 6 | ||||
-rwxr-xr-x | docs/CHANGELOG | 3 | ||||
-rw-r--r-- | lib/class/catalog.class.php | 4 | ||||
-rw-r--r-- | lib/class/playlist.class.php | 17 | ||||
-rw-r--r-- | lib/class/radio.class.php | 15 | ||||
-rw-r--r-- | login.php | 8 | ||||
-rw-r--r-- | server/browse.ajax.php | 25 | ||||
-rw-r--r-- | templates/show_live_stream_row.inc.php | 3 | ||||
-rw-r--r-- | templates/show_login_form.inc | 7 | ||||
-rw-r--r-- | templates/show_playlist_row.inc.php | 1 | ||||
-rw-r--r-- | themes/classic/templates/default.css | 1 |
11 files changed, 70 insertions, 20 deletions
diff --git a/config/ampache.cfg.php.dist b/config/ampache.cfg.php.dist index 9ecaa329..15ca4b5f 100644 --- a/config/ampache.cfg.php.dist +++ b/config/ampache.cfg.php.dist @@ -55,11 +55,11 @@ session_length = 900 stream_length = 3600 ; This length defines how long a 'remember me' session and cookie will -; last, the default is 900, same as length. It is up to the administrator +; last, the default is 3600, same as length. It is up to the administrator ; of the box to increase this, for reference 86400 = 1 day ; 604800 = 1 week and 2419200 = 1 month -; DEAFULT: 900 -remember_length = 900 +; DEAFULT: 3600 +remember_length = 3600 ; Name of the Session/Cookie that will sent to the browser ; default should be fine diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 48b71043..73449f4d 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,9 @@ -------------------------------------------------------------------------- v.3.4-Alpha3 + - Added Delete to Playlist and Live Streams (Radio) + - Massive improvements to CSS (Thx Spocky) + - Addition of Greysme theme (Thx Spocky) - Based MPD Support Restored - Moved catalog stats off to statistics page - Added basic sorting to all browse pages diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index f07c1b9a..c3aaae96 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -467,7 +467,7 @@ class Catalog { $file = str_replace(array('(',')','\''),'',$full_file); echo "<script type=\"text/javascript\">\n"; echo "update_txt('" . $this->count ."','add_count_" . $this->id . "');"; - echo "update_txt('" . htmlentities($file) . "','add_dir_" . $this->id . "');"; + echo "update_txt('" . addslashes(htmlentities($file)) . "','add_dir_" . $this->id . "');"; echo "\n</script>\n"; flush(); } // update our current state @@ -583,7 +583,7 @@ class Catalog { if ( !($search_count%5)) { echo "<script type=\"text/javascript\">\n"; echo "update_txt('" . $search_count ."','count_art_" . $this->id . "');"; - echo "update_txt('" . $album->name . "','read_art_" . $this->id . "');"; + echo "update_txt('" . addslashes($album->name) . "','read_art_" . $this->id . "');"; echo "\n</script>\n"; flush(); } //echos song count diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php index 515edde4..b36cf268 100644 --- a/lib/class/playlist.class.php +++ b/lib/class/playlist.class.php @@ -486,16 +486,19 @@ class Playlist { * delete * This deletes the current playlist and all assoicated data */ - function delete() { + public function delete() { - $id = sql_escape($this->id); - - $sql = "DELETE FROM playlist_data WHERE playlist = '$id'"; - $db_results = mysql_query($sql, dbh()); + $id = Dba::escape($this->id); + + $sql = "DELETE FROM `playlist_data` WHERE `playlist` = '$id'"; + $db_results = Dba::query($sq); - $sql = "DELETE FROM playlist WHERE id='$id'"; - $db_results = mysql_query($sql, dbh()); + $sql = "DELETE FROM `playlist` WHERE `id`='$id'"; + $db_results = Dba::query($sql); + $sql = "DELETE FROM `object_count` WHERE `object_type`='playlist' AND `object_id`='$id'"; + $db_results = Dba::query($sql); + return true; } // delete diff --git a/lib/class/radio.class.php b/lib/class/radio.class.php index 45f57ade..7665c887 100644 --- a/lib/class/radio.class.php +++ b/lib/class/radio.class.php @@ -200,6 +200,21 @@ class Radio { } // create + /** + * delete + * This deletes the current object from the database + */ + public function delete() { + + $id = Dba::escape($this->id); + + $sql = "DELETE FROM `live_stream` WHERE `id`='$id'"; + $db_results = Dba::query($sql); + + return true; + + } // delete + } //end of radio class ?> @@ -149,14 +149,6 @@ else { require Config::get('prefix') . '/templates/show_login_form.inc'; -if (@is_readable(Config::get('prefix') . '/config/motd.php')) { - echo "<div align=\"center\">\n"; - show_box_top(_('Message of the Day')); - include Config::get('prefix') . '/config/motd.php'; - show_box_bottom(); - echo "</div>\n"; -} - ?> </body> </html> diff --git a/server/browse.ajax.php b/server/browse.ajax.php index b7514152..f8d67480 100644 --- a/server/browse.ajax.php +++ b/server/browse.ajax.php @@ -56,6 +56,31 @@ switch ($_REQUEST['action']) { $results['browse_content'] = ob_get_contents(); ob_end_clean(); break; + case 'delete_object': + switch ($_REQUEST['type']) { + case 'playlist': + // Check the perms we need to on this + $playlist = new Playlist($_REQUEST['id']); + if (!$playlist->has_access()) { exit; } + + // Delete it! + $playlist->delete(); + $key = 'playlist_row_' . $playlist->id; + break; + case 'live_stream': + if (!$GLOBALS['user']->has_access('75')) { exit; } + $radio = new Radio($_REQUEST['id']); + $radio->delete(); + $key = 'live_stream_' . $radio->id; + break; + default: + + break; + } // end switch on type + + $results[$key] = ''; + + break; default: $results['rfc3514'] = '0x1'; break; diff --git a/templates/show_live_stream_row.inc.php b/templates/show_live_stream_row.inc.php index 77003371..773b1d35 100644 --- a/templates/show_live_stream_row.inc.php +++ b/templates/show_live_stream_row.inc.php @@ -30,4 +30,7 @@ <?php if ($GLOBALS['user']->has_access('50')) { ?> <?php echo Ajax::button('?action=show_edit_object&type=live_stream&id=' . $radio->id,'edit',_('Edit'),'edit_radio_' . $radio->id); ?> <?php } ?> + <?php if ($GLOBALS['user']->has_access('75')) { ?> + <?php echo Ajax::button('?page=browse&action=delete_object&type=live_stream&id=' . $radio->id,'delete',_('Delete'),'delete_radio_' . $radio->id); ?> + <?php } ?> </td> diff --git a/templates/show_login_form.inc b/templates/show_login_form.inc index 3068dd5d..ea271460 100644 --- a/templates/show_login_form.inc +++ b/templates/show_login_form.inc @@ -65,3 +65,10 @@ function focus(){ document.login.username.focus(); } <?php } // end if (conf('allow_public_registration')) ?> </div> </div> +<?php +if (@is_readable(Config::get('prefix') . '/config/motd.php')) { + show_box_top(_('Message of the Day')); + include Config::get('prefix') . '/config/motd.php'; + show_box_bottom(); +} +?> diff --git a/templates/show_playlist_row.inc.php b/templates/show_playlist_row.inc.php index 99f3caf4..91b7877b 100644 --- a/templates/show_playlist_row.inc.php +++ b/templates/show_playlist_row.inc.php @@ -34,5 +34,6 @@ <?php } ?> <?php if ($playlist->has_access()) { ?> <?php echo Ajax::button('?action=show_edit_object&type=playlist&id=' . $playlist->id,'edit',_('Edit'),'edit_playlist_' . $playlist->id); ?> + <?php echo Ajax::button('?page=browse&action=delete_object&type=playlist&id=' . $playlist->id,'delete',_('Delete'),'delete_playlist_' . $playlist->id); ?> <?php } ?> </td> diff --git a/themes/classic/templates/default.css b/themes/classic/templates/default.css index 0e218fde..8f657374 100644 --- a/themes/classic/templates/default.css +++ b/themes/classic/templates/default.css @@ -172,6 +172,7 @@ h3#content_title span { background:#c0c0c0 url(../images/rightbar_top.jpg) no-repeat;
float:right;
font-family: Verdana,Helvetica,sans-serif;
+ clear:both;
}
#rightbar ul { list-style:none; }
#rightbar a { text-decoration:none; }
|