diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-04 02:45:03 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-04 02:45:03 +0000 |
commit | 19276f57a9eeacae7829629baa35fcb28d77419f (patch) | |
tree | 35c2d658e6cb4e3b9e1a1706e0e3d3ab8af88f0d | |
parent | 848a1bc5388301e128cb5c2c4d8dcb5d06721bb4 (diff) | |
download | ampache-19276f57a9eeacae7829629baa35fcb28d77419f.tar.gz ampache-19276f57a9eeacae7829629baa35fcb28d77419f.tar.bz2 ampache-19276f57a9eeacae7829629baa35fcb28d77419f.zip |
fixed genre and artist view... mostly also fixed batch downloads
-rw-r--r-- | batch.php | 7 | ||||
-rw-r--r-- | browse.php | 35 | ||||
-rw-r--r-- | lib/batch.lib.php | 2 | ||||
-rw-r--r-- | lib/class/album.class.php | 3 | ||||
-rw-r--r-- | lib/class/artist.class.php | 22 | ||||
-rw-r--r-- | lib/class/browse.class.php | 10 | ||||
-rw-r--r-- | lib/class/catalog.class.php | 46 | ||||
-rw-r--r-- | lib/class/genre.class.php | 87 | ||||
-rw-r--r-- | server/ajax.server.php | 20 | ||||
-rw-r--r-- | stats.php | 4 | ||||
-rw-r--r-- | templates/footer.inc.php | 7 | ||||
-rw-r--r-- | templates/header.inc.php | 4 | ||||
-rw-r--r-- | templates/show_albums.inc.php | 2 | ||||
-rw-r--r-- | templates/show_artists.inc.php | 44 | ||||
-rw-r--r-- | templates/show_genres.inc.php | 28 | ||||
-rw-r--r-- | templates/show_playlist_bar.inc.php | 5 | ||||
-rw-r--r-- | templates/sidebar_home.inc.php | 4 | ||||
-rw-r--r-- | themes/classic/templates/default.css | 10 |
18 files changed, 158 insertions, 182 deletions
@@ -33,7 +33,7 @@ set_time_limit(0); switch ($_REQUEST['action']) { case 'tmp_playlist': $tmpPlaylist = new tmpPlaylist($_REQUEST['id']); - $song_ids = $tmpPlaylist->get_objects(); + $song_ids = $tmpPlaylist->get_items(); $name = $GLOBALS['user']->username . ' - Playlist'; break; case 'playlist': @@ -46,6 +46,11 @@ switch ($_REQUEST['action']) { $song_ids = $album->get_songs(); $name = $album->name; break; + case 'artist': + $artist = new Artist($_REQUEST['id']); + $song_ids = $artist->get_songs(); + $name = $artist->name; + break; case 'genre': $id = scrub_in($_REQUEST['id']); $genre = new Genre($id); @@ -47,42 +47,19 @@ switch($_REQUEST['action']) { Browse::show_objects($album_ids); break; case 'artist': - show_alphabet_list('artists','artists.php'); - show_alphabet_form('',_("Show Artists starting with"),"artists.php?action=match"); - show_artists(); + Browse::set_type('artist'); + $artist_ids = Browse::get_objects(); + Browse::show_objects($artist_ids); break; case 'genre': - /* Create the Needed Object */ - $genre = new Genre(); - - /* Setup the View object */ - $view = new View(); - $view->import_session_view(); - $genre->show_match_list($_REQUEST['match']); - $sql = $genre->get_sql_from_match($_REQUEST['match']); - - if ($_REQUEST['keep_view']) { - $view->initialize(); - } - else { - $db_results = mysql_query($sql, dbh()); - $total_items = mysql_num_rows($db_results); - $offset_limit = 999999; - if ($match != 'Show_All') { $offset_limit = $user->prefs['offset_limit']; } - $view = new View($sql, 'browse.php?action=genre','name',$total_items,$offset_limit); - } - - if ($view->base_sql) { - $genres = $genre->get_genres($view->sql); - show_genres($genres,$view); - } - + Browse::set_type('genre'); + $genre_ids = Browse::get_objects(); + Browse::show_objects($genre_ids); break; case 'song': Browse::set_type('song'); $song_ids = Browse::get_objects(); Browse::show_objects($song_ids); - break; case 'catalog': diff --git a/lib/batch.lib.php b/lib/batch.lib.php index 6666cbb1..4c83deb3 100644 --- a/lib/batch.lib.php +++ b/lib/batch.lib.php @@ -52,7 +52,7 @@ function get_song_files( $song_ids ) { function send_zip( $name, $song_files ) { /* Require needed library */ - require_once(conf('prefix') . '/modules/archive/archive.lib.php' ); + require_once Config::get('prefix') . '/modules/archive/archive.lib.php'; $arc = new zip_file( $name . ".zip" ); $options = array( 'inmemory' => 1, // create archive in memory diff --git a/lib/class/album.class.php b/lib/class/album.class.php index d801c518..513256d6 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -374,7 +374,8 @@ class Album { /* Thanks to dromio for origional code */ /* Added search for any .jpg, png or .gif - Vollmer */ - foreach($this->_songs as $song) { + foreach($this->_songs as $song_id) { + $song = new Song($song_id); $dir = dirname($song->file); debug_event('folder_art',"Opening $dir and checking for Album Art",'3'); diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php index ee2aad62..7a07785d 100644 --- a/lib/class/artist.class.php +++ b/lib/class/artist.class.php @@ -95,7 +95,7 @@ class Artist { * get_songs * gets the songs for this artist */ - function get_songs() { + public function get_songs() { $sql = "SELECT `song`.`id` FROM `song` WHERE `song`.`artist`='" . Dba::escape($this->id) . "'"; $db_results = Dba::query($sql); @@ -126,21 +126,19 @@ class Artist { } // get_song_ids - /*! - @function get_random_songs - @discussion gets a random number, and - a random assortment of songs from this - album - */ - function get_random_songs() { + /** + * get_random_songs + * Gets the songs from this artist in a random order + */ + public function get_random_songs() { $results = array(); - $sql = "SELECT id FROM song WHERE artist='$this->id' ORDER BY RAND() LIMIT " . rand(1,$this->songs); - $db_results = mysql_query($sql, dbh()); + $sql = "SELECT `id` FROM `song` WHERE `artist`='$this->id' ORDER BY RAND()"; + $db_results = Dba::query($sql); - while ($r = mysql_fetch_array($db_results)) { - $results[] = $r[0]; + while ($r = Dba::fetch_assoc($db_results)) { + $results[] = $r['id']; } return $results; diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index 8cfb27d6..8613559f 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -303,6 +303,16 @@ class Browse { require_once Config::get('prefix') . '/templates/show_albums.inc.php'; show_box_bottom(); break; + case 'genre': + show_box_top(); + require_once Config::get('prefix') . '/templates/show_genres.inc.php'; + show_box_bottom(); + break; + case 'artist': + show_box_top(); + require_once Config::get('prefix') . '/templates/show_artists.inc.php'; + show_box_bottom(); + break; default: // Rien a faire break; diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index f9ed1969..06e786f7 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -83,7 +83,7 @@ class Catalog { /** * get_catalogs - * Pull all the current catalogs and return an array of objects + *Pull all the current catalogs */ public static function get_catalogs() { @@ -192,24 +192,11 @@ class Catalog { // Catalog Add start $start_time = time(); - // Setup the 10 sec ajax request hotness - $refresh_limit = 5; - $ajax_url = Config::get('ajax_url') . '?action=catalog&type=add_files'; - /* Can't have the & stuff in the Javascript */ - $ajax_url = str_replace("&","&",$ajax_url); - require_once Config::get('prefix') . '/templates/javascript_refresh.inc.php'; - - show_box_top(); - echo _('Starting New Song Search on') . " <strong>[$this->name]</strong> " . _('catalog') . "<br />"; - echo "<div id=\"catalog_update\">"; - require_once Config::get('prefix') . '/templates/show_run_add_catalog.inc.php'; - echo "</div>"; - echo "<script type=\"text/javascript\">doLoad();</script>"; - show_box_bottom(); + require Config::get('prefix') . '/templates/show_adds_catalog.inc.php'; + flush(); // Prevent the script from timing out and flush what we've got set_time_limit(0); - flush(); $this->add_files($this->path,$options); @@ -410,13 +397,12 @@ class Catalog { /* Stupid little cutesie thing */ $this->count++; - if ( !($this->count%Config::get('catalog_echo_count'))) { - $sql = "REPLACE INTO `update_info` (`key`,`value`) " . - "VALUES('catalog_add_found','$this->count')"; - $db_results = Dba::query($sql); - $sql = "REPLACE INTO `update_info` (`key`,`value`) " . - "VALUES('catalog_add_directory','" . Dba::escape($path) . "')"; - $db_results = Dba::query($sql); + if ( !($this->count%10)) { + $file = str_replace(array('(',')','\''),'',$full_file); + echo "<script type=\"text/javascript\">"; + echo "update_txt('" . $this->count ."','add_count_" . $this->id . "');"; + echo "update_txt('" . htmlentities($file) . "','add_dir_" . $this->id . "');"; + echo "</script>\n"; } // update our current state } // not found @@ -1014,13 +1000,11 @@ class Catalog { /* Do a little stats mojo here */ $current_time = time(); - - if ($verbose) { - echo "\n<b>" . _('Starting Album Art Search') . ". . .</b><br />\n"; - echo _('Searched') . ": <span id=\"art_count_" . $this->id . "\">" . _('None') . "</span>"; - flush(); - } - $this->get_album_art(); + + $catalog_id = $this->id; + require Config::get('prefix') . '/templates/show_gather_art.inc.php'; + flush(); + $this->get_album_art(0,1); /* Update the Catalog last_update */ $this->update_last_add(); @@ -1036,8 +1020,10 @@ class Catalog { $this->count = 0; } + show_box_top(); echo "\n<br />" . _("Catalog Update Finished") . "... " . _("Total Time") . " [" . date("i:s",$time_diff) . "] " . _("Total Songs") . " [" . $this->count . "] " . _("Songs Per Seconds") . " [" . $song_per_sec . "]<br /><br />"; + show_box_bottom(); } // add_to_catalog diff --git a/lib/class/genre.class.php b/lib/class/genre.class.php index 3d193be2..b2eac58a 100644 --- a/lib/class/genre.class.php +++ b/lib/class/genre.class.php @@ -1,7 +1,7 @@ <?php /* - Copyright 2001 - 2006 Ampache.org + Copyright 2001 - 2007 Ampache.org All Rights Reserved This program is free software; you can redistribute it and/or @@ -27,21 +27,19 @@ class Genre { /* Variables */ - var $id; - var $name; + public $id; + public $name; /** * Constructor - * @package Genre - * @catagory Constructor */ - function Genre($genre_id=0) { - - if ($genre_id > 0) { - $this->id = intval($genre_id); - $info = $this->_get_info(); - $this->name = $info['name']; - } + public function __construct($genre_id=0) { + + if (!$genre_id) { return false; } + + $this->id = intval($genre_id); + $info = $this->_get_info(); + $this->name = $info['name']; } // Genre @@ -49,50 +47,44 @@ class Genre { /** * Private Get Info * This simply returns the information for this genre - * @package Genre - * @catagory Class */ - function _get_info() { + private function _get_info() { - $sql = "SELECT * FROM " . tbl_name('genre') . " WHERE id='$this->id'"; - $db_results = mysql_query($sql, dbh()); + $sql = "SELECT * FROM `genre` WHERE `id`='$this->id'"; + $db_results = Dba::query($sql); - $results = mysql_fetch_assoc($db_results); + $results = Dba::fetch_assoc($db_results); return $results; - } // _get_info() + } // _get_info /** * format_genre * this reformats the genre object so it's all purdy and creates a link var - * @package Genre - * @catagory Class */ - function format_genre() { + public function format_genre() { - $this->link = "<a href=\"" . conf('web_path') . "/genre.php?action=show_genre&genre_id=" . $this->id . "\">" . scrub_out($this->name) . "</a>"; + $this->link = "<a href=\"" . Config::get('web_path') . "/genre.php?action=show_genre&genre_id=" . $this->id . "\">" . scrub_out($this->name) . "</a>"; - $this->play_link = conf('web_path') . '/song.php?action=genre&genre=' . $this->id; - $this->random_link = conf('web_path') . '/song.php?action=random_genre&genre=' . $this->id; - $this->download_link = conf('web_path') . '/batch.php?action=genre&id=' . $this->id; + $this->play_link = Config::get('web_path') . '/song.php?action=genre&genre=' . $this->id; + $this->random_link = Config::get('web_path') . '/song.php?action=random_genre&genre=' . $this->id; + $this->download_link = Config::get('web_path') . '/batch.php?action=genre&id=' . $this->id; } // format_genre /** * get_song_count * This returns the number of songs in said genre - * @package Genre - * @catagory Class */ - function get_song_count() { + public function get_song_count() { - $sql = "SELECT count(song.id) FROM song WHERE genre='" . $this->id . "'"; - $db_results = mysql_query($sql, dbh()); - - $total_items = mysql_fetch_array($db_results); + $sql = "SELECT count(`song`.`id`) AS `total` FROM `song` WHERE `genre`='" . $this->id . "'"; + $db_results = Dba::query($sql); - return $total_items[0]; + $total_items = Dba::fetch_assoc($db_results); + + return $total_items['total']; } // get_song_count @@ -251,14 +243,14 @@ class Genre { case 'Show_All': case 'show_all': case 'Show_all': - $sql = "SELECT id FROM genre"; + $sql = "SELECT `id` FROM `genre`"; break; case 'Browse': case 'show_genres': - $sql = "SELECT id FROM genre"; + $sql = "SELECT `id` FROM `genre`"; break; default: - $sql = "SELECT id FROM genre WHERE name LIKE '" . sql_escape($match) . "%'"; + $sql = "SELECT `id` FROM `genre` WHERE `name` LIKE '" . Dba::escape($match) . "%'"; break; } // end switch on match @@ -266,27 +258,6 @@ class Genre { } // get_sql_from_match - - /** - * show_match_list - * This shows the Alphabet list and any other 'things' that genre by need at the top of every browse - * page - * @package Genre - * @catagory Class - */ - function show_match_list($match) { - - - - require (conf('prefix') . '/templates/show_box_top.inc.php'); - show_alphabet_list('genre','browse.php',$match,'genre'); - /* Detect if it's Browse, and if so don't fill it in */ - if ($match == 'Browse') { $match = ''; } - show_alphabet_form($match,_('Show Genres starting with'),"browse.php?action=genre&match=$match"); - require (conf('prefix') . '/templates/show_box_bottom.inc.php'); - - } // show_match_list - } //end of genre class ?> diff --git a/server/ajax.server.php b/server/ajax.server.php index 4f60573b..50368e9b 100644 --- a/server/ajax.server.php +++ b/server/ajax.server.php @@ -76,19 +76,31 @@ switch ($action) { case 'basket': switch ($_REQUEST['type']) { case 'album': - $album = new Album($_REQUEST['id']); - $songs = $album->get_songs(); + case 'artist': + case 'genre': + $object = new $_REQUEST['type']($_REQUEST['id']); + $songs = $object->get_songs(); foreach ($songs as $song_id) { $GLOBALS['user']->playlist->add_object($song_id); } // end foreach break; case 'album_random': - $album = new Album($_REQUEST['id']); - $songs = $album->get_random_songs(); + case 'artist_random': + case 'genre_random': + $data = explode('_',$_REQUEST['type']); + $type = $data['0']; + $object = new $type($_REQUEST['id']); + $songs = $object->get_random_songs(); foreach ($songs as $song_id) { $GLOBALS['user']->playlist->add_object($song_id); } break; + $artist = new Artist($_REQUEST['id']); + $songs = $artist->get_random_songs(); + foreach ($songs as $song_id) { + $GLOBALS['user']->playlist->add_object($song_id); + } + break; case 'clear_all': $GLOBALS['user']->playlist->clear(); break; @@ -26,10 +26,8 @@ require_once 'lib/init.php'; require_once Config::get('prefix') . '/templates/header.inc.php'; -$action = scrub_in($_REQUEST['action']); - /* Switch on the action to be performed */ -switch ($action) { +switch ($_REQUEST['action']) { case 'user_stats': /* Get em! */ $working_user = new User($_REQUEST['user_id']); diff --git a/templates/footer.inc.php b/templates/footer.inc.php index 5eb6075b..2b306aa5 100644 --- a/templates/footer.inc.php +++ b/templates/footer.inc.php @@ -20,12 +20,13 @@ */ ?> +</div> <!-- end id="content"--> <!-- I really hate IE --> </td></tr></table> -</div> <!-- end id="content"--> </div> <!-- end id="maincontainer"--> -<div id="footer-content"> - <a href="http://www.ampache.org/index.php">Ampache v.<?php echo Config::get('version'); ?></a> +<div id="footer"> + <a href="http://www.ampache.org/index.php">Ampache v.<?php echo Config::get('version'); ?></a><br /> + Copyright (c) 2001 - 2007 Ampache.org </div> </body> </html> diff --git a/templates/header.inc.php b/templates/header.inc.php index c5a96f5b..cf0deabd 100644 --- a/templates/header.inc.php +++ b/templates/header.inc.php @@ -73,9 +73,9 @@ if (Config::get('use_rss')) { ?> <div id="sidebar"><!-- This is the sidebar --> <?php require_once Config::get('prefix') . '/templates/sidebar.inc.php'; ?> </div><!-- End sidebar --> - <div id="content"> <!-- I hate IE... --> -<table class="smeg-ie"><tr><td> +<table class="smeg-ie" width="100%"><tr><td> +<div id="content"> <?php if (Config::get('int_config_version') != Config::get('config_version') AND $GLOBALS['user']->has_access(100)) { ?> <div class="fatalerror"> <?php echo _('Error Config File Out of Date'); ?> diff --git a/templates/show_albums.inc.php b/templates/show_albums.inc.php index f91203f3..de69d27d 100644 --- a/templates/show_albums.inc.php +++ b/templates/show_albums.inc.php @@ -54,9 +54,11 @@ $ajax_url = Config::get('ajax_url'); <td><?php echo $album->song_count; ?></td> <td><?php echo $album->year; ?></td> <td> + <?php if (Access::check_function('batch_download')) { ?> <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=album&id=<?php echo $album->id; ?>"> <?php echo get_user_icon('batch_download','',_('Batch Download')); ?> </a> + <?php } ?> <span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=album&type=edit&id=<?php echo $album->id; ?>');return true;" > <?php echo get_user_icon('edit','',_('Edit')); ?> </span> diff --git a/templates/show_artists.inc.php b/templates/show_artists.inc.php index 4f52e257..1bb92cb7 100644 --- a/templates/show_artists.inc.php +++ b/templates/show_artists.inc.php @@ -18,22 +18,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -$web_path = conf('web_path'); +$web_path = Config::get('web_path'); -// Build array of the table classes we are using -$total_items = $view->total_items; ?> -<?php require(conf('prefix') . '/templates/show_box_top.inc.php'); ?> <table class="tabledata" cellspacing="0" cellpadding="0" border="0"> <tr class="table-header" align="center"> <td colspan="5"> - <?php if ($GLOBALS['view']->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?> + <?php if ($GLOBALS['view']->offset_limit) { require Config::get('prefix') . '/templates/list_header.inc'; } ?> </td> </tr> <tr class="table-header"> - <td> - <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=artist.name&sort_order=0"> <?php echo _('Artist'); ?> </a> - </td> + <td><?php echo _('Add'); ?> + <td><?php echo _('Artist'); ?></td> <td> <?php echo _('Songs'); ?> </td> <td> <?php echo _('Albums'); ?> </td> <td> <?php echo _('Action'); ?> </td> @@ -41,18 +37,28 @@ $total_items = $view->total_items; <?php /* Foreach through every artist that has been passed to us */ //FIXME: These should come in as objects... -foreach ($artists as $artist) { ?> +foreach ($object_ids as $artist_id) { + $artist = new Artist($artist_id); + $artist->format(); +?> <tr class="<?php echo flip_class(); ?>"> - <td><?php echo $artist->link; ?></td> + <td> + <span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=basket&type=artist&id=<?php echo $artist->id; ?>');return true;" > + <?php echo get_user_icon('add'); ?> + </span> + <span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=basket&type=artist_random&id=<?php echo $artist->id; ?>');return true;" > + <?php echo get_user_icon('random'); ?> + </span> + </td> + <td><?php echo $artist->f_name_link; ?></td> <td><?php echo $artist->songs; ?></td> <td><?php echo $artist->albums; ?></td> <td nowrap="nowrap"> - <a href="<?php echo $web_path; ?>/song.php?action=artist&artist_id=<?php echo $artist->id; ?>"> - <?php echo get_user_icon('all'); ?> - </a> - <a href="<?php echo $web_path; ?>/song.php?action=artist_random&artist_id=<?php echo $artist->id; ?>"> - <?php echo get_user_icon('random'); ?> - </a> + <?php if (Access::check_function('batch_download')) { ?> + <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=artist&id=<?php echo $artist->id; ?>"> + <?php echo get_user_icon('batch_download','',_('Batch Download')); ?> + </a> + <?php } ?> <?php if ($GLOBALS['user']->has_access(100)) { ?> <a href="<?php echo $web_path; ?>/admin/flag.php?action=show_edit_artist&artist_id=<?php echo $artist->id; ?>"> <?php echo get_user_icon('edit'); ?> @@ -62,9 +68,8 @@ foreach ($artists as $artist) { ?> </tr> <?php } //end foreach ($artists as $artist) ?> <tr class="table-header"> - <td> - <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&keep_view=true&sort_type=artist.name&sort_order=0"> <?php echo _("Artist"); ?> </a> - </td> + <td><?php echo _('Add'); ?> + <td><?php echo _("Artist"); ?></td> <td><?php echo _('Songs'); ?></td> <td><?php echo _('Albums'); ?></td> <td><?php echo _('Action'); ?></td> @@ -76,4 +81,3 @@ foreach ($artists as $artist) { ?> </td> </tr> </table> -<?php require(conf('prefix') . '/templates/show_box_bottom.inc.php'); ?> diff --git a/templates/show_genres.inc.php b/templates/show_genres.inc.php index 59daf51d..e3ae1223 100644 --- a/templates/show_genres.inc.php +++ b/templates/show_genres.inc.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -23,9 +23,7 @@ * Show Genres * Takes an array of genre objects and displays them out */ -$total_items = $view->total_items; ?> -<?php require(conf('prefix') . '/templates/show_box_top.inc.php'); ?> <table class="tabledata" cellspacing="0" cellpadding="0" border="0"> <tr class="table-header" align="center"> <td colspan="5"> @@ -33,24 +31,29 @@ $total_items = $view->total_items; </td> </tr> <tr class="table-header"> + <td><?php echo _('Add'); ?></td> <td><?php echo _('Genre'); ?></td> <td><?php echo _('Songs'); ?></td> <td><?php echo _('Action'); ?></td> </tr> <?php -foreach ($genres as $genre) { - $genre->format_genre();?> +foreach ($object_ids as $genre_id) { + $genre = new Genre($genre_id); + $genre->format_genre(); +?> <tr class="<?php echo flip_class(); ?>"> + <td> + <span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=basket&type=genre&id=<?php echo $genre->id; ?>');return true;" > + <?php echo get_user_icon('add'); ?> + </span> + <span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=basket&type=genre_random&id=<?php echo $genre->id; ?>');return true;" > + <?php echo get_user_icon('random'); ?> + </span> + </td> <td><?php echo $genre->link; ?></td> <td><?php echo $genre->get_song_count(); ?></td> <td> - <a href="<?php echo $genre->play_link; ?>"> - <?php echo get_user_icon('all'); ?> - </a> - <a href="<?php echo $genre->random_link; ?>"> - <?php echo get_user_icon('random'); ?> - </a> - <?php if (batch_ok()) { ?> + <?php if (Access::check_function('batch_download')) { ?> <a href="<?php echo $genre->download_link; ?>"> <?php echo get_user_icon('batch_download'); ?> </a> @@ -64,4 +67,3 @@ foreach ($genres as $genre) { </td> </tr> </table> -<?php require(conf('prefix') . '/templates/show_box_bottom.inc.php'); ?> diff --git a/templates/show_playlist_bar.inc.php b/templates/show_playlist_bar.inc.php index 43b1712f..fd85dc9d 100644 --- a/templates/show_playlist_bar.inc.php +++ b/templates/show_playlist_bar.inc.php @@ -27,5 +27,10 @@ $ajax_url = Config::get('ajax_url'); <?php echo get_user_icon('disable'); ?> </a> <a href="<?php echo Config::get('web_path'); ?>/stream.php?action=basket"><?php echo get_user_icon('all'); ?></a> + <?php if (Access::check_function('batch_download')) { ?> + <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=tmp_playlist&id=<?php echo $GLOBALS['user']->playlist->id; ?>"> + <?php echo get_user_icon('batch_download','',_('Batch Download')); ?> + </a> + <?php } ?> <?php echo __('There are currently %count% items in your playlist','%count%',$GLOBALS['user']->playlist->count_items()); ?> </div> diff --git a/templates/sidebar_home.inc.php b/templates/sidebar_home.inc.php index 4791f0fd..9d08e6ed 100644 --- a/templates/sidebar_home.inc.php +++ b/templates/sidebar_home.inc.php @@ -1,3 +1,7 @@ +<h4><?php echo _('Information'); ?></h4> +<span><a href="<?php echo $web_path; ?>/index.php"><?php echo _('Currently Playing'); ?></a></span> +<span><a href="<?php echo $web_path; ?>/stats.php"><?php echo _('Statistics'); ?></a></span> +<hr /> <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"> diff --git a/themes/classic/templates/default.css b/themes/classic/templates/default.css index 739bd692..30852a31 100644 --- a/themes/classic/templates/default.css +++ b/themes/classic/templates/default.css @@ -66,7 +66,7 @@ input { /* Header */ /************************************************/ #topbar { - height: 80px; + height: 85px; padding: 3px 0 0 10px; } #topbarright { @@ -90,7 +90,9 @@ input { /* Footer */ /************************************************/ #footer { - margin: 0 0 10px 150px; + float:right; + margin:5px; + font-size:10px; } #footer p { color:#999; @@ -153,10 +155,8 @@ input { /* Content block */ /************************************************/ #content { - top:90px; - float: none; + float:left; margin:7px 0 0 135px; - /* background:#fff url(../images/bg_content.gif) repeat-y right top; */ } h3#content_title{ font: 12px/32px Arial,Helvetica,Sans-Serif; |