diff options
-rwxr-xr-x | docs/CHANGELOG | 1 | ||||
-rw-r--r-- | genres.php | 57 | ||||
-rw-r--r-- | lib/class/genre.class.php | 48 | ||||
-rw-r--r-- | lib/class/user.class.php | 4 | ||||
-rw-r--r-- | templates/show_browse_menu.inc | 6 | ||||
-rw-r--r-- | templates/show_genres.inc.php | 55 |
6 files changed, 167 insertions, 4 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 1cae7418..8199b8d7 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -20,6 +20,7 @@ - Added Optional Automatic Bandwidth management for downsampled users based on defined bandwidth limits (Thx Jens) - Prevented Load of XML-RPC library if xml_rpc isn't enabled + - Correctly deleted the session when deleting a user -------------------------------------------------------------------------- diff --git a/genres.php b/genres.php new file mode 100644 index 00000000..ff3ad2e0 --- /dev/null +++ b/genres.php @@ -0,0 +1,57 @@ +<?php + +/* + + Copyright (c) 2001 - 2005 Ampache.org + All rights reserved. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/** + * Genres Pages + * Nuff Said for now + */ +require_once("modules/init.php"); + +show_template('header'); +show_menu_items('Browse'); +show_browse_menu('Genre'); +show_clear(); + +$action = scrub_in($_REQUEST['action']); + +switch($action) { + + case 'show': + + break; + case 'match': + + break; + + default: + + break; +} // action + + + +show_clear(); + +/* Show the Footer */ +show_page_footer('Browse', '',$user->prefs['display_menu']); + +?> diff --git a/lib/class/genre.class.php b/lib/class/genre.class.php index bd853f9b..0b57a473 100644 --- a/lib/class/genre.class.php +++ b/lib/class/genre.class.php @@ -75,6 +75,54 @@ class Genre { } // format_genre + /** + * get_song_count + * This returns the number of songs in said genre + * @package Genre + * @catagory Class + */ + function get_song_count() { + + + + } // get_song_count + + /** + * get_songs + * This gets all of the songs in this genre and returns an array of song objects + * @package Genre + * @catagory Class + */ + function get_songs() { + + + + } // get_songs + + /** + * get_albums + * This gets all of the albums that have at least one song in this genre + * @package Genre + * @catagory Class + */ + function get_albums() { + + + + } // get_albums + + /** + * get_artists + * This gets all of the artists who have at least one song in this genre + * @package Genre + * @catagory Class + */ + function get_artists() { + + + + } // get_artists + } //end of genre class ?> diff --git a/lib/class/user.class.php b/lib/class/user.class.php index d8503112..4635e264 100644 --- a/lib/class/user.class.php +++ b/lib/class/user.class.php @@ -566,7 +566,6 @@ class User { } $db_results = mysql_query($sql, dbh()); - while ($r = mysql_fetch_object($db_results)) { /* Check if this preference is set */ @@ -709,6 +708,9 @@ class User { $sql = "DELETE FROM user WHERE username='$this->username'"; $db_results = mysql_query($sql, dbh()); + $sql = "DELETE FROM session WHERE username='$this->username'"; + $db_results = mysql_query($sql, dbh()); + return true; } // delete diff --git a/templates/show_browse_menu.inc b/templates/show_browse_menu.inc index a36b24e7..63b7b4fb 100644 --- a/templates/show_browse_menu.inc +++ b/templates/show_browse_menu.inc @@ -32,9 +32,9 @@ $web_path = conf('web_path'); $items = array( - _("Artist") => "$web_path/browse.php?action=artist", - _("Albums") => "$web_path/browse.php?action=albums", - _("Genre") => "$web_path/browse.php?action=genre", + _("Artist") => "$web_path/artists.php", + _("Albums") => "$web_path/albums.php", + _("Genre") => "$web_path/genres.php", ); ?> diff --git a/templates/show_genres.inc.php b/templates/show_genres.inc.php new file mode 100644 index 00000000..cf9faf72 --- /dev/null +++ b/templates/show_genres.inc.php @@ -0,0 +1,55 @@ +<?php +/* + + Copyright (c) 2001 - 2005 Ampache.org + All rights reserved. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +/** + * Show Genres + * Takes an array of genre objects and displays them out + */ +$total_items = $view->total_items; +?> +<table class="border" cellspacing="0" cellpadding="0" border="0"> +<tr class="even" align="center"> + <td colspan="5"> + <?php if ($view->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?> + </td> +</tr> +<tr class="table-header"> + <td><?php echo _("Genre"); ?></td> + <td><?php echo _("Songs"); ?></td> + <td><?php echo _("Action"); ?></td> +</tr> +<?php + foreach ($genres as $genre) { + +?> +<tr> + <td><?php echo $genre->link; ?></td> + <td><?php echo $genre->get_song_count(); ?></td> + <td>Play | Download</td> +</tr> +<? } // end foreach genres ?> +<tr class="even" align="center"> + <td colspan="5"> + <?php if ($view->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?> + </td> +</tr> +</table> |