diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-09-30 04:15:11 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-09-30 04:15:11 +0000 |
commit | edcf34c986d14fb6583eb29958bf88140cd97b5b (patch) | |
tree | dde8c48e1ca303426a87459057913fc030b66869 | |
parent | 6b7284fab7f49f54f4d72db6c690bbea7f7b7af7 (diff) | |
download | ampache-edcf34c986d14fb6583eb29958bf88140cd97b5b.tar.gz ampache-edcf34c986d14fb6583eb29958bf88140cd97b5b.tar.bz2 ampache-edcf34c986d14fb6583eb29958bf88140cd97b5b.zip |
fixed up xmlrpc hopefully (needs testing) and fixed duplicates, cleaned up burgundy a little more
-rw-r--r-- | admin/catalog.php | 9 | ||||
-rw-r--r-- | admin/duplicates.php | 5 | ||||
-rw-r--r-- | admin/users.php | 7 | ||||
-rw-r--r-- | config/ampache.cfg.php.dist | 4 | ||||
-rwxr-xr-x | docs/CHANGELOG | 3 | ||||
-rw-r--r-- | lib/class/catalog.class.php | 18 | ||||
-rw-r--r-- | lib/duplicates.php | 99 | ||||
-rw-r--r-- | templates/show_duplicates.inc.php | 61 | ||||
-rw-r--r-- | templates/show_list_duplicates.inc.php (renamed from templates/list_duplicates.inc) | 2 | ||||
-rw-r--r-- | themes/burgundy/templates/default.css | 147 |
10 files changed, 142 insertions, 213 deletions
diff --git a/admin/catalog.php b/admin/catalog.php index cc57bd3f..19ef1d3b 100644 --- a/admin/catalog.php +++ b/admin/catalog.php @@ -147,18 +147,15 @@ switch ($_REQUEST['action']) { $song = $_REQUEST['song']; - echo "<div class=\"confirmation-box\">"; if (count($song)) { $catalog->remove_songs($song); - echo "<p align=\"center\">Songs Removed... </p>"; + $body = _('Songs Removed'); } else { - echo "<p align=\"center\">No Songs Removed... </p>"; + $body = _('No Songs Removed'); } - echo "</div><br />\n"; $url = conf('web_path') . '/admin/index.php'; $title = _('Disabled Songs Processed'); - $body = ''; show_confirmation($title,$body,$url); break; case 'clean_all_catalogs': @@ -265,7 +262,7 @@ switch ($_REQUEST['action']) { require (conf('prefix') . '/templates/show_disabled_songs.inc'); } else { - echo "<div class=\"error\" align=\"center\">No Disabled songs found</div>"; + echo "<div class=\"error\" align=\"center\">" . _('No Disabled songs found') . "</div>"; } break; case 'show_delete_catalog': diff --git a/admin/duplicates.php b/admin/duplicates.php index 3dede7e4..660a7162 100644 --- a/admin/duplicates.php +++ b/admin/duplicates.php @@ -36,8 +36,8 @@ $search_type = scrub_in($_REQUEST['search_type']); show_template('header'); -switch ($action) -{ +/* Switch on Action */ +switch ($action) { case 'search': $flags = get_duplicate_songs($search_type); show_duplicate_songs($flags,$search_type); @@ -45,5 +45,6 @@ switch ($action) default: show_duplicate_searchbox($search_type); } + show_footer(); ?> diff --git a/admin/users.php b/admin/users.php index 6e164b53..31d4ba37 100644 --- a/admin/users.php +++ b/admin/users.php @@ -141,11 +141,10 @@ switch ($action) { break; case 'delete': if (conf('demo_mode')) { break; } - show_confirm_action(_("Are you sure you want to permanently delete") . " $temp_user->fullname ($temp_user->username) ?", - "admin/users.php", - "action=confirm_delete&user=$temp_user->username"); + show_confirmation(_('Deletion Request'), + _("Are you sure you want to permanently delete") . " $temp_user->fullname ($temp_user->username) ?", + "admin/users.php?action=confirm_delete&user=$temp_user->id"); break; - case 'confirm_delete': if (conf('demo_mode')) { break; } if ($_REQUEST['confirm'] == _("No")) { show_manage_users(); break; } diff --git a/config/ampache.cfg.php.dist b/config/ampache.cfg.php.dist index 6678c965..16eeb4cd 100644 --- a/config/ampache.cfg.php.dist +++ b/config/ampache.cfg.php.dist @@ -67,10 +67,6 @@ sess_cookiesecure = 0 # Program Settings # ###################### -# Nuff Said -# DEFAULT: Ampache :: For The Love of Music -site_title = "Ampache :: For The Love Of Music" - # Use Access List # Toggle this on if you want ampache to pay attention to the access list # and only allow streaming/downloading/xml-rpc from known hosts by default diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 6fdfd26b..2cc735ff 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,9 @@ -------------------------------------------------------------------------- v.3.3.2 + - Fixed Duplicate Songs functions that have been broken for a + while + - Fixed some Install issues with incorrectly named templates - Added check for MySQL support to first install page, redirects to /test.php if mysql support is non-existant - Added ability to turn Random/Repeat on and off in localplay diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 55d45717..56afe800 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -1032,7 +1032,11 @@ class Catalog { $client = new xmlrpc_client("/$path/server/xmlrpc.server.php", $server, 80); } - $f = new xmlrpcmsg('remote_catalog_query', array(new xmlrpcval( conf('web_path'), "string")) ); + /* encode the variables we need to send over */ + $encoded_key = new xmlrpcval($this->key,"string"); + $encoded_path = new xmlrpcval(conf('web_path'),"string"); + + $f = new xmlrpcmsg('remote_catalog_query', array($encoded_key,$encoded_path)); if (conf('debug')) { $client->setDebug(1); } @@ -1070,7 +1074,7 @@ class Catalog { $this->get_remote_song($client,$start,$step); } - echo "<p>" . _("Completed updating remote catalog(s)") . ".</p><hr />\n"; + echo "<p>" . _('Completed updating remote catalog(s)') . ".</p><hr />\n"; flush(); return true; @@ -1087,7 +1091,11 @@ class Catalog { */ function get_remote_song($client,$start,$end) { - $query_array = array(new xmlrpcval($start, "int"),new xmlrpcval($end,"int")); + $encoded_start = new xmlrpcval($start,"int"); + $encoded_end = new xmlrpcval($end,"int"); + $encoded_key = new xmlrpcval($this->key,"string"); + + $query_array = array($encoded_key,$encoded_start,$encoded_end); $f = new xmlrpcmsg('remote_song_query',$query_array); /* Depending upon the size of the target catalog this can be a very slow/long process */ @@ -1101,11 +1109,11 @@ class Catalog { $data = php_xmlrpc_decode($value); $this->update_remote_catalog($data,$this->path); $total = $start + $end; - echo "Added $total...<br />"; + echo _('Added') . " $total...<br />"; flush(); } else { - $error_msg = _("Error connecting to") . " " . $server . " " . _("Code") . ": " . $response->faultCode() . " " . _("Reason") . ": " . $response->faultString(); + $error_msg = _('Error connecting to') . " " . $server . " " . _("Code") . ": " . $response->faultCode() . " " . _("Reason") . ": " . $response->faultString(); debug_event('xmlrpc-client',$error_msg,'1','ampache-catalog'); echo "<p class=\"error\">$error_msg</p>"; } diff --git a/lib/duplicates.php b/lib/duplicates.php index 3fe56ed1..71b786f0 100644 --- a/lib/duplicates.php +++ b/lib/duplicates.php @@ -22,19 +22,14 @@ /*! - @header Contains the functions for handling duplicate songs -*/ - - -/*! @function get_duplicate_songs @discussion */ function get_duplicate_songs($search_type) { - $sql = "SELECT song.id as song,artist.name,album.name,title,count(title) as ctitle". - " FROM song,artist,album ". - " WHERE song.artist=artist.id AND song.album=album.id AND song.title<>'' ". - " GROUP BY title"; + $sql = "SELECT song.id as song,artist.name,album.name,title,count(title) as ctitle". + " FROM song,artist,album ". + " WHERE song.artist=artist.id AND song.album=album.id AND song.title<>'' ". + " GROUP BY title"; if ($search_type=="artist_title"||$search_type=="artist_album_title") $sql = $sql.",artist"; if ($search_type=="artist_album_title") @@ -42,14 +37,16 @@ function get_duplicate_songs($search_type) { $sql = $sql." HAVING count(title) > 1"; $sql = $sql." ORDER BY ctitle"; - $result = mysql_query($sql, dbh()); + $result = mysql_query($sql, dbh()); + + $arr = array(); - $arr = array(); + while ($flag = mysql_fetch_array($result)) { + $arr[] = $flag; + } // end while + + return $arr; - while ($flag = mysql_fetch_array($result)) { - $arr[] = $flag; - } // end while - return $arr; } // get_duplicate_songs /*! @@ -57,25 +54,28 @@ function get_duplicate_songs($search_type) { @discussion */ function get_duplicate_info($song,$search_type) { - $artist = get_artist_name($song->artist); - $sql = "SELECT song.id as songid,song.title as song,file,bitrate,size,time,album.name AS album,album.id as albumid, artist.name AS artist,artist.id as artistid". - " FROM song,artist,album ". - " WHERE song.artist=artist.id AND song.album=album.id ". - " AND song.title= '".str_replace("'","''",$song->title)."'"; + $artist = $song->get_artist_name(); + $sql = "SELECT song.id as songid,song.title as song,file,bitrate,size,time,album.name AS album,album.id as albumid, artist.name AS artist,artist.id as artistid". + " FROM song,artist,album ". + " WHERE song.artist=artist.id AND song.album=album.id ". + " AND song.title= '".str_replace("'","''",$song->title)."'"; - if ($search_type=="artist_title"||$search_type=="artist_album_title") + if ($search_type == "artist_title" || $search_type == "artist_album_title") { $sql = $sql." AND artist.id = '".$song->artist."'"; - if ($search_type=="artist_album_title") + } + if ($search_type == "artist_album_title" ) { $sql = $sql." AND album.id = '".$song->album."'"; + } + + $result = mysql_query($sql, dbh()); - $result = mysql_query($sql, dbh()); + $arr = array(); - $arr = array(); + while ($flag = mysql_fetch_array($result)) { + $arr[] = $flag; + } // end while - while ($flag = mysql_fetch_array($result)) { - $arr[] = $flag; - } // end while - return $arr; + return $arr; } // get_duplicate_info @@ -84,7 +84,7 @@ function get_duplicate_info($song,$search_type) { @discussion */ function show_duplicate_songs($flags,$search_type) { - require_once(conf('prefix').'/templates/list_duplicates.inc'); + require_once(conf('prefix').'/templates/show_list_duplicates.inc.php'); } // show_duplicate_songs /*! @@ -92,45 +92,6 @@ function show_duplicate_songs($flags,$search_type) { @discussion */ function show_duplicate_searchbox($search_type) { -// OMFG KillingVollmer++ needs to be fixed in a desperate way -?> -<?php show_box_top(_('Find Duplicates')); ?> -<form name="songs" action="<?php echo conf('web_path'); ?>/admin/duplicates.php" method="post" enctype="multipart/form-data" > -<table cellspacing="0" cellpadding="3" border="0" width="450"> - <tr> - <td valign="top"><?php echo _('Search Type'); ?>:</td> - <td> - <?php - - if ($search_type=="title") - $checked = "checked=\"checked\""; - else - $checked = ""; - echo "<input type=\"radio\" name=\"search_type\" value=\"title\" ".$checked." />" . _("Title") . "<br />"; - - if ($search_type=="artist_title") - $checked = "checked=\"checked\""; - else - $checked = ""; - echo "<input type=\"radio\" name=\"search_type\" value=\"artist_title\" ".$checked." />" . _("Artist and Title") . "<br />"; - if ($search_type=="artist_album_title"OR $search_type=="") - $checked = "checked=\"checked\""; - else - $checked = ""; - echo "<input type=\"radio\" name=\"search_type\" value=\"artist_album_title\"".$checked." />" . _("Artist, Album and Title") . "<br />"; - ?> - </td> - </tr> - <tr> - <td></td> - <td> - <input type="hidden" name="action" value="search" /> - <input type="submit" value="<?php echo _('Search'); ?>" /> - </td> - </tr> -</table> -</form> -<?php show_box_bottom(); ?> -<?php + require_once(conf('prefix') . '/templates/show_duplicates.inc.php'); } // show_duplicate_searchbox ?> diff --git a/templates/show_duplicates.inc.php b/templates/show_duplicates.inc.php new file mode 100644 index 00000000..3dd839f8 --- /dev/null +++ b/templates/show_duplicates.inc.php @@ -0,0 +1,61 @@ +<?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. + +*/ + +$web_path = conf('web_path'); +?> +<?php show_box_top(_('Find Duplicates')); ?> +<form name="songs" action="<?php echo conf('web_path'); ?>/admin/duplicates.php" method="post" enctype="multipart/form-data" > +<table cellspacing="0" cellpadding="3" border="0" width="450"> + <tr> + <td valign="top"><?php echo _('Search Type'); ?>:</td> + <td> + <?php + + if ($search_type=="title") + $checked = "checked=\"checked\""; + else + $checked = ""; + echo "<input type=\"radio\" name=\"search_type\" value=\"title\" ".$checked." />" . _("Title") . "<br />"; + + if ($search_type=="artist_title") + $checked = "checked=\"checked\""; + else + $checked = ""; + echo "<input type=\"radio\" name=\"search_type\" value=\"artist_title\" ".$checked." />" . _("Artist and Title") . "<br />"; + if ($search_type=="artist_album_title"OR $search_type=="") + $checked = "checked=\"checked\""; + else + $checked = ""; + echo "<input type=\"radio\" name=\"search_type\" value=\"artist_album_title\"".$checked." />" . _("Artist, Album and Title") . "<br />"; + ?> + </td> + </tr> + <tr> + <td></td> + <td> + <input type="hidden" name="action" value="search" /> + <input type="submit" value="<?php echo _('Search'); ?>" /> + </td> + </tr> +</table> +</form> +<?php show_box_bottom(); ?> diff --git a/templates/list_duplicates.inc b/templates/show_list_duplicates.inc.php index 54617c92..b2f39393 100644 --- a/templates/list_duplicates.inc +++ b/templates/show_list_duplicates.inc.php @@ -26,7 +26,7 @@ $web_path = conf('web_path'); show_duplicate_searchbox($search_type); if ($flags) { ?> <?php show_box_top(_('Duplicate Songs')); ?> - <form method="post" enctype="multipart/form-data" action="<?php echo $web_path . "/admin/song.php?action=disable"; ?>"> + <form method="post" enctype="multipart/form-data" action="<?php echo $web_path; ?>/admin/flag.php?action=disable"> <table class="tabledata" cellspacing="0" cellpadding="0" > <tr class="table-header"> <td><?php echo _('Disable'); ?></td> diff --git a/themes/burgundy/templates/default.css b/themes/burgundy/templates/default.css index dc9aa417..bb3ec508 100644 --- a/themes/burgundy/templates/default.css +++ b/themes/burgundy/templates/default.css @@ -57,10 +57,6 @@ a:active { } .display {} -#mpdpl td { - padding: 0px 2px 0px 2px; - text-align: left; -} table.tabledata {} td { padding: 0px 8px 0px 8px; @@ -184,10 +180,9 @@ body{ /* Content block */ #content { - top:90px; + postion:absolute; float: left; clear: both; - margin-top:-10px; margin-left:15px; /*float:left; use for horizontal menu; comment out otherwise */ /* background:#fff url("../themes/classic/images/bg_content.gif") repeat-y right top; */ @@ -253,7 +248,7 @@ div#sidebar{ clear:both; position:absolute; left:5px; - top:55px; + top:20px; background:url("../themes/classic/images/bg_navigation.gif") repeat-y left; } @@ -301,7 +296,7 @@ div#sidebar{ #sidebar li:hover, #sidebar li.sfhover { color: #000000; - background-color:#ffffcc; + background-color: #8f0000; } #sidebar li:active { @@ -321,14 +316,16 @@ div#sidebar{ #sidebar li:hover ul, #sidebar li.sfhover ul { left: auto; /* this calls the submenu back when the parent li is hovered. */ + background-color: #8f0000; } -/* Styles for Now Playing */ -#nowplaying{ - clear: all; - width: 625px; +#navlist ul li:hover { + background-color: #8f0000; + } +/* Styles for Now Playing */ + #np_container1{ width: 260px; height: 18px; @@ -418,122 +415,26 @@ margin-right:5em; #topbarleft, #topbarleft a{ float: left; } -/* styles for the star ratings */ -.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; -} -.star-rating li{ - padding:0px; - margin:0px; - float: right; -} -.star-rating li a{ - display:block; - width:16px; - height: 15px; - text-decoration: none; - text-indent: -9000px; - z-index: 20; - position: absolute; - padding: 0px; -} -.star-rating li a:hover{ - background: url(../images/ratings/star_rating.gif) left center; - z-index: 2; - left: 0px; -} -li.zero-stars a:hover { - background: url(../images/ratings/x.gif); - height: 15px; - left: 80px; - display: block; -} -a.zero-stars { - background: url(../images/ratings/x_off.gif); - height: 15px; - left: 80px; - display: block; -} -a.one-stars{ - left: 0px; -} -a.one-stars:hover{ - width:16px; -} -a.two-stars{ - left:16px; -} -a.two-stars:hover{ - width: 32px; -} -a.three-stars{ - left: 32px; -} -a.three-stars:hover{ - width: 48px; -} -a.four-stars{ - left: 48px; -} -a.four-stars:hover{ - width: 64px; -} -a.five-stars{ - left: 64px; -} -a.five-stars:hover{ - width: 80px; -} -li.current-rating{ - background: url(../images/ratings/star_rating.gif) left bottom; - position: absolute; - height: 15px; - display: block; - text-indent: -9000px; - z-index: 1; -} + /* Box Related Styles */ .box { padding:0px; - background: #320000; + background: #8f0000; + margin:10px; } .box-title { - border-bottom: solid 1px; #ffffcc; + border-bottom: solid 1px #320000; font-weight: bold; } -.box-left-top { - background: url(../themes/classic/images/topleft.gif) no-repeat; - height:16px; -} -.box-left-bottom { - background: url(../themes/classic/images/bottomleft.gif) no-repeat; - height:18px; -} -.box-left { - background: url(../themes/classic/images/left.gif); -} -.box-bottom { - background: url(../themes/classic/images/bottom.gif); - height:18px; -} -.box-right-bottom { - background: url(../themes/classic/images/bottomright.gif) no-repeat; -} -.box-right-top { - background: url(../themes/classic/images/topright.gif) no-repeat; -} -.box-right { - background: url(../themes/classic/images/right.gif); -} -.box-top { - background: url(../themes/classic/images/top.gif); -} +.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; @@ -545,6 +446,7 @@ li.current-rating{ border-bottom:2px solid #ffffcc; border-left:2px solid #ffffcc; border-top:2px solid #ffffcc;} + .text-action, .text-action li { margin-top:5px; list-style: none; @@ -564,7 +466,8 @@ li.current-rating{ border:1px solid #9F0000; } #nowplaying { - width:600px; + width:650px; + background: #8f0000; } .np_row { padding-top: 3px; |