summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-12-31 09:04:30 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-12-31 09:04:30 +0000
commit621f007155dc1e3a8a5b916e246018df4a25d4f3 (patch)
treec3f987cc3d43d8fdfac0680fd23cd3695fbac30a
parentfe4774127f292ce94ab79771bc72cbb7ca4db371 (diff)
downloadampache-621f007155dc1e3a8a5b916e246018df4a25d4f3.tar.gz
ampache-621f007155dc1e3a8a5b916e246018df4a25d4f3.tar.bz2
ampache-621f007155dc1e3a8a5b916e246018df4a25d4f3.zip
add album art pop-up mojo from Di-Fosfor
-rw-r--r--albumart.php40
-rw-r--r--bin/print_tags.php.inc1
-rwxr-xr-xdocs/CHANGELOG6
-rw-r--r--lib/general.js8
-rw-r--r--templates/show_album.inc2
-rw-r--r--templates/show_big_art.inc41
-rw-r--r--templates/show_now_playing.inc2
7 files changed, 78 insertions, 22 deletions
diff --git a/albumart.php b/albumart.php
index 7e97426a..d7cfbfd4 100644
--- a/albumart.php
+++ b/albumart.php
@@ -29,7 +29,6 @@ and dumps it to the browser as an image mime type.
require('modules/init.php');
-
$album = new Album($_REQUEST['id']);
// Check db first
@@ -40,6 +39,10 @@ if (isset($r->art)) {
$mime = $r->art_mime;
$found = 1;
}
+else {
+ header('Content-type: image/gif');
+ readfile(conf('prefix') . conf('theme_path') . "/images/blankalbum.gif");
+} // else no image
/* Decide what size this image is */
switch ($_REQUEST['thumb']) {
@@ -57,23 +60,22 @@ switch ($_REQUEST['thumb']) {
break;
}
-if (!$found) {
- // Print a transparent gif instead
- header('Content-type: image/gif');
- readfile(conf('prefix') . conf('theme_path') . "/images/blankalbum.gif");
-}
-else {
- // Print the album art
- $extension = substr($mime,strlen($mime)-3,3);
- header("Content-type: $mime");
- header("Content-Disposition: filename=" . $album->name . "." . $extension);
-
- if (!$_REQUEST['thumb']) {
- echo $art;
- }
- elseif (!img_resize($art,$size,$extension)) {
- echo $art;
- }
-}
+switch ($_REQUEST['type']) {
+ case 'popup':
+ show_template('show_big_art');
+ break;
+ default:
+ // Print the album art
+ $extension = substr($mime,strlen($mime)-3,3);
+ header("Content-type: $mime");
+ header("Content-Disposition: filename=" . $album->name . "." . $extension);
+ if (!$_REQUEST['thumb']) {
+ echo $art;
+ }
+ elseif (!img_resize($art,$size,$extension)) {
+ echo $art;
+ }
+ break;
+} // end switch type
?>
diff --git a/bin/print_tags.php.inc b/bin/print_tags.php.inc
index d266a000..4c9adf66 100644
--- a/bin/print_tags.php.inc
+++ b/bin/print_tags.php.inc
@@ -19,7 +19,6 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
$no_session = '1';
require ("../modules/init.php");
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 6e70debd..a866f5c5 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,12 @@
--------------------------------------------------------------------------
v.3.3.2-Beta1
+ - Added Popup Album Art (Thx Di-Fosfor)
+ - Fixed Typo in Amazon Search debug statement
+ - Added sort_files.php.inc to /bin
+ - Fixed Ratings designation mistake and added it to artist view
+ - Fixed location detection for contextual titls and browse
+ on the simple menu's (Thx SoundOfEmotion)
- Fixed a botched change to the database (No Data loss!) but I
still feel stupid (Blame Vollmer)
- Fixed a problem where .flac files wouldn't get reconized by
diff --git a/lib/general.js b/lib/general.js
index f4ac76fb..7ad30a02 100644
--- a/lib/general.js
+++ b/lib/general.js
@@ -86,3 +86,11 @@ function selectField(element)
return "Select All";
}
}
+
+
+function popup_art(url) {
+ var newwindow;
+ newwindow=window.open(url, "ampache_art", "menubar=no,toolbar=no,location=no,directories=no");
+ if (window.focus) {newwindow.focus()}
+}
+
diff --git a/templates/show_album.inc b/templates/show_album.inc
index 6a466aab..bd6cbcf8 100644
--- a/templates/show_album.inc
+++ b/templates/show_album.inc
@@ -49,7 +49,7 @@ $username=$user->username;
<td width="140" align="center">
<?php
if ($album_name != "Unknown (Orphaned)") {
- echo "<a target=\"_blank\" href=\"" . conf('web_path') . "/albumart.php?id=" . $album->id . "\">";
+ echo "<a target=\"_blank\" href=\"" . conf('web_path') . "/albumart.php?id=" . $album->id . "&amp;type=popup\">";
echo "<img border=\"0\" src=\"" . conf('web_path') . "/albumart.php?id=" . $album->id . "&amp;thumb=2\" alt=\"Album Art\" height=\"128\" />";
echo "</a>\n";
}
diff --git a/templates/show_big_art.inc b/templates/show_big_art.inc
new file mode 100644
index 00000000..7c52f4e3
--- /dev/null
+++ b/templates/show_big_art.inc
@@ -0,0 +1,41 @@
+<?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.
+
+*/
+
+$htmllang = str_replace("_","-",conf('lang'));
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo $htmllang; ?>">
+<head>
+<link rel="shortcut icon" href="<?php echo conf('web_path'); ?>/favicon.ico" />
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo conf('site_charset'); ?>" />
+<title><?php echo conf('site_title'); ?> - <?php echo _("Album Art"); ?></title>
+</head>
+<body onLoad="self.resizeTo(document.images[0].width+30, document.images[0].height+70)">
+<?php
+echo "<a href=\"javascript:window.close()\" title=\"" . _("Click to close window") . "\">";
+echo "<img src=\"" . conf('web_path') . "/albumart.php?id=" . $_GET['id'] . "\" border=\"0\" />";
+echo "</a>";
+?>
+</body>
+</html>
+
diff --git a/templates/show_now_playing.inc b/templates/show_now_playing.inc
index d4df9dc2..22422388 100644
--- a/templates/show_now_playing.inc
+++ b/templates/show_now_playing.inc
@@ -61,7 +61,7 @@
echo "\t<a title=\"" . htmlspecialchars($album) . "\" href=\"$web_path/albums.php?action=show&amp;album=$song->album\">$song->f_album</a></td>";
if (conf('play_album_art')) {
echo "\t<td align=\"center\">";
- echo "<a target=\"_blank\" href=\"" . conf('web_path') . "/albumart.php?id=" . $song->album . "\">";
+ echo "<a target=\"_blank\" href=\"" . conf('web_path') . "/albumart.php?id=" . $song->album . "&amp;type=popup\">";
echo "<img align=\"middle\" border=\"0\" src=\"" . conf('web_path') . "/albumart.php?id=" . $song->album . "&amp;fast=1&amp;thumb=1\" alt=\"Album Art\" height=\"75\" />";
echo "</a>\n";
echo "\t</td>\n";