diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-01 04:36:07 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-01 04:36:07 +0000 |
commit | 7603e48e9e7f953e67e62143686c1b5228262385 (patch) | |
tree | 36453345f1bf6a1d5237fb1e3771de257de98ce4 | |
parent | 4345f0785c81fbf9b067fa317399c067c674c65b (diff) | |
download | ampache-7603e48e9e7f953e67e62143686c1b5228262385.tar.gz ampache-7603e48e9e7f953e67e62143686c1b5228262385.tar.bz2 ampache-7603e48e9e7f953e67e62143686c1b5228262385.zip |
tweaked the sidebars, think they look a lot better now
-rw-r--r-- | admin/catalog.php | 4 | ||||
-rw-r--r-- | lib/class/catalog.class.php | 59 | ||||
-rw-r--r-- | lib/ui.lib.php | 4 | ||||
-rw-r--r-- | templates/show_verify_catalog.inc.php | 25 | ||||
-rw-r--r-- | templates/sidebar_admin.inc.php | 21 | ||||
-rw-r--r-- | templates/sidebar_browse.inc.php | 13 | ||||
-rw-r--r-- | templates/sidebar_preferences.inc.php | 8 | ||||
-rw-r--r-- | themes/classic/templates/default.css | 75 |
8 files changed, 102 insertions, 107 deletions
diff --git a/admin/catalog.php b/admin/catalog.php index 8428730c..6da5ce87 100644 --- a/admin/catalog.php +++ b/admin/catalog.php @@ -62,7 +62,7 @@ switch ($_REQUEST['action']) { $_REQUEST['catalogs'] = $catalog->get_catalog_ids(); case 'update_catalog': /* If they are in demo mode stop here */ - if (conf('demo_mode')) { break; } + if (Config::get('demo_mode')) { break; } if (isset($_REQUEST['catalogs'])) { foreach ($_REQUEST['catalogs'] as $catalog_id) { @@ -72,7 +72,7 @@ switch ($_REQUEST['action']) { echo "</div>\n"; } } - $url = conf('web_path') . '/admin/index.php'; + $url = Config::get('web_path') . '/admin/index.php'; $title = _('Catalog Updated'); $body = ''; show_confirmation($title,$body,$url); diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 85cd18b8..b8e49855 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -1496,32 +1496,30 @@ class Catalog { } // clean_stats - /*! - @function verify_catalog - @discussion This function compares the DB's information with the ID3 tags - @param $catalog_id The ID of the catalog to compare - */ - function verify_catalog($catalog_id=0,$gather_type='',$verbose=1) { - - /* Create and empty song for us to use */ - $total_updated = 0; - - /* Set it to this if they don't pass anything */ - if (!$catalog_id) { - $catalog_id = $this->id; - } + /** + * verify_catalog + * This function compares the DB's information with the ID3 tags + */ + public static function verify_catalog($catalog_id) { /* First get the filenames for the catalog */ - $sql = "SELECT id FROM song WHERE catalog='$catalog_id' ORDER BY id"; - $db_results = mysql_query($sql, dbh()); - $number = mysql_num_rows($db_results); - - if ($verbose) { - echo _("Updating the") . " <b>[ $this->name ]</b> " . _("Catalog") . "<br />\n"; - echo $number . " " . _("songs found checking tag information.") . "<br />\n\n"; - echo _('Verifed') . ": <span id=\"count_verify_" . $this->id . "\">None</span><br />\n"; - flush(); - } + $sql = "SELECT `id` FROM `song` WHERE `catalog`='$catalog_id'"; + $db_results = Dba::query($sql); + $number = Dba::num_rows($db_results); + + $refresh_limit = 10; + $ajax_url = Config::get('ajax_url') . '?action=catalog&type=add_files'; + /* Can't have the & stuff in the Javascript */ + $ajax_url = str_replace("&","&",$ajax_url); + require_once Config::get('prefix') . '/templates/javascript_refresh.inc.php'; + + show_box_top(); + echo _("Updating the") . " <b>[ $this->name ]</b> " . _("Catalog") . "<br />\n"; + echo $number . " " . _("songs found checking tag information.") . "<br />\n\n"; + require_once Config::get('prefix') . '/templates/show_verify_catalog.inc.php'; + echo "<script type=\"text/javascript\">doLoad();</script>"; + show_box_bottom(); + flush(); /* Magical Fix so we don't run out of time */ set_time_limit(0); @@ -1531,25 +1529,16 @@ class Catalog { * if it's not blank, and different in * in the file then update! */ - while ($results = mysql_fetch_object($db_results)) { + while ($results = Dba::fetch_assoc($db_results)) { /* Create the object from the existing database information */ - $song = new Song($results->id); + $song = new Song($results['id']); debug_event('verify',"Starting work on $song->file",'5','ampache-catalog'); if (is_readable($song->file)) { unset($skip); - /* If they have specified fast_update check the file - filemtime to make sure the file has actually - changed - */ - if ($gather_type == 'fast_update') { - $file_date = filemtime($song->file); - if ($file_date < $this->last_update) { $skip = true; } - } // if gather_type - /* Make sure the song isn't flagged, we don't update flagged stuff */ if ($song->has_flag()) { $skip = true; diff --git a/lib/ui.lib.php b/lib/ui.lib.php index 46642fbe..88cfc3c2 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -154,10 +154,10 @@ function show_alphabet_list () { echo "<div class=\"alphabet\">"; foreach ($list as $l) { $style_name = "style_" . strtolower($l); - echo "<span style=\"width:3px;\" onclick=\"ajaxPut('". Config::get('ajax_url') ."?action=browse&key=alpha_match&value=$l');return true;\">" . + echo "<span class=\"link\" onclick=\"ajaxPut('". Config::get('ajax_url') ."?action=browse&key=alpha_match&value=$l');return true;\">" . $l . "</span>\n"; $i++; - if ($i/11 == intval($i/11)) { echo "<br />"; } + if ($i/5 == intval($i/5)) { echo "<br />"; } } echo "</div>"; diff --git a/templates/show_verify_catalog.inc.php b/templates/show_verify_catalog.inc.php new file mode 100644 index 00000000..08d436ef --- /dev/null +++ b/templates/show_verify_catalog.inc.php @@ -0,0 +1,25 @@ +<?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. + +*/ + +// Get the count of the number of items in their playlist +?> +<?php echo _('Verifed'); ?>:<?php echo $catalog_verify_found; ?><br /> +<?php echo _('Reading'); ?>:<?php echo $catalog_verify_directory; ?><br /> diff --git a/templates/sidebar_admin.inc.php b/templates/sidebar_admin.inc.php index 59ca5b2a..a7e91364 100644 --- a/templates/sidebar_admin.inc.php +++ b/templates/sidebar_admin.inc.php @@ -1,10 +1,23 @@ <h4><?php echo _('Catalogs'); ?></h4> -<a href="<?php echo $web_path; ?>/admin/catalog.php?action=show_add_catalog"><?php echo _('Add a Catalog'); ?></a> +<span><a href="<?php echo $web_path; ?>/admin/catalog.php?action=show_add_catalog"><?php echo _('Add a Catalog'); ?></a></span> +<hr /> +<?php + $catalogs = Catalog::get_catalogs(); + foreach ($catalogs as $catalog_id) { + $catalog = new Catalog($catalog_id); +?> +<strong><a href="<?php echo $web_path; ?>/admin/catalog?action=show_customize_catalog"> + <?php echo $catalog->name; ?> +</a></strong><br /> +<a href="<?php echo $web_path; ?>/admin/catalog.php?action=add_to_catalog&catalogs[]=<?php echo $catalog->id; ?>"><?php echo _('Add'); ?></a> +| <a href="<?php echo $web_path; ?>/admin/catalog.php?action=update_catalog&catalogs[]=<?php echo $catalog->id; ?>"><?php echo _('Verify'); ?></a> +| <a href="<?php echo $web_path; ?>/admin/catalog.php?action=clean_catalog&catalogs[]=<?php echo $catalog->id; ?>"><?php echo _('Clean'); ?></a> +<?php } ?> <hr /> <h4><?php echo _('Other Tools'); ?></h4> -<a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_now_playing"><?php echo _('Clear Now Playing'); ?></a> -<a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_stats"><?php echo _('Clear Catalog Stats'); ?></a> -<a href="<?php echo $web_path; ?>/admin/catalog.php?action=gather_album_art"><?php echo _('Gather Album Art'); ?></a> +<span><a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_now_playing"><?php echo _('Clear Now Playing'); ?></a></span> +<span><a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_stats"><?php echo _('Clear Catalog Stats'); ?></a></span> +<span><a href="<?php echo $web_path; ?>/admin/catalog.php?action=gather_album_art"><?php echo _('Gather Album Art'); ?></a></span> <hr /> diff --git a/templates/sidebar_browse.inc.php b/templates/sidebar_browse.inc.php index dc669c3f..2eb69995 100644 --- a/templates/sidebar_browse.inc.php +++ b/templates/sidebar_browse.inc.php @@ -5,15 +5,10 @@ $text = scrub_in($_REQUEST['action']) . '_ac'; ${$text} = ' selected="selected"'; ?> -<form id="browse_type" name="browse_type" action="<?php echo Config::get('web_path'); ?>/browse.php" method="get"> -<select name="action" onchange="document.getElementById('browse_type').submit();" > - <option value="">-- <?php echo _('Type'); ?> --</option> - <option value="song"<?php echo $song_ac; ?>><?php echo _('Song Title'); ?></option> - <option value="album"<?php echo $album_ac; ?>><?php echo _('Albums'); ?></option> - <option value="artist"<?php echo $artist_ac; ?>><?php echo _('Artist'); ?></option> - <option value="genre"<?php echo $genre_ac; ?>><?php echo _('Genre'); ?></option> -</select> -</form> +<span><a href="<?php $web_path; ?>/browse.php?action=song"><?php echo _('Song Title'); ?></a></span> +<span><a href="<?php $web_path; ?>/browse.php?action=album"><?php echo _('Albums'); ?></a></span> +<span><a href="<?php $web_path; ?>/browse.php?action=artist"><?php echo _('Artist'); ?></a></span> +<span><a href="<?php $web_path; ?>/browse.php?action=genre"><?php echo _('Genre'); ?></a></span> <hr /> <h4><?php echo _('Filters'); ?></h4> <?php show_alphabet_list($_REQUEST['alpha_match'],$_REQUEST['action']); ?> diff --git a/templates/sidebar_preferences.inc.php b/templates/sidebar_preferences.inc.php index c1e6471e..14bb5c67 100644 --- a/templates/sidebar_preferences.inc.php +++ b/templates/sidebar_preferences.inc.php @@ -1,7 +1,7 @@ <h4><?php echo _('Sections'); ?></h4> <hr /> -<a href="<?php echo $web_path; ?>/preferences.php?tab=interface"><?php echo _('Interface'); ?></a> -<a href="<?php echo $web_path; ?>/preferences.php?tab=streaming"><?php echo _('Streaming'); ?></a> -<a href="<?php echo $web_path; ?>/preferences.php?tab=options"><?php echo _('Options'); ?></a> -<a href="<?php echo $web_path; ?>/preferences.php?tab=account"><?php echo _('Account'); ?></a> +<span><a href="<?php echo $web_path; ?>/preferences.php?tab=interface"><?php echo _('Interface'); ?></a></span> +<span><a href="<?php echo $web_path; ?>/preferences.php?tab=streaming"><?php echo _('Streaming'); ?></a></span> +<span><a href="<?php echo $web_path; ?>/preferences.php?tab=options"><?php echo _('Options'); ?></a></span> +<span><a href="<?php echo $web_path; ?>/preferences.php?tab=account"><?php echo _('Account'); ?></a></span> <hr /> diff --git a/themes/classic/templates/default.css b/themes/classic/templates/default.css index 77583fe3..739bd692 100644 --- a/themes/classic/templates/default.css +++ b/themes/classic/templates/default.css @@ -176,31 +176,34 @@ h3#content_title span { position:absolute; left:0px; top:87px; + width:133px; } + #sidebar select { width: 95%; } -#sidebar h3 { - width: 120px; - height: 28px; - background: transparent url(../images/sidebar_top.jpg) no-repeat left; -} -#sidebar h3 span { - display:none -} -#sidebar ul { - list-style: none; - font: 10px/1em Arial, Helvetica, Sans-Serif; -} -#sidebar ul.subnavside { - display: none; - position: absolute; - width: 9em; - top: -1px; - left: 11.5em; - font-size: 1em; - z-index: 1; -} + +#sidebar span { + display:block; + text-decoration:none; + margin-left:5px; + margin-right:5px; +} +#sidebar a { + text-decoration:none; +} + +#sidebar span:hover { + background: #fff; +} + +#sidebar span.link { + display:inline; + text-decoration:none; + color: #000; + font: monospace, Courier, Georgia; +} + #sidebar li { float: left; clear: both; @@ -212,33 +215,6 @@ h3#content_title span { border-right: 4px solid #b4b4b4; background:#fff; } -#sidebar ul.subnavside li { - border-right-width: 1px; -} -#sidebar a, #sidebar .navbutton { - display: block; - position: relative; - text-decoration: none; - padding: .5em 0 .5em 1em; -} -#sidebar li:hover ul.subnavside, #sidebar li.sfhover ul.subnavside { - display:block; -} -#sidebar li:hover, #sidebar li.sfhover, #sidebar li.activetopmenu { - color:#000; - background:#ddd; -} -#sidebar li.hover:active { - background:#ccc; - z-index:30; -} - -/* For horizontal menu */ -.horizontal_menu #content { margin:3em 0 0 2em; } -.horizontal_menu #sidebar { width: auto; top: 85px;} -.horizontal_menu #sidebar h3 { display: none; } -.horizontal_menu #sidebar li { clear: none; border:1px solid #8b8b8b; } -.horizontal_menu #sidebar ul.subnavside { left: 0; top: 2em; } /* For sidebar tabs */ #sidebar-tabs li { @@ -257,9 +233,6 @@ h3#content_title span { padding-left:5px; font-size: 0.8em; } -#sidebar-page select { - width: 120px; -} /* Menu Elements Display (icons, visibility...) */ |