diff options
author | nf <nf@ampache> | 2007-07-08 09:37:48 +0000 |
---|---|---|
committer | nf <nf@ampache> | 2007-07-08 09:37:48 +0000 |
commit | f2c2a87bc6c6ac2e02a606729daf9eeb35fe7db5 (patch) | |
tree | 263248d67cb800f05b40b4b581a59c24be22f03e /contrib/themes | |
parent | 22461a2352484517e2213d1914a7a656ebc9884f (diff) | |
download | ampache-f2c2a87bc6c6ac2e02a606729daf9eeb35fe7db5.tar.gz ampache-f2c2a87bc6c6ac2e02a606729daf9eeb35fe7db5.tar.bz2 ampache-f2c2a87bc6c6ac2e02a606729daf9eeb35fe7db5.zip |
New theme version
Diffstat (limited to 'contrib/themes')
35 files changed, 2761 insertions, 0 deletions
diff --git a/contrib/themes/Cleandy/images/ampache-dark-bg.gif b/contrib/themes/Cleandy/images/ampache-dark-bg.gif Binary files differnew file mode 100755 index 00000000..d5e69e5d --- /dev/null +++ b/contrib/themes/Cleandy/images/ampache-dark-bg.gif diff --git a/contrib/themes/Cleandy/images/ampache-light-bg.gif b/contrib/themes/Cleandy/images/ampache-light-bg.gif Binary files differnew file mode 100755 index 00000000..cb023d45 --- /dev/null +++ b/contrib/themes/Cleandy/images/ampache-light-bg.gif diff --git a/contrib/themes/Cleandy/images/ampache-mid.gif b/contrib/themes/Cleandy/images/ampache-mid.gif Binary files differnew file mode 100755 index 00000000..57376ea4 --- /dev/null +++ b/contrib/themes/Cleandy/images/ampache-mid.gif diff --git a/contrib/themes/Cleandy/images/ampache.gif b/contrib/themes/Cleandy/images/ampache.gif Binary files differnew file mode 100755 index 00000000..427776f5 --- /dev/null +++ b/contrib/themes/Cleandy/images/ampache.gif diff --git a/contrib/themes/Cleandy/images/bg_login_0.jpg b/contrib/themes/Cleandy/images/bg_login_0.jpg Binary files differnew file mode 100755 index 00000000..db5b42df --- /dev/null +++ b/contrib/themes/Cleandy/images/bg_login_0.jpg diff --git a/contrib/themes/Cleandy/images/bg_login_1.jpg b/contrib/themes/Cleandy/images/bg_login_1.jpg Binary files differnew file mode 100755 index 00000000..ecd97c3c --- /dev/null +++ b/contrib/themes/Cleandy/images/bg_login_1.jpg diff --git a/contrib/themes/Cleandy/images/blank-pixel.gif b/contrib/themes/Cleandy/images/blank-pixel.gif Binary files differnew file mode 100755 index 00000000..17d43908 --- /dev/null +++ b/contrib/themes/Cleandy/images/blank-pixel.gif diff --git a/contrib/themes/Cleandy/images/blankalbum.gif b/contrib/themes/Cleandy/images/blankalbum.gif Binary files differnew file mode 100755 index 00000000..89761b38 --- /dev/null +++ b/contrib/themes/Cleandy/images/blankalbum.gif diff --git a/contrib/themes/Cleandy/images/blankalbum.jpg b/contrib/themes/Cleandy/images/blankalbum.jpg Binary files differnew file mode 100755 index 00000000..468301bd --- /dev/null +++ b/contrib/themes/Cleandy/images/blankalbum.jpg diff --git a/contrib/themes/Cleandy/images/headphone.gif b/contrib/themes/Cleandy/images/headphone.gif Binary files differnew file mode 100755 index 00000000..74a66e11 --- /dev/null +++ b/contrib/themes/Cleandy/images/headphone.gif diff --git a/contrib/themes/Cleandy/images/ratings/star_rating.gif b/contrib/themes/Cleandy/images/ratings/star_rating.gif Binary files differnew file mode 100644 index 00000000..ed9fb624 --- /dev/null +++ b/contrib/themes/Cleandy/images/ratings/star_rating.gif diff --git a/contrib/themes/Cleandy/images/ratings/x.gif b/contrib/themes/Cleandy/images/ratings/x.gif Binary files differnew file mode 100644 index 00000000..0cfcc0ae --- /dev/null +++ b/contrib/themes/Cleandy/images/ratings/x.gif diff --git a/contrib/themes/Cleandy/images/ratings/x_off.gif b/contrib/themes/Cleandy/images/ratings/x_off.gif Binary files differnew file mode 100644 index 00000000..f184d9a7 --- /dev/null +++ b/contrib/themes/Cleandy/images/ratings/x_off.gif diff --git a/contrib/themes/Cleandy/images/table.gif b/contrib/themes/Cleandy/images/table.gif Binary files differnew file mode 100755 index 00000000..89761b38 --- /dev/null +++ b/contrib/themes/Cleandy/images/table.gif diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/README.txt b/contrib/themes/Cleandy/patch-3.3.3.2/README.txt new file mode 100644 index 00000000..5618977c --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/README.txt @@ -0,0 +1,9 @@ +This is optional! +But it improves accessability and better fits in ampache installations using themes by me. + +Copy the files includes in this folder to ampaches root to the appropriate folders. +They include some patches to ampache 3.3.3.2 for login page, album listing and some other things. +They'll work fine until included/fixed (maybe) in the next version of ampache. +They are not necessary but improve look & feel. + +Thanks to blueorder and andy90 for help on some patches ;)
\ No newline at end of file diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/ampache/albums.php b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/albums.php new file mode 100644 index 00000000..9acda645 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/albums.php @@ -0,0 +1,286 @@ +<?php +/* + + Copyright (c) 2001 - 2007 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 v2 + as published by the Free Software Foundation. + + 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. + +*/ + +require_once 'lib/init.php'; + +show_template('header'); + +// We'll set any input parameters here +if(!isset($_REQUEST['match'])) { $_REQUEST['match'] = "Browse"; } +if(isset($_REQUEST['match'])) $match = scrub_in($_REQUEST['match']); +if(isset($_REQUEST['album'])) $album = scrub_in($_REQUEST['album']); +if(isset($_REQUEST['artist'])) $artist = scrub_in($_REQUEST['artist']); +$_REQUEST['artist_id'] = scrub_in($_REQUEST['artist_id']); +$min_album_size = conf('min_object_count'); +if ($min_album_size == '') { + $min_album_size = '0'; +} + +$action = scrub_in($_REQUEST['action']); + +/* Switch on Action */ +switch ($action) { + case 'clear_art': + if (!$GLOBALS['user']->has_access('75')) { access_denied(); } + $album = new Album($_REQUEST['album_id']); + $album->clear_art(); + show_confirmation(_('Album Art Cleared'),_('Album Art information has been removed from the database'),"/albums.php?action=show&album=" . $album->id); + break; + case 'show': + $album = new Album($_REQUEST['album']); + $album->format(); + + require (conf('prefix') . '/templates/show_album.inc'); + + /* Get the song ids for this album */ + $song_ids = $album->get_song_ids($_REQUEST['artist']); + + show_songs($song_ids,0,$album); + break; + // Upload album art + case 'upload_art': + + // we didn't find anything + if (empty($_FILES['file']['tmp_name'])) { + show_confirmation(_('Album Art Not Located'),_('Album Art could not be located at this time. This may be due to write access error, or the file is not received corectly.'),"/albums.php?action=show&album=" . $album->id); + break; + } + + $album = new Album($_REQUEST['album_id']); + + // Pull the image information + $data = array('file'=>$_FILES['file']['tmp_name']); + $image_data = get_image_from_source($data); + + // If we got something back insert it + if ($image_data) { + $album->insert_art($image_data,$_FILES['file']['type']); + show_confirmation(_('Album Art Inserted'),'',"/albums.php?action=show&album=" . $album->id); + } + // Else it failed + else { + show_confirmation(_('Album Art Not Located'),_('Album Art could not be located at this time. This may be due to write access error, or the file is not received corectly.'),"/albums.php?action=show&album=" . $album->id); + } + + break; + case 'find_art': + + // If not a user then kick em out + if (!$GLOBALS['user']->has_access('25')) { access_denied(); exit; } + + // get the Album information + $album = new Album($_REQUEST['album_id']); + $images = array(); + $cover_url = array(); + + // If we've got an upload ignore the rest and just insert it + if (!empty($_FILES['file']['tmp_name'])) { + $path_info = pathinfo($_FILES['file']['name']); + $upload['file'] = $_FILES['file']['tmp_name']; + $upload['mime'] = 'image/' . $path_info['extension']; + $image_data = get_image_from_source($upload); + + if ($image_data) { + $album->insert_art($image_data,$upload['0']['mime']); + show_confirmation(_('Album Art Inserted'),'',"/albums.php?action=show&album=" . $_REQUEST['album_id']); + break; + + } // if image data + + } // if it's an upload + + // Build the options for our search + if (isset($_REQUEST['artist_name'])) { + $artist = scrub_in($_REQUEST['artist_name']); + } + elseif ($album->artist_count == '1') { + $artist = $album->artist; + } + if (isset($_REQUEST['album_name'])) { + $album_name = scrub_in($_REQUEST['album_name']); + } + else { + $album_name = $album->name; + } + + $options['artist'] = $artist; + $options['album_name'] = $album_name; + $options['keyword'] = $artist . " " . $album_name; + // HACK that makes baby jesus cry... +// $options['skip_id3'] = true; // modified for working covers in id3 + + // Attempt to find the art. + $images = $album->find_art($options,'6'); + + if (!empty($_REQUEST['cover'])) { + $path_info = pathinfo($_REQUEST['cover']); + $cover_url[0]['url'] = scrub_in($_REQUEST['cover']); + $cover_url[0]['mime'] = 'image/' . $path_info['extension']; + } + $images = array_merge($cover_url,$images); + + // If we've found anything then go for it! + if (count($images)) { + // We don't want to store raw's in here so we need to strip them out into a seperate array + foreach ($images as $index=>$image) { + if (isset($image['raw'])) { + //unset($images[$index]); + unset($images[$index]['raw']); +// $images[$index]['raw'] = ''; // modified for working covers in id3 + } + } // end foreach + + // Store the results for further use + $_SESSION['form']['images'] = $images; + require_once(conf('prefix') . '/templates/show_album_art.inc.php'); + } + // Else nothing + else { + show_confirmation(_('Album Art Not Located'),_('Album Art could not be located at this time. This may be due to write access error, or the file is not received corectly.'),"/albums.php?action=show&album=" . $album->id); + } + + $albumname = $album->name; + $artistname = $artist; + + // Remember the last typed entry, if there was one + if (isset($_REQUEST['album_name'])) { $albumname = scrub_in($_REQUEST['album_name']); } + if (isset($_REQUEST['artist_name'])) { $artistname = scrub_in($_REQUEST['artist_name']); } + + require_once(conf('prefix') . '/templates/show_get_albumart.inc.php'); + + break; + case 'select_art': + + /* Check to see if we have the image url still */ + $image_id = $_REQUEST['image']; + $album_id = $_REQUEST['album_id']; + + $image = get_image_from_source($_SESSION['form']['images'][$image_id]); + $mime = $_SESSION['form']['images'][$image_id]['mime']; + + $album = new Album($album_id); + $album->insert_art($image,$mime); + + + show_confirmation(_('Album Art Inserted'),'',"/albums.php?action=show&album=$album_id"); + break; + case 'update_from_tags': + + $album = new Album($_REQUEST['album_id']); + + show_box_top(_('Starting Update from Tags')); + + $catalog = new Catalog(); + $catalog->update_single_item('album',$_REQUEST['album_id']); + + echo "<br /><b>" . _('Update From Tags Complete') . "</b> "; + echo "<a href=\"" . conf('web_path') . "/albums.php?action=show&album=" . scrub_out($_REQUEST['album_id']) . "\">[" . _('Return') . "]</a>"; + show_box_bottom(); + break; + // Browse by Album + default: + if (strlen($_REQUEST['match']) < '1') { $match = 'a'; } + + // Setup the View Ojbect + $view = new View(); + $view->import_session_view(); + + if ($match == 'Show_all' || $match == 'Show_missing_art' || $match == 'Browse') { $chr = ''; } + else { $chr = $match; } + + require (conf('prefix') . '/templates/show_box_top.inc.php'); + show_alphabet_list('albums','albums.php',$match); + show_alphabet_form($chr,_('Show Albums starting with'),"albums.php?action=match"); + require (conf('prefix') . '/templates/show_box_bottom.inc.php'); + + switch($match) { + case 'Show_all': + $offset_limit = 99999; + $sql = "SELECT album.id FROM song,album ". + " WHERE song.album=album.id ". + "GROUP BY song.album ". + " HAVING COUNT(song.id) > $min_album_size "; + break; + case 'Show_missing_art': + $offset_limit = 99999; + $sql = "SELECT album.id FROM song,album ". + " WHERE song.album=album.id ". + " AND album.art is null ". + "GROUP BY song.album ". + " HAVING COUNT(song.id) > $min_album_size "; + break; + case 'Browse': + case 'show_albums': + $sql = "SELECT album.id FROM song,album ". + " WHERE song.album=album.id ". + "GROUP BY song.album ". + " HAVING COUNT(song.id) > $min_album_size "; + break; + default: + $sql = "SELECT album.id FROM song,album ". + " WHERE song.album=album.id ". + " AND album.name LIKE '$match%'". + "GROUP BY song.album ". + " HAVING COUNT(song.id) > $min_album_size "; + } // end switch + + switch ($_REQUEST['type']) { + case 'album_sort': + if ($match != 'Browse' && $match != 'Show_missing_art' && $match != 'Show_all') { + $match_string = " AND album.name LIKE '$match%'"; + } + $sort_sql = "SELECT album.id, IF(COUNT(DISTINCT(song.artist)) > 1,'Various', artist.name) AS artist_name " . + "FROM song,artist,album WHERE song.album=album.id AND song.artist=artist.id $match_string" . + "GROUP BY album.name,album.year ". + "HAVING COUNT(song.id) > $min_album_size "; + $sort_order = 'artist.name'; + break; + default: + + break; + } // switch on special sort types + + // if we are returning + if ($_REQUEST['keep_view']) { + $view->initialize($sort_sql); + } + + // If we aren't keeping the view then initlize it + elseif ($sql) { + if (!$sort_order) { $sort_order = 'name'; } + $db_results = mysql_query($sql, dbh()); + $total_items = mysql_num_rows($db_results); + if ($match != "Show_all") { $offset_limit = $user->prefs['offset_limit']; } + $view = new View($sql, 'albums.php',$sort_order,$total_items,$offset_limit); + } + + else { $view = false; } + + if ($view->base_sql) { + $albums = get_albums($view->sql); + require conf('prefix') . '/templates/show_albums.inc.php'; + } + + break; +} // end switch on action + +show_footer(); +?> diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/album.lib.php b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/album.lib.php new file mode 100644 index 00000000..b9069afb --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/album.lib.php @@ -0,0 +1,110 @@ +<?php +/* + + This library handles album related functions.... wooo! + //FIXME: Remove this in favor of /modules/class/album +*/ + +/*! + @function get_albums + @discussion pass a sql statement, and it gets full album info and returns + an array of the goods.. can be set to format them as well +*/ +function get_albums($sql, $action=0) { + + $db_results = mysql_query($sql, dbh()); + while ($r = mysql_fetch_array($db_results)) { + $album = new Album($r[0]); + $album->format_album(); + $albums[] = $album; + } + + return $albums; + + +} // get_albums + +/** + * get_image_from_source + * This gets an image for the album art from a source as + * defined in the passed array. Because we don't know where + * its comming from we are a passed an array that can look like + * ['url'] = URL *** OPTIONAL *** + * ['file'] = FILENAME *** OPTIONAL *** + * ['raw'] = Actual Image data, already captured + */ +function get_image_from_source($data) { + + // Already have the data, this often comes from id3tags + if (isset($data['raw'])) { + return $data['raw']; + } + + // Check to see if it's a URL + if (isset($data['url'])) { + $snoopy = new Snoopy(); + $snoopy->fetch($data['url']); + return $snoopy->results; + } + + // Check to see if it's a FILE + if (isset($data['file'])) { + $handle = fopen($data['file'],'rb'); + $image_data = fread($handle,filesize($data['file'])); + fclose($handle); + return $image_data; + } +// // Check to see if it is embedded in id3 of a song + if (isset($data['song'])) { + // If we find a good one, stop looking + $getID3 = new getID3(); + $id3 = $getID3->analyze($data['song']); + + if ($id3['format_name'] == "WMA") { + return $id3['asf']['extended_content_description_object']['content_descriptors']['13']['data']; + } + elseif (isset($id3['id3v2']['APIC'])) { + // Foreach incase they have more then one + foreach ($id3['id3v2']['APIC'] as $image) { + return $image['data']; + } + } + } +// last "checked" added for working covers in id3 + return false; + +} // get_image_from_source + +/** + * get_random_albums + * This returns a random number of albums from the catalogs + * this is used by the index to return some 'potential' albums to play + */ +function get_random_albums($count='') { + + if (!$count) { $count = 5; } + + $count = sql_escape($count); + + // We avoid a table scan by using the id index and then using a rand to pick a row # + $sql = "SELECT `id` FROM `album` WHERE `art` IS NOT NULL"; + $db_results = mysql_query($sql,dbh()); + + while ($r = mysql_fetch_assoc($db_results)) { + $albums[] = $r['id']; + } + + $total = count($albums); + + for ($i=0; $i <= $count; $i++) { + $record = rand(0,$total); + // If we've already set this one, we gotta get another! + if (isset($results[$record])) { $i--; } + $results[$record] = $albums[$record]; + } + + return $results; + +} // get_random_albums + +?> diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/class/album.class.php b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/class/album.class.php new file mode 100644 index 00000000..0bbd9228 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/class/album.class.php @@ -0,0 +1,602 @@ +<?php +/* + + Copyright (c) 2001 - 2006 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 v2 + as published by the Free Software Foundation. + + 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. + +*/ + +/** + * Album Class + * This is the class responsible for handling the Album object + * it is related to the album table in the database. + */ +class Album { + + /* Variables from DB */ + var $id; + var $name; + var $year; + var $prefix; + + /* Art Related Fields */ + var $art; + var $art_mime; + + // cached information + var $_songs=array(); + + /*! + @function Album + @discussion Album class, for modifing a song. + @param $album_id The ID of the song + */ + function Album($album_id = 0) { + + if (!$album_id) { return false; } + + /* Assign id for use in get_info() */ + $this->id = $album_id; + + /* Get the information from the db */ + if ($info = $this->_get_info()) { + $this->name = trim($info['prefix'] . " " . $info['album_name']); + $this->songs = $info['song_count']; + $this->artist_count = $info['artist_count']; + $this->year = $info['year']; + $this->artist = trim($info['artist_prefix'] . " " . $info['artist_name']); + $this->artist_id = $info['art_id']; + $this->album = $info['album_name']; + $this->has_art = $info['has_art']; + $this->prefix = $info['prefix']; + } // if info + + return true; + + } //constructor + + /*! + @function get_info + @discussion get's the vars for $this out of the database + @param $this->id Taken from the object + */ + function _get_info() { + + $this->id = intval($this->id); + + /* Grab the basic information from the catalog and return it */ + $sql = "SELECT COUNT(DISTINCT(song.artist)) as artist_count,album.prefix,album.year,album.name AS album_name,COUNT(song.id) AS song_count," . + "artist.name AS artist_name,artist.id AS art_id,artist.prefix AS artist_prefix,album.art AS has_art ". + "FROM song,artist,album WHERE album.id='$this->id' AND song.album=album.id AND song.artist=artist.id GROUP BY song.album"; + + $db_results = mysql_query($sql, dbh()); + + $results = mysql_fetch_assoc($db_results); + + // If there is art then set it to 1, if not set it to 0, we don't want to cary + // around the full blob with every object because it can be pretty big + $results['has_art'] = strlen($results['has_art']) ? '1' : '0'; + + return $results; + + } // _get_info + + /*! + @function get_songs + @discussion gets the songs for this album + */ + function get_songs($limit = 0) { + + $results = array(); + + $sql = "SELECT id FROM song WHERE album='$this->id' ORDER BY track, title"; + if ($limit) { $sql .= " LIMIT $limit"; } + $db_results = mysql_query($sql, dbh()); + + while ($r = mysql_fetch_object($db_results)) { + $results[] = new Song($r->id); + } + + return $results; + + } // get_songs + + /** + * get_song_ids + * This returns an array of the song id's that are on this album. This is used by the + * show_songs function and can be pased and artist if you so desire to limit it to that + */ + function get_song_ids($artist='') { + + /* If they pass an artist then constrain it based on the artist as well */ + if ($artist) { + $artist_sql = " AND artist='" . sql_escape($artist) . "'"; + } + + $sql = "SELECT id FROM song WHERE album='" . sql_escape($this->id) . "' $artist_sql ORDER BY track"; + $db_results = mysql_query($sql, dbh()); + + $results = array(); + + while ($r = mysql_fetch_assoc($db_results)) { + $results[] = $r['id']; + } + + return $results; + + } // get_song_ids + + /** + * format + * This is the format function for this object. It sets cleaned up + * album information with the base required + * f_link, f_name + */ + function format() { + + $web_path = conf('web_path'); + + /* Truncate the string if it's to long */ + $name = scrub_out(truncate_with_ellipse($this->name,conf('ellipse_threshold_album'))); + $artist = scrub_out($this->artist); + $this->f_name = "<a href=\"$web_path/albums.php?action=show&album=" . $this->id . "\" title=\"" . scrub_out($this->name) . "\">" . $name . "</a>"; + $this->f_link = "<a href=\"$web_path/albums.php?action=show&album=" . scrub_out($this->id) . "\" title=\"" . scrub_out($this->name) . "\">" . $name . "</a>"; + $this->f_songs = "<div align=\"center\">" . $this->songs . "</div>"; + $this->f_title = $name; + if ($this->artist_count == '1') { + $this->f_artist = "<a href=\"$web_path/artists.php?action=show&artist=" . $this->artist_id . "\">" . $artist . "</a>"; + } + else { + $this->f_artist = _('Various'); + } + + if ($this->year == '0') { + $this->year = "N/A"; + } + + } // format + + /** + * format_album + * DEPRECIATED DO NOT USE! + */ + function format_album() { + + // Call the real function + $this->format(); + + } // format_album + + /** + * get_art + * This function only pulls art from the database, nothing else + * It should not be called when trying to find new art + */ + function get_art() { + + return $this->get_db_art(); + + } // get_art + + /** + * find_art + * This function searches for album art using all configured methods + * for the current album. There is an optional 'limit' passed that will + * gather up to the specified number of possible album covers. + * There is also an optional array of options the possible options are + * ['keyword'] = STRING + * ['artist'] = STRING + * ['album_name'] = STRING + */ + function find_art($options=array(),$limit='') { + + /* Create Base Vars */ + $results = array(); + + /* Attempt to retrive the album art order */ + $config_value = conf('album_art_order'); + $class_methods = get_class_methods('Album'); + + /* If it's not set */ + if (empty($config_value)) { + // They don't want art! + return array(); + } + elseif (!is_array($config_value)) { + $config_value = array($config_value); + } + + foreach ($config_value AS $method) { + + $data = array(); + + $method_name = "get_" . $method . "_art"; + if (in_array($method_name,$class_methods)) { + // Some of these take options! + switch ($method_name) { + case 'get_amazon_art': + $data = $this->{$method_name}($options['keyword'],$limit); + break; + case 'get_id3_art': + if ($options['skip_id3']) { break; } + $data = $this->{$method_name}($limit); + break; + default: + $data = $this->{$method_name}(); + break; + } + + // Add the results we got to the current set + $total_results += count($data); + $results = array_merge($results,$data); + + if ($total_results > $limit AND $limit > 0) { + return $results; + } + + } // if the method exists + + } // end foreach + + return $results; + + } // find_art + + /*! + @function get_id3_art + @discussion looks for art from the id3 tags + */ + function get_id3_art($limit='') { + + // grab the songs and define our results + if (!count($this->_songs)) { + $this->_songs = $this->get_songs(); + } + $data = array(); + + // Foreach songs in this album + foreach ($this->_songs as $song) { + + // If we find a good one, stop looking + $getID3 = new getID3(); + $id3 = $getID3->analyze($song->file); + +// if ($id3['format_name'] == "WMA") { +// $image = $id3['asf']['extended_content_description_object']['content_descriptors']['13']; +// $data[] = array('raw'=>$image['data'],'mime'=>$image['mime']); +// } +// elseif (isset($id3['id3v2']['APIC'])) { +// // Foreach incase they have more then one +// foreach ($id3['id3v2']['APIC'] as $image) { +// $data[] = array('raw'=>$image['data'],'mime'=>$image['mime']); +// } +// } + if ($id3['format_name'] == "WMA") { + $image = $id3['asf']['extended_content_description_object']['content_descriptors']['13']; + $data[] = array('song'=>$song->file,'raw'=>$image['data'],'mime'=>$image['mime']); + } + elseif (isset($id3['id3v2']['APIC'])) { + // Foreach incase they have more then one + foreach ($id3['id3v2']['APIC'] as $image) { + $data[] = array('song'=>$song->file,'raw'=>$image['data'],'mime'=>$image['mime']); + } + } +// modified for working covers in id3 + + if (!empty($limit) && $limit < count($data)) { + return $data; + } + + } // end foreach + + return $data; + + } // get_id3_art + + /** + * get_folder_art() + * returns the album art from the folder of the audio files + * If a limit is passed or the preferred filename is found the current results set + * is returned + */ + function get_folder_art($limit='') { + + if (!count($this->_songs)) { + $this->_songs = $this->get_songs(); + } + $data = array(); + + /* See if we are looking for a specific filename */ + $preferred_filename = conf('album_art_preferred_filename'); + + // Init a horrible hack array of lameness + $cache =array(); + + /* Thanks to dromio for origional code */ + /* Added search for any .jpg, png or .gif - Vollmer */ + foreach($this->_songs as $song) { + $dir = dirname($song->file); + + debug_event('folder_art',"Opening $dir and checking for Album Art",'3'); + + /* Open up the directory */ + $handle = @opendir($dir); + + if (!is_resource($handle)) { + echo "<font class=\"error\">" . _("Error: Unable to open") . " $dir</font><br />\n"; + debug_event('read',"Error: Unable to open $dir for album art read",'2'); + } + + + /* Recurse through this dir and create the files array */ + while ( FALSE !== ($file = @readdir($handle)) ) { + $extension = substr($file,strlen($file)-3,4); + + /* If it's an image file */ + if ($extension == "jpg" || $extension == "gif" || $extension == "png" || $extension == "jp2") { + + // HACK ALERT this is to prevent duplicate filenames + $full_filename = $dir . '/' . $file; + $index = md5($full_filename); + + /* Make sure it's got something in it */ + if (!filesize($dir . '/' . $file)) { continue; } + + if ($file == $preferred_filename) { + // If we found the preferred filename we're done, wipe out previous results + $data = array(array('file' => $full_filename, 'mime' => 'image/' . $extension)); + return $data; + } + elseif (!isset($cache[$index])) { + $data[] = array('file' => $full_filename, 'mime' => 'image/' . $extension); + } + + $cache[$index] = '1'; + + } // end if it's an image + + } // end while reading dir + @closedir($handle); + + if (!empty($limit) && $limit < count($data)) { + return $data; + } + + } // end foreach songs + + return $data; + + } // get_folder_art() + + /** + * get_db_art() + * returns the album art from the db along with the mime type + */ + function get_db_art() { + + $sql = "SELECT art,art_mime FROM album WHERE id='$this->id' AND art_mime IS NOT NULL"; + $db_results = mysql_query($sql, dbh()); + + $results = mysql_fetch_assoc($db_results); + + if (!$results['art']) { return array(); } + + return $results; + + } // get_db_art + + /** + * get_amazon_art + * This takes keywords and performs a search of the Amazon website + * for album art. It returns an array of found objects with mime/url keys + */ + function get_amazon_art($keywords = '',$limit='') { + + $images = array(); + $final_results = array(); + $possible_keys = array("LargeImage","MediumImage","SmallImage"); + + // Prevent the script from timing out + set_time_limit(0); + + if (empty($keywords)) { + $keywords = $this->name; + /* If this isn't a various album combine with artist name */ + if ($this->artist_count == '1') { $keywords .= ' ' . $this->artist; } + } + + /* Create Base Vars */ + $amazon_base_urls = array(); + + /* Attempt to retrive the album art order */ + $config_value = conf('amazon_base_urls'); + + /* If it's not set */ + if (empty($config_value)) { + $amazon_base_urls = array('http://webservices.amazon.com'); + } + elseif (!is_array($config_value)) { + array_push($amazon_base_urls,$config_value); + } + else { + $amazon_base_urls = array_merge($amazon_base_urls, conf('amazon_base_urls')); + } + + /* Foreach through the base urls that we should check */ + foreach ($amazon_base_urls AS $amazon_base) { + + // Create the Search Object + $amazon = new AmazonSearch(conf('amazon_developer_key'), $amazon_base); + $search_results = array(); + + /* Setup the needed variables */ + $max_pages_to_search = max(conf('max_amazon_results_pages'),$amazon->_default_results_pages); + $pages_to_search = $max_pages_to_search; //init to max until we know better. + + // while we have pages to search + do { + $raw_results = $amazon->search(array('artist'=>$artist,'album'=>$albumname,'keywords'=>$keywords)); + + $total = count($raw_results) + count($search_results); + + // If we've gotten more then we wanted + if (!empty($limit) && $total > $limit) { + // We don't want ot re-count every loop + $i = $total; + while ($i > $limit) { + array_pop($raw_results); + $i--; + } + + debug_event('amazon-xml',"Found $total, Limit $limit reducing and breaking from loop",'5'); + // Merge the results and BREAK! + $search_results = array_merge($search_results,$raw_results); + break; + } // if limit defined + + $search_results = array_merge($search_results,$raw_results); + $pages_to_search = min($max_pages_to_search, $amazon->_maxPage); + debug_event('amazon-xml', "Searched results page " . ($amazon->_currentPage+1) . "/" . $pages_to_search,'5'); + $amazon->_currentPage++; + + } while($amazon->_currentPage < $pages_to_search); + + + // Only do the second search if the first actually returns something + if (count($search_results)) { + $final_results = $amazon->lookup($search_results); + } + + /* Log this if we're doin debug */ + debug_event('amazon-xml',"Searched using $keywords with " . conf('amazon_developer_key') . " as key " . count($final_results) . " results found",'5'); + + // If we've hit our limit + if (!empty($limit) && count($final_results) >= $limit) { + break; + } + + } // end foreach + + /* Foreach through what we've found */ + foreach ($final_results as $result) { + + /* Recurse through the images found */ + foreach ($possible_keys as $key) { + if (strlen($result[$key])) { + break; + } + } // foreach + + // Rudimentary image type detection, only JPG and GIF allowed. + if (substr($result[$key], -4 == '.jpg')) { + $mime = "image/jpg"; + } + elseif (substr($result[$key], -4 == '.gif')) { + $mime = "image/gif"; + } + elseif (substr($result[$key], -4 == '.png')) { + $mime = "image/png"; + } + else { + /* Just go to the next result */ + continue; + } + + $data['url'] = $result[$key]; + $data['mime'] = $mime; + + $images[] = $data; + + if (!empty($limit)) { + if (count($images) >= $limit) { + return $images; + } + } + + } // if we've got something + + return $images; + + } // get_amazon_art() + + + /*! + @function get_random_songs + @discussion gets a random number, and + a random assortment of songs from this + album + */ + function get_random_songs() { + + $results = array(); + + $sql = "SELECT id FROM song WHERE album='$this->id' ORDER BY RAND()"; + $db_results = mysql_query($sql, dbh()); + + while ($r = mysql_fetch_array($db_results)) { + $results[] = $r[0]; + } + + return $results; + + } // get_random_songs + + /*! + @function clear_art + @discussion clears the album art from the DB + */ + function clear_art() { + + $sql = "UPDATE album SET art=NULL, art_mime=NULL WHERE id='$this->id'"; + $db_results = mysql_query($sql, dbh()); + + } // clear_art + + /*! + @function insert_art + @discussion this takes a string representation of an image + and inserts it into the database. You must pass the + mime type as well + */ + function insert_art($image, $mime) { + + /* Have to disable this for Demo because people suck and try to + * insert PORN :( + */ + if (conf('demo_mode')) { return false; } + + // Check for PHP:GD and if we have it make sure this image is of some size + if (function_exists('ImageCreateFromString')) { + $im = @ImageCreateFromString($image); + if (@imagesx($im) == 1 || @imagesy($im) == 1 && $im) { + return false; + } + } // if we have PHP:GD + + // Push the image into the database + $sql = "UPDATE album SET art = '" . sql_escape($image) . "'," . + " art_mime = '" . sql_escape($mime) . "'" . + " WHERE id = '$this->id'"; + $db_results = mysql_query($sql, dbh()); + + return true; + + } // insert_art + + +} //end of album class + +?> diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/class/view.class.php b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/class/view.class.php new file mode 100644 index 00000000..17a80fb7 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/class/view.class.php @@ -0,0 +1,234 @@ +<?php +/* + + Copyright (c) 2001 - 2006 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. + +*/ + +/*! + @header View Object of crappyness + View object that is thrown into their session + +*/ + + +class View { + + //Basic Componets + var $base_sql; + var $offset; + var $offset_limit; + var $sort_order; //asc or desc + var $sort_type; + var $action; + var $total_items; + + //generate a new view + function View($base_sql=0,$script=0,$sort_type=0,$total_items=0,$offset_limit=0) { + global $conf; + + // If we don't have a base sql, stop here + if (!is_string($base_sql)) { + return true; + } + + //Convert all 's into "s + $base_sql = str_replace("'",'"',$base_sql); + + $this->base_sql = $base_sql; + if ($offset_limit) { $this->offset_limit = $offset_limit; } + else { $this->offset_limit = $_SESSION['offset_limit']; } + if ($this->offset_limit < '1') { $this->offset_limit = '50'; } + $this->script = $script; + $this->sort_type = $sort_type; +// $this->sort_order = "ASC"; // affects only album sorting order + $this->sort_order = "DESC"; + $this->offset = 0; + $this->total_items = $total_items; + + // Set the session + $_SESSION['view_offset_limit'] = $this->offset_limit; + $_SESSION['view_sort_type'] = $this->sort_type; + $_SESSION['view_offset'] = $this->offset; + $_SESSION['view_base_sql'] = $this->base_sql; + $_SESSION['view_sort_order'] = $this->sort_order; + $_SESSION['view_script'] = $this->script; + $_SESSION['view_total_items'] = $this->total_items; + $this->sql = $this->generate_sql(); + + } //constructor + + //takes all the parts and makes a full blown sql statement + function generate_sql() { + global $conf; + + $sql = $this->base_sql . " ORDER BY " . $this->sort_type ." ". $this->sort_order ." LIMIT " . $this->offset . "," . $this->offset_limit; + + return $sql; + + } //generate_sql + + //change the sort order from asc to desc or vise versa + function change_sort($new_sort=0) { + global $conf; + + if ($new_sort) { + $this->sort_order = $new_sort; + } + elseif ($this->sort_order == "DESC") { + $this->sort_order = "ASC"; + } + else { + $this->sort_order = "DESC"; + } + + $_SESSION['view_sort_order'] = $this->sort_order; + + $this->sql = $this->generate_sql(); + + return; + + } //change_sort + + //change the base sql + function change_sql($base_sql) { + global $conf; + + //Convert all 's into "s + $base_sql = str_replace("'",'"',$base_sql); + + $this->base_sql = $base_sql; + + $_SESSION['view_base_sql'] = $this->base_sql; + + $this->sql = $this->generate_sql(); + + } //change_sql + + //change offset + function change_offset($offset=0) { + global $conf; + + if (isset($offset)) { + $this->offset = $offset; + } + else { + $this->offset = $this->offset + $this->offset_limit; + } + + $_SESSION['view_offset'] = $this->offset; + + $this->sql = $this->generate_sql(); + + } //change_offset + + //change sort_type + function change_sort_type($sort_type) { + + $this->sort_type = $sort_type; + + $_SESSION['view_sort_type'] = $this->sort_type; + + $this->sql = $this->generate_sql(); + + } //change_sort_type + + /*! + @function change_offset_limit + @discussion changes the offset limit, sets the session + var and generates the sql statement + */ + function change_offset_limit($offset_limit) { + + $this->offset_limit = $offset_limit; + + $_SESSION['view_offset_limit'] = $this->offset_limit; + + $this->sql = $this->generate_sql(); + + } // change_offset_limit + + /*! + @function initialize + @discussion initializes the view object, checks $_REQUEST + for changes to the view object + */ + function initialize($sql='') { + + /* From time to time we need to change the SQL statement while + * maintaining the paging + */ + if ($sql) { + $this->change_sql($sql); + } + + if ($_REQUEST['sort_type']) { + $this->change_sort_type($_REQUEST['sort_type']); + } + + if (isset($_REQUEST['offset'])) { + $this->change_offset($_REQUEST['offset']); + } + + if ($_REQUEST['base_sql']) { + $this->change_sql($_REQUEST['base_sql']); + } + + if (isset($_REQUEST['sort_order'])) { + $this->change_sort($_REQUEST['sort_order']); + } + + if ($_REQUEST['offset_limit']) { + $this->change_offset_limit($_REQUEST['offset_limit']); + } + + } // initialize + + + /*! + @function import_session_view + @discussion this imports the view from the session for use.. + this keeps us from having to globalize anything + wohoo! + */ + function import_session_view() { + + $this->sort_type = $_SESSION['view_sort_type']; + $this->offset = $_SESSION['view_offset']; + $this->base_sql = $_SESSION['view_base_sql']; + $this->sort_order = $_SESSION['view_sort_order']; + $this->script = $_SESSION['view_script']; + $this->total_items = $_SESSION['view_total_items']; + + + if ($_SESSION['view_offset_limit']) { + $this->offset_limit = $_SESSION['view_offset_limit']; + } + else { + $this->offset_limit = $_SESSION['offset_limit']; + } + + + $this->sql = $this->generate_sql(); + + } // import_session_view + + + +} //end class +?> diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/rating.lib.php b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/rating.lib.php new file mode 100644 index 00000000..4830b165 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/lib/rating.lib.php @@ -0,0 +1,78 @@ +<?php +/* + + Copyright 2001 - 2007 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 v2 + as published by the Free Software Foundation. + + 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_rating + * This takes an artist id and includes the right file + */ +function show_rating($object_id,$type) { + + $rating = new Rating($object_id,$type); + + include(conf('prefix') . '/templates/show_object_rating.inc.php'); + +} // show_rating + +// patch by andy90 +function show_rating_static($object_id,$type) { + + $rating = new Rating($object_id,$type); + + include(conf('prefix') . '/templates/show_object_rating_static.inc.php'); + +} // show_rating_static + +/** + * get_rating_name + * This takes a score and returns the name that we should use + */ +function get_rating_name($score) { + + switch ($score) { + case '0': + return _("Don't Play"); + break; + case '1': + return _("It's Pretty Bad"); + break; + case '2': + return _("It's Ok"); + break; + case '3': + return _("It's Pretty Good"); + break; + case '4': + return _("I Love It!"); + break; + case '5': + return _("It's Insane"); + break; + // I'm fired + default: + return _("Off the Charts!"); + break; + } // end switch + + return true; + +} // get_rating_name + +?> diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_list_duplicates.inc.php b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_list_duplicates.inc.php new file mode 100644 index 00000000..4d319f97 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_list_duplicates.inc.php @@ -0,0 +1,84 @@ +<?php +/* + + Copyright (c) 2001 - 2006 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 v2 + as published by the Free Software Foundation. + + 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. + +*/ + +$web_path = conf('web_path'); +show_duplicate_searchbox($search_type); + +if (count($flags)) { ?> + <?php show_box_top(_('Duplicate Songs')); ?> + <form method="post" enctype="multipart/form-data" action="<?php echo $web_path; ?>/admin/flag.php?action=disable"> + <table class="tabledata"> + <tr class="table-header"> + <td><?php echo _('Disable'); ?></td> + <td><?php echo _('Song'); ?></td> + <td><?php echo _('Artist'); ?></td> + <td><?php echo _('Album'); ?></td> + <td><?php echo _('Length'); ?></td> + <td><?php echo _('Bitrate'); ?></td> + <td><?php echo _('Size'); ?></td> + <td><?php echo _('Filename'); ?></td> + </tr> + <?php + foreach ($flags as $flag) { + /* Build the Song */ + $song = new Song($flag['song']); + $song->format_song(); + + // Set some extra vars + $alt_title = $song->title; + $formated_title = $song->f_title; + $artist = $song->f_artist; + $alt_artist = $song->f_full_artist; + + // Gather the duplicates + $dinfolist = get_duplicate_info($song,$search_type,$_REQUEST['auto']); + + // Set the current class, only changes once per set of duplicates + $current_class = flip_class(); + + foreach ($dinfolist as $key=>$dinfo) { + $check_txt = ''; + if ($key == '0' AND $_REQUEST['auto']) { $check_txt = ' checked="checked"'; } + echo "<tr class=\"".$current_class."\">". + "<td><input type=\"checkbox\" name=\"song_ids[]\" value=\"" . $dinfo['songid'] . "\" $check_txt/></td>". + "<td><a href=\"$web_path/song.php?action=single_song&song_id=$song->id\">".scrub_out($formated_title)."</a> </td>". + "<td><a href=\"$web_path/artists.php?action=show&artist=".$dinfo['artistid']."\" title=\"".scrub_out($dinfo['artist'])."\">".scrub_out($dinfo['artist'])."</a> </td>". + "<td><a href=\"$web_path/albums.php?action=show&album=".$dinfo['albumid']."\" title=\"".scrub_out($dinfo['album'])."\">".scrub_out($dinfo['album'])."</a> </td>". + "<td>".floor($dinfo['time']/60).":".sprintf("%02d", ($dinfo['time']%60) )."</td>". + "<td>".intval($dinfo['bitrate']/1000)."</td>". + "<td>".sprintf("%.2f", ($dinfo['size']/1048576))."MB</td>". + "<td><a href=\"file:////".$dinfo['file']."\">".$dinfo['file']."</a> </td>"; +// "<td>".$dinfo['file']."</td>"; // original + echo "</tr>\n"; + } // end foreach ($dinfolist as $dinfo) + + } // end foreach ($flags as $flag) + ?> + <tr> + <td colspan="8" class="<?php echo flip_class(); ?>"><input type="submit" value="<?php echo _('Disable Songs'); ?>" /></td> + </tr> + </table> + </form> + <?php show_box_bottom(); ?> +<?php } else { ?> +<p class="error"><?php echo _('No Records Found'); ?></p> +<?php } // end if ($flags) and else ?> + diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_login_form.inc b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_login_form.inc new file mode 100644 index 00000000..53ddd896 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_login_form.inc @@ -0,0 +1,51 @@ +<?php +/* + Copyright (c) 2001 - 2006 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 v2 + as published by the Free Software Foundation. + + 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. + +*/ + +/* Check and see if their remember me is the same or lower then local + * if so disable the checkbox + */ +if (conf('local_length') >= conf('remember_length')) { + $remember_disabled = 'disabled="disabled"'; +} + +?> + +<div id="container"> + <h1><span><?php echo conf('site_title'); ?></span></h1> + <div> + <p id="loginp_0"><?php echo conf('site_title'); ?></p> + <form name="login" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ; ?>/login.php" style="Display:inline"> + <p class="loginp_1"><span><?php echo _('Login'); ; ?>:</span> + <input class="text_input" type="text" name="username" value="<?php echo $_REQUEST['username']; ; ?>" /></p> + <p class="loginp_1"><span><?php echo _('Password'); ; ?>:</span> + <input class="text_input" type="password" name="password" value="" /></p> + <p class="loginp_1"><?php echo _('Remember Me'); ?><input class="check_input" type="checkbox" name="rememberme" <?php echo $remember_disabled; ?> /><input class="button" type="submit" value="<?php echo _('Login'); ?>" /></p> + <?php echo conf('login_message'); ; ?> + <?php $GLOBALS['error']->print_error('general'); ?> + <input type="hidden" name="referrer" value="<?php echo scrub_out($_SERVER['HTTP_REFERRER']); ?>" /> + <input type="hidden" name="action" value="login" /> + </form> + <?php if (conf('allow_public_registration')) { ?> + <span class="text-action"> + <a href="<?php echo conf('web_path'); ?>/register.php"><?php echo _('Register'); ?></a> + </span> + <?php } // end if (conf('allow_public_registration')) ?> + </div> +</div> diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_now_playing_row.inc.php b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_now_playing_row.inc.php new file mode 100644 index 00000000..93267dff --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_now_playing_row.inc.php @@ -0,0 +1,51 @@ +<?php +/* + +Copyright (c) 2001 - 2006 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 v2 +as published by the Free Software Foundation. + +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. + +*/ + +/* Prepare the variables */ +$title = scrub_out(truncate_with_ellipse($song->title,'25')); +$album = scrub_out(truncate_with_ellipse($song->f_album_full,'25')); +$artist = scrub_out(truncate_with_ellipse($song->f_artist_full,'25')); + +?> +<td class="np_cell_1"><b><?php echo _('Username'); ?></b>:<br><?php echo scrub_out($np_user->fullname); ?><!-- ## modified ##--> + <div id="lp_box_ctrl"> + <?php require_once(conf('prefix') . '/templates/show_localplay_control.inc.php'); ?> + </div> + <b><?php echo _('Song'); ?></b><br /><a title="<?php echo scrub_out($song->title); ?>" href="<?php echo $web_path; ?>/song.php?action=single_song&song_id=<?php echo $song->id; ?>"> + <?php echo $title; ?> + </a> + <?php if(conf('ratings')) { ?> + <br /><?php show_rating($song->id,'song'); ?> + <?php } ?> +</td> +<td class="np_cell_3"> + <b><?php echo _('Artist'); ?></b><br /><a title="<?php echo scrub_out($song->f_artist_full); ?>" href="<?php echo $web_path; ?>/artists.php?action=show&artist=<?php echo $song->artist; ?>"> + <?php echo $artist; ?> + </a><br /><br /> + <b><?php echo _('Album'); ?></b><br /><a title="<?php echo scrub_out($song->f_album_full); ?>" href="<?php echo $web_path; ?>/albums.php?action=show&album=<?php echo $song->album; ?>"> + <?php echo $album; ?></a> +</td> + <?php if (conf('show_album_art')) { ?> +<td class="np_cell_4"> + <a target="_blank" href="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>" onclick="popup_art('<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>'); return false;"> + <img align="middle" border="0" src="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&thumb=1&sid=<?php echo session_id(); ?>" alt="Album Art" height="75" width="75" /></a> +</td> +<?php } // end play album art ?>
\ No newline at end of file diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_object_rating_static.inc.php b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_object_rating_static.inc.php new file mode 100644 index 00000000..ce1d3356 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_object_rating_static.inc.php @@ -0,0 +1,64 @@ +<?php +/* + Copyright 2001 - 2006 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 v2 + as published by the Free Software Foundation. + + 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. + +*/ + +/* Create some variables we are going to need */ +$web_path = conf('web_path'); +$base_url = conf('ajax_url') . '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id . conf('ajax_info'); + + +//set the background to no stars +echo "<ul class=\"star-rating\">\n"; + +/* Handle the "Not rated" possibility */ +if ($rating->rating == '-1') { + echo "<li class=\"zero-stars\"></li>\n"; +} +else { + echo "<li class=\"zero-stars\"></li>\n"; +} +// decide width of rating. image is 16 px wide +$width = $rating->rating*16; +if ($width < 0) $width = 0; + +//set the current rating background +echo "<li class=\"current-rating\" style=\"width:${width}px\" >Current rating: "; +if ($rating->rating <= 0) { + echo "not rated yet </li>\n"; +} +else echo "$rating->rating of 5</li>\n"; + +//it did not like my "1-star", "2-star" ... css styles, and I changed it to this after I realized star1... would have worked :\ +?> +<li> + <span class="one-stars" title="1 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="two-stars" title="2 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="three-stars" title="3 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="four-stars" title="4 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="five-stars" title="5 <?php echo _('out of'); ?> 5"></span> +</li> +</ul>
\ No newline at end of file diff --git a/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_random_albums.inc.php b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_random_albums.inc.php new file mode 100644 index 00000000..ec3bde2f --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.2/ampache/templates/show_random_albums.inc.php @@ -0,0 +1,50 @@ +<?php +/* + + Copyright (c) 2001 - 2006 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 v2 + as published by the Free Software Foundation. + + 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. + +*/ +$web_path = conf('web_path'); +?> +<?php show_box_top(_('Albums of the Moment')); ?> +<table class="tabledata"> +<tr> + <?php + foreach ($albums as $album_id) { + $album = new Album($album_id); + $album->format(); + $name = scrub_out('[' . $album->artist . '] ' . $album->name); + ?> + <td> + <a href="<?php echo $web_path; ?>/albums.php?action=show&album=<?php echo $album_id; ?>"> + <?php if (conf('show_album_art')) { ?> + <img src="<?php echo $web_path; ?>/image.php?thumb=3&id=<?php echo $album_id; ?>" width="80" height="80" border="0" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" /> + <?php } else { ?> + <?php echo '[' . $album->f_artist . '] ' . $album->f_name; ?> + <?php } ?> + </a><br> + <?php + if(conf('ratings')){ + echo "<div style=\"float:left; display:inline;\" id=\"rating_" . $album->id . "_album\">"; + show_rating_static($album->id, 'album');} + echo "</div>"; + ?> + </td> + <?php } ?> +</tr> +</table> +<?php show_box_bottom(); ?> diff --git a/contrib/themes/Cleandy/patch-3.3.3.3/README.txt b/contrib/themes/Cleandy/patch-3.3.3.3/README.txt new file mode 100644 index 00000000..1bbc0b62 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.3/README.txt @@ -0,0 +1,9 @@ +This is optional! +But it improves accessability and better fits in ampache installations using themes by me + +Copy the files includes in this folder to ampaches root to the appropriate folders. +They include some patches to ampache 3.3.3.3 for login page, album listing and some other things. +They'll work fine until included/fixed (maybe) in the next version of ampache. +They are not necessary but improve look & feel. + +Thanks to blueorder and andy90 for help on some patches ;)
\ No newline at end of file diff --git a/contrib/themes/Cleandy/patch-3.3.3.3/ampache/lib/rating.lib.php b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/lib/rating.lib.php new file mode 100644 index 00000000..4830b165 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/lib/rating.lib.php @@ -0,0 +1,78 @@ +<?php +/* + + Copyright 2001 - 2007 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 v2 + as published by the Free Software Foundation. + + 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_rating + * This takes an artist id and includes the right file + */ +function show_rating($object_id,$type) { + + $rating = new Rating($object_id,$type); + + include(conf('prefix') . '/templates/show_object_rating.inc.php'); + +} // show_rating + +// patch by andy90 +function show_rating_static($object_id,$type) { + + $rating = new Rating($object_id,$type); + + include(conf('prefix') . '/templates/show_object_rating_static.inc.php'); + +} // show_rating_static + +/** + * get_rating_name + * This takes a score and returns the name that we should use + */ +function get_rating_name($score) { + + switch ($score) { + case '0': + return _("Don't Play"); + break; + case '1': + return _("It's Pretty Bad"); + break; + case '2': + return _("It's Ok"); + break; + case '3': + return _("It's Pretty Good"); + break; + case '4': + return _("I Love It!"); + break; + case '5': + return _("It's Insane"); + break; + // I'm fired + default: + return _("Off the Charts!"); + break; + } // end switch + + return true; + +} // get_rating_name + +?> diff --git a/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_localplay_status.inc.php b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_localplay_status.inc.php new file mode 100644 index 00000000..7a172a6d --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_localplay_status.inc.php @@ -0,0 +1,65 @@ +<?php +/* + + Copyright (c) 2001 - 2006 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. + +*/ + +$web_path = conf('web_path'); +$localplay = init_localplay(); + +$required_info = "&user_id=" . $GLOBALS['user']->id . "&sessid=" . session_id(); +$ajax_url = $web_path . '/server/ajax.server.php'; +$status = $localplay->status(); + + +?> +<span style="font-weight:bold;" id="lp_state"><?php echo $localplay->get_user_state($status['state']) ?></span><br /> + <span id="lp_playing"><?php echo $localplay->get_user_playing(); ?></span> +<div class="lp_box_ctrl"><?php require (conf('prefix') . '/templates/show_localplay_control.inc.php'); ?></div> +<div class="lp_box_vol"> + <?php if ($localplay->has_function('volume_up')) { ?> + <span class="up_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=volume_up<?php echo $required_info; ?>','lp_v');return true;"> + <?php echo get_user_icon('volumeup'); ?> + </span> + <?php } ?> + <?php if ($localplay->has_function('volume_down')) { ?> + <span class="down_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=volume_down<?php echo $required_info; ?>','lp_v');return true;"> + <?php echo get_user_icon('volumedn'); ?> + </span> + <?php } ?> + <?php if ($localplay->has_function('volume_mute')) { ?> + <span class="mute_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=volume_mute<?php echo $required_info; ?>','lp_v');return true;"> + <?php echo get_user_icon('volumemute'); ?> + </span> + <?php } ?> + <?php echo _('Volume'); ?>:<span id="lp_volume"><?php echo $status['volume']; ?></span> +</div> +<br /> +<?php if ($localplay->has_function('repeat')) { ?> + <?php echo _('Repeat') . ":" . print_boolean($status['repeat']); ?> | + <a href="<?php echo $web_path; ?>/localplay.php?action=repeat&value=<?php echo invert_boolean($status['repeat']); ?>"> + <?php echo print_boolean(invert_boolean($status['repeat'])); ?> + </a><br /> + <?php } ?> +<?php if ($localplay->has_function('random')) { ?> + <?php echo _('Random') . ":" . print_boolean($status['random']); ?> | + <a href="<?php echo $web_path; ?>/localplay.php?action=random&value=<?php echo invert_boolean($status['random']); ?>"> + <?php echo print_boolean(invert_boolean($status['random'])); ?> + </a><br /> +<?php } ?> diff --git a/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_login_form.inc b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_login_form.inc new file mode 100644 index 00000000..53ddd896 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_login_form.inc @@ -0,0 +1,51 @@ +<?php +/* + Copyright (c) 2001 - 2006 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 v2 + as published by the Free Software Foundation. + + 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. + +*/ + +/* Check and see if their remember me is the same or lower then local + * if so disable the checkbox + */ +if (conf('local_length') >= conf('remember_length')) { + $remember_disabled = 'disabled="disabled"'; +} + +?> + +<div id="container"> + <h1><span><?php echo conf('site_title'); ?></span></h1> + <div> + <p id="loginp_0"><?php echo conf('site_title'); ?></p> + <form name="login" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ; ?>/login.php" style="Display:inline"> + <p class="loginp_1"><span><?php echo _('Login'); ; ?>:</span> + <input class="text_input" type="text" name="username" value="<?php echo $_REQUEST['username']; ; ?>" /></p> + <p class="loginp_1"><span><?php echo _('Password'); ; ?>:</span> + <input class="text_input" type="password" name="password" value="" /></p> + <p class="loginp_1"><?php echo _('Remember Me'); ?><input class="check_input" type="checkbox" name="rememberme" <?php echo $remember_disabled; ?> /><input class="button" type="submit" value="<?php echo _('Login'); ?>" /></p> + <?php echo conf('login_message'); ; ?> + <?php $GLOBALS['error']->print_error('general'); ?> + <input type="hidden" name="referrer" value="<?php echo scrub_out($_SERVER['HTTP_REFERRER']); ?>" /> + <input type="hidden" name="action" value="login" /> + </form> + <?php if (conf('allow_public_registration')) { ?> + <span class="text-action"> + <a href="<?php echo conf('web_path'); ?>/register.php"><?php echo _('Register'); ?></a> + </span> + <?php } // end if (conf('allow_public_registration')) ?> + </div> +</div> diff --git a/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_now_playing_row.inc.php b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_now_playing_row.inc.php new file mode 100644 index 00000000..93267dff --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_now_playing_row.inc.php @@ -0,0 +1,51 @@ +<?php +/* + +Copyright (c) 2001 - 2006 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 v2 +as published by the Free Software Foundation. + +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. + +*/ + +/* Prepare the variables */ +$title = scrub_out(truncate_with_ellipse($song->title,'25')); +$album = scrub_out(truncate_with_ellipse($song->f_album_full,'25')); +$artist = scrub_out(truncate_with_ellipse($song->f_artist_full,'25')); + +?> +<td class="np_cell_1"><b><?php echo _('Username'); ?></b>:<br><?php echo scrub_out($np_user->fullname); ?><!-- ## modified ##--> + <div id="lp_box_ctrl"> + <?php require_once(conf('prefix') . '/templates/show_localplay_control.inc.php'); ?> + </div> + <b><?php echo _('Song'); ?></b><br /><a title="<?php echo scrub_out($song->title); ?>" href="<?php echo $web_path; ?>/song.php?action=single_song&song_id=<?php echo $song->id; ?>"> + <?php echo $title; ?> + </a> + <?php if(conf('ratings')) { ?> + <br /><?php show_rating($song->id,'song'); ?> + <?php } ?> +</td> +<td class="np_cell_3"> + <b><?php echo _('Artist'); ?></b><br /><a title="<?php echo scrub_out($song->f_artist_full); ?>" href="<?php echo $web_path; ?>/artists.php?action=show&artist=<?php echo $song->artist; ?>"> + <?php echo $artist; ?> + </a><br /><br /> + <b><?php echo _('Album'); ?></b><br /><a title="<?php echo scrub_out($song->f_album_full); ?>" href="<?php echo $web_path; ?>/albums.php?action=show&album=<?php echo $song->album; ?>"> + <?php echo $album; ?></a> +</td> + <?php if (conf('show_album_art')) { ?> +<td class="np_cell_4"> + <a target="_blank" href="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>" onclick="popup_art('<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>'); return false;"> + <img align="middle" border="0" src="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&thumb=1&sid=<?php echo session_id(); ?>" alt="Album Art" height="75" width="75" /></a> +</td> +<?php } // end play album art ?>
\ No newline at end of file diff --git a/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_object_rating_static.inc.php b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_object_rating_static.inc.php new file mode 100644 index 00000000..ce1d3356 --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_object_rating_static.inc.php @@ -0,0 +1,64 @@ +<?php +/* + Copyright 2001 - 2006 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 v2 + as published by the Free Software Foundation. + + 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. + +*/ + +/* Create some variables we are going to need */ +$web_path = conf('web_path'); +$base_url = conf('ajax_url') . '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id . conf('ajax_info'); + + +//set the background to no stars +echo "<ul class=\"star-rating\">\n"; + +/* Handle the "Not rated" possibility */ +if ($rating->rating == '-1') { + echo "<li class=\"zero-stars\"></li>\n"; +} +else { + echo "<li class=\"zero-stars\"></li>\n"; +} +// decide width of rating. image is 16 px wide +$width = $rating->rating*16; +if ($width < 0) $width = 0; + +//set the current rating background +echo "<li class=\"current-rating\" style=\"width:${width}px\" >Current rating: "; +if ($rating->rating <= 0) { + echo "not rated yet </li>\n"; +} +else echo "$rating->rating of 5</li>\n"; + +//it did not like my "1-star", "2-star" ... css styles, and I changed it to this after I realized star1... would have worked :\ +?> +<li> + <span class="one-stars" title="1 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="two-stars" title="2 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="three-stars" title="3 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="four-stars" title="4 <?php echo _('out of'); ?> 5"></span> +</li> +<li> + <span class="five-stars" title="5 <?php echo _('out of'); ?> 5"></span> +</li> +</ul>
\ No newline at end of file diff --git a/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_random_albums.inc.php b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_random_albums.inc.php new file mode 100644 index 00000000..ec3bde2f --- /dev/null +++ b/contrib/themes/Cleandy/patch-3.3.3.3/ampache/templates/show_random_albums.inc.php @@ -0,0 +1,50 @@ +<?php +/* + + Copyright (c) 2001 - 2006 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 v2 + as published by the Free Software Foundation. + + 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. + +*/ +$web_path = conf('web_path'); +?> +<?php show_box_top(_('Albums of the Moment')); ?> +<table class="tabledata"> +<tr> + <?php + foreach ($albums as $album_id) { + $album = new Album($album_id); + $album->format(); + $name = scrub_out('[' . $album->artist . '] ' . $album->name); + ?> + <td> + <a href="<?php echo $web_path; ?>/albums.php?action=show&album=<?php echo $album_id; ?>"> + <?php if (conf('show_album_art')) { ?> + <img src="<?php echo $web_path; ?>/image.php?thumb=3&id=<?php echo $album_id; ?>" width="80" height="80" border="0" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" /> + <?php } else { ?> + <?php echo '[' . $album->f_artist . '] ' . $album->f_name; ?> + <?php } ?> + </a><br> + <?php + if(conf('ratings')){ + echo "<div style=\"float:left; display:inline;\" id=\"rating_" . $album->id . "_album\">"; + show_rating_static($album->id, 'album');} + echo "</div>"; + ?> + </td> + <?php } ?> +</tr> +</table> +<?php show_box_bottom(); ?> diff --git a/contrib/themes/Cleandy/screencap/01.png b/contrib/themes/Cleandy/screencap/01.png Binary files differnew file mode 100644 index 00000000..d107ab8d --- /dev/null +++ b/contrib/themes/Cleandy/screencap/01.png diff --git a/contrib/themes/Cleandy/templates/default.css b/contrib/themes/Cleandy/templates/default.css new file mode 100644 index 00000000..a5e21362 --- /dev/null +++ b/contrib/themes/Cleandy/templates/default.css @@ -0,0 +1,732 @@ +<!-- +/* + + Copyright (c) 2001 - 2006 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. + + (nf) nospam.foster -at- web -dot- de + + This theme is supposed to be a hybrid of "burgundy" and the old "clean" theme. + Based on burgundy and colored like clean. + Though created "quick & dirty", this fits my needs and maybe yours, too. + + Used the css from burgundy with different colors and fixed the paths relative to the theme directory. + Integrated the rating images from "Apogee", thanks to apexeleven. + +*/ +--> +p { + color: #3F5F5E; +} + +a { + color: #3F5F5E; + font-family: Arial, Helvetica, sans-serif; + text-decoration: none; +} +a:visited + { + color: #666666; + font-family: Arial, Helvetica, sans-serif; + text-decoration: none; + } +a:active { + color: #3F5F5E; + font-family: Arial, Helvetica, sans-serif; +} +a:hover { + color: #ff9d4d; + font-family: Arial, Helvetica, sans-serif; + text-decoration: underline; +} + + +.text-box { + display: table-cell; + padding-left:5px; + padding-top:5px; + padding-right:5px; + padding-bottom:5px; + margin-bottom:15px; + background-color: #ffffff; + border-right:1px solid #c0c0c0; + border-bottom:1px solid #c0c0c0; + border-left:1px solid #c0c0c0; + border-top:1px solid #c0c0c0; +} +.selected_button { + background-color: black;color:white; +} +.unselected_button { + /* there really isn't anything for this */ +} +.display {} + +/*table{border-collapse: separate;empty-cells:show;}*/ + +table.tabledata {border-collapse: collapse;} +td { + padding: 0px 8px 0px 8px; + color: #3F5F5E; + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; +/* border: 1pt solid #c0c0c0; + border-bottom:1px solid #c0c0c0; + border-top:1px solid #c0c0c0;*/ +} +th { + padding-right: 10px; + padding-left: 10px; + padding-bottom: 2px; +/* border: 1pt solid #c0c0c0; */ +} +/* .table-header td{border: 1pt solid #c0c0c0;} + .table-header th{border: 1pt solid #c0c0c0;} + .tabledata .table-header th{border: 1pt solid #c0c0c0;}*/ + +input, select, textarea { +/* padding: 0px; */ + font-size: 10px; + font-family: Arial, Helvetica, sans-serif; + margin: 1px 1px 1px 1px +} + +/* uncomment for themeing of dropdown-menus, fields and buttons */ +/*input { + color: #3F5F5E; + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; + font-weight: bold; + background-color: #F7FAFF; + margin: 2px 2px 2px 2px +} +select { + color: #3F5F5E; + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; + background-color: #F7FAFF; +}; +textarea { + background-color: #F7FAFF; + color: #3F5F5E; + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; +};*/ + +.table-header { + background: url(../images/ampache-light-bg.gif) #F7FAFF repeat-x; + vertical-align: top; +} + .header1 + { + color: #666666; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: 900; + } + .header2 + { + color: #666666; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: 900; + } + .headrow + { + background:#cccccc; + font-size: 10px; + } + .odd + { + background:#ffffff; + font-size: 10px; + } + .even + { + background:#F7FAFF; + font-size: 10px; + } +.blank { + background: #fff; +} +.border { + background:#666666; +} +.header { + font-size: 10px; +} +.error { + color: #CAD0D5; +} +.fatalerror { + padding-top: 3px; + padding-left: 3px; + padding-right: 3px; + display: table-cell; + padding-bottom: 3px; + color: #D5625E; + border-right:4px solid #CAD0D5; + border-bottom:4px solid #CAD0D5; + border-left:4px solid #CAD0D5; + border-top:4px solid #CAD0D5; +} +.disabled { + text-decoration: line-through; +} +.smallbutton { + border:0px; + padding-left:1px; + padding-right:1px; + font-size: 11px; + cursor: pointer; +} + +/* General style rules */ +body{ + padding-top: 0px; + margin-top: 0px; + margin-left: 0px; + margin-right: 0px; + background-color:#ffffff; + font-family:Arial, Helvetica, Sans-Serif; + color: #666666; +} + +#maincontainer{ + margin: 0px; +} + +.alphabet { + margin: 2px; + font-size: 10px; + font-weight: normal; +} + +/* Content block */ +#content { + postion:absolute; + float: left; + clear: both; + margin-left:135px; + float:left; /* use for horizontal menu; comment out otherwise */ + /* background:#fff url("../images/bg_content.gif") repeat-y right top; */ +} + +h3#content_title{ + font-family:Arial,Helvetica,Sans-Serif; + font-size:12px; + line-height:32px; + color:#fff; + margin:0px; + padding:1px; + background:#c0c0c0;/* url("../images/content_corner.gif") no-repeat right top;*/ +} + +h3#content_title span { + text-align:left; +} + +/* Styles for Header */ +div#Header{ + height:80px; + margin-bottom:3px; + padding:1px; +} + +#Header h1 { + background: transparent url("../images/bg_login_0.jpg") no-repeat top left; + border:0px; + width: 439px; + height: 84px; + float: left; + margin:0px; + padding:1px; +} + +#Header h1 span { + display:none +} + +#Header h2 { + background: transparent url(..images/blank-pixel.gif) no-repeat top left; /* url(001/h2.gif) no-repeat top left; */ + margin-top: 75px; + width: 200px; + height: 18px; + float: right; +} + +#Header h2 span { + font-size:10px; + margin-left:10px; +} + +/* Sidebar */ +/** + * Experimental for menus (Thx Sigger) + * TO DO: Fill in 1px border around menus & submenu items + * Make padding apply to the li, not just an a. Moving padding: to li throws off the dropdown menu alignment. + */ + +#sidebar{ + clear:both; + position:absolute; + left:5px; + top:87px; +} + +#sidebar select { + width: 95%; +} + +#sidebar h3 { + border:0; + width: 120px; + height: 28px; + margin:0; + padding:0; + background: transparent; /*url(../images/sidebar_top.jpg) no-repeat left;*/ +} + +#sidebar h3 span { + display:none +} + +#sidebar ul { + list-style: none; + font-family:Arial, Helvetica, Sans-Serif; + font-size: 10px; + margin: 0; + padding: 0; + line-height: 1em; +} + +#sidebar ul.subnavside { + display: none; + position: absolute; + width: 9em; + top: -1px; + left: 11.5em; + font-size: 1em; + z-index: 100; +} + +#sidebar li { + float: left; + clear: both; + display: inline; /* IE6 Patch */ + position: relative; + width: 12em; + width: /**/8.5em; /* Only IE5.5 can't see this */ /* top menu entries width */ + height: 12px; + margin: 0; + padding: .5em 0 .5em 1em; + border-bottom: 1px solid #c0c0c0; /* #8B8B8B;*/ + border-left: 1px solid #c0c0c0; + border-right: 4px solid #c0c0c0; /*#B4B4B4;*/ + border-top: 1px solid #c0c0c0; + background:#ffffff; +} + +#sidebar ul.subnavside li { + border-right: 1px solid #c0c0c0; /*#B4B4B4;*/ +} + +#sidebar a, #sidebar .navbutton { + display: block; + position: relative; + text-decoration: none; +} + +#sidebar li:hover ul.subnavside, #sidebar li.sfhover ul.subnavside { + display:block; +} + +#sidebar li:hover, #sidebar li.sfhover, #sidebar li.activetopmenu { + color:#000; + background-color:#EEF7FF; +} + +#sidebar li.hover:active { + background-color:#EEF7FF; +/* z-index:30; */ +} + +#play_type_switch { + position: relative; + top: -4px; +} + +/* For horizontal menu */ +.horizontal_menu #content {margin:0em 0 0 2em;} +.horizontal_menu #sidebar { width: auto; top: 50px;} +.horizontal_menu #sidebar h3 { display: none; } +.horizontal_menu #sidebar li { clear: none; border:1px solid #c0c0c0} /*#8b8b8b;*/ +.horizontal_menu #sidebar ul.subnavside { left: 0; top: 2em; } + + +/* Styles for Now Playing */ + +#np_container1{ + width: 260px; + height: 18px; + padding: 0px; + margin: 0px; + background: #fff; /*url("../images/tb_tab.jpg") no-repeat top left;*/ +} + +#np_container1 h1{ + font-size: 10px; + font-weight: bold; + padding: 2px; +} + +#np_container2{ + border-width: 1px 1px 1px 1px; + border-style: solid; + border-color:#ddd #999 #999 #ccc; + padding: 6px; + font-family: Arial, sans-serif; + font-size: 10px; + line-height: 12px; + color: #000; + background: #ffffff;/* url("../images/bg_row.jpg") repeat top left;*/ +} + + +/* Styles for Login template */ +#container{ + margin:100px auto 0px auto; + width:341px; + font-size: 10px; + text-align:center; +} +#container h1{ + background:url("../images/bg_login_0.jpg") no-repeat; + height:81px; + margin-bottom:8px; +} +#container h1 span{ + display:none; +} +#container div{ + background:url("../images/bg_login_1.jpg") no-repeat; + height:192px; +} +#loginp_0{ + color:#333; + margin-top:0px; + padding-top:40px; +} +.loginp_1{ + text-align:right; + padding-right:100px; +} +.loginp_1 span{ + font-weight:bold; +} +.loginp_1 input{ + border:1px solid #999; +} +input.text_input { +width:12em; +} +.loginp_1 input.check_input { +margin-right:5em; +} +/* Footer */ +#footer { + margin-left: 150px; + margin-bottom: 10px; +} + +#footer p { + color:#999999; + font-size:10px; + font-weight: bold; +} +#topbar { + height: 80px; + padding-top:3px; + padding-left:10px; +} +#topbarright { + float: right; + font-size: 10px; + + position: relative; + z-index: 100; + top: 15px; + right: 40px; + border: 0; +} +#topbarleft, #topbarleft a{ + float: left; +} + +/* Box Related Styles */ +.box { + padding:5px; + background: #EEF7FF; + margin:10px; + border: 1px solid #c0c0c0; +} +.box-title { + border-bottom: solid 1px #ffffff; + font-weight: bold; +} +.box-left-top { display:none; } +.box-left-bottom { display:none; } +.box-left { display:none; } +.box-bottom { display:none; } +.box-right-bottom { display:none; } +.box-right-top { display:none; } +.box-right { display:none; } +.box-top { display:none; } + +.confirmation-box { + padding-left:5px; + padding-top:5px; + padding-right:5px; + margin-bottom:10px; + display: table-cell; + background-color: #ffffff; + border-right:2px solid #666666; + border-bottom:2px solid #666666; + border-left:2px solid #666666; + border-top:2px solid #666666;} + +.text-action, .text-action li { + margin-top:5px; + list-style: none; + margin-bottom:5px; + padding-left:0px; +} +.text-action a, .text-action span { + background: #F7FAFF; + border:1px solid #c0c0c0; + padding-left:2px; + padding-right:2px; + text-decoration: bold; +} +.text-action #pt_active { + background: #666666; + color: #ffffff; + border:1px solid #F7FAFF; +} +#nowplaying { + width:650px; + background: #EEF7FF; +} +.np_row { + padding-top: 3px; + padding-bottom: 3px; +} +.np_cell { + margin: 10px; + border-bottom:1px dotted silver; + border-top:1px dotted silver; +} + +/* for rating-patch by blueorder, needs a modified */ +.np_cell_1 { /*username and rating*/ + width: 120px; + padding: 0; + text-align:left; + border-bottom:1px dotted silver; + border-top:1px dotted silver; +} +/*.np_cell_2 { + width: 125px; + padding: 0; + text-align:center; +} +.np_cell_2 ul { + margin-left: auto; + margin-right: auto; +}*/ +.np_cell_3 { /*artist and album name*/ + width: 150px; + padding: 2; + text-align:right; + border-bottom:1px dotted silver; + border-top:1px dotted silver; +} +.np_cell_3 ul { + margin-left: auto; + margin-right: auto; + border-bottom:1px dotted silver; + border-top:1px dotted silver; +} +.np_cell_4 { /*album image*/ + width: 75px; + padding: 0; + text-align:center; + border-bottom:1px dotted silver; + border-top:1px dotted silver; +} +/*/rating-patch*/ + +#tablist { + padding: 3px 0; + margin: 10px 0 0 0; + font: bold 10px Arial, sans-serif; +} + +#tablist li { + list-style: none; + margin: 0; + display: inline; +} + +#tablist li a { + padding: 3px 0.5em; + margin-left: 3px; + border: 1px solid #cccccc; + border-bottom: none; + background: #F7FAFF; + text-decoration: none; +} + +#tablist li a:link { color: #222222; } +#tablist li a:visited { color: #666666; } + +#tablist li a:hover { + color: #666666; + background: #ffffff; + border-color: #666666; +} + +#tablist li a#current { + color: #666666; + background: #ffffff; + border-color: #666666; + border-bottom: 1px solid #666666; +} + +#tv_left { + float: left; + clear: left; +} +#tv_np { + float: right; +} + + +.star-rating{ + list-style:none; + margin: 0px; + padding:0px; + width: 80px; + height: 15px; + position: relative; + background: url(../images/ratings/star_rating.gif) top left repeat-x; +/* background: url(../../../images/ratings/star_rating.gif) top left repeat-x; */ +} +.star-rating li{ + padding:0px; + margin:0px; + float: right; +} +.star-rating li span{ + display:block; + width:16px; + height: 15px; + text-decoration: none; + text-indent: -9000px; + z-index: 20; + position: absolute; + padding: 0px; +} +.star-rating li span:hover{ + background: url(../images/ratings/star_rating.gif) left center; +/* background: url(../../../images/ratings/star_rating.gif) left center; */ + z-index: 2; + left: 0px; +} +li.zero-stars span:hover { + background: url(../images/ratings/x.gif); +/* background: url(../../../images/ratings/x.gif); */ + height: 15px; + left: 80px; + display: block; +} +span.zero-stars { + background: url(../images/ratings/x_off.gif); +/* background: url(../../../images/ratings/x_off.gif); */ + height: 15px; + left: 80px; + display: block; +} +span.one-stars{ + left: 0px; +} +span.one-stars:hover{ + width:16px; +} +span.two-stars{ + left:16px; +} +span.two-stars:hover{ + width: 32px; +} +span.three-stars{ + left: 32px; +} +span.three-stars:hover{ + width: 48px; +} +span.four-stars{ + left: 48px; +} +span.four-stars:hover{ + width: 64px; +} +span.five-stars{ + left: 64px; +} +span.five-stars:hover{ + width: 80px; +} +li.current-rating{ + background: url(../images/ratings/star_rating.gif) left bottom; +/* background: url(../../../images/ratings/star_rating.gif) left bottom; */ + position: absolute; + height: 15px; + display: block; + text-indent: -9000px; + z-index: 1; +} + +/* .localplaycontrol { */ +/* text-align: center; */ +/* left: 2px; */ +/* float: left; */ +/* } */ +.lp_box_ctrl { + padding-top: 5px; + padding-left: 5px; +} +.lp_box_vol { + padding-left: 7px; +} +.localplaycontrol{ + position: absolute; +/* clear: both; */ + top: 75px; + z-index: 100; + left: 4px; +} diff --git a/contrib/themes/Cleandy/theme.cfg.php b/contrib/themes/Cleandy/theme.cfg.php new file mode 100644 index 00000000..dfdd7490 --- /dev/null +++ b/contrib/themes/Cleandy/theme.cfg.php @@ -0,0 +1,42 @@ +################## +#<?php exit(); ?># +################## + +########################### +# Cleandy Ampache Theme +########################### + +# Theme Name +# This is the actual name of the theme that +# will be displayed in the preferences screen +# DEFAULT: ampache-theme +name = "Cleandy" + +# Theme Author +# This is just a way of giving credit to the +# person who actually created this theme +# DEFAULT: N/A +author = "Nikolai Försterling" + +# Theme Maintainer +# This is just a way of listing who is responsible for +# maintaining this theme incase it's not working right +# please include an e-mail address so you can be contacted +# DEFAULT: N/A +maintainer = "nospam.foster -at- web -dot- de " + +# Version +# This is the version of the Theme (usefull if you've updated it) +version = "0.4" + +# Orientation +# This was added as of 3.3.2-Alpha4, this tells Ampache if this theme +# uses vertical or horizontal orientation of the menu, if this is a horizontal +# theme then it will not show the quick search and quick random play forms +orientation = "horizontal" + +# Submenu +# If this is set to simple the sub menu's will only be shown when you're on one of the +# respective pages. If you want to make the menu's something like the classic theme +# comment this out +# submenu = "simple" |