diff options
-rw-r--r-- | config/ampache.cfg.php.dist | 18 | ||||
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/class/rating.class.php | 10 | ||||
-rw-r--r-- | lib/class/update.class.php | 2 | ||||
-rw-r--r-- | lib/ui.lib.php | 17 | ||||
-rw-r--r-- | modules/init.php | 5 | ||||
-rw-r--r-- | register.php | 109 | ||||
-rw-r--r-- | templates/show_login_form.inc | 7 | ||||
-rw-r--r-- | templates/show_songs.inc | 1 | ||||
-rw-r--r-- | templates/show_user_registration.inc.php | 191 | ||||
-rw-r--r-- | templates/sidebar.inc.php | 72 | ||||
-rw-r--r-- | templates/style.inc | 239 | ||||
-rw-r--r-- | themes/burgundy/theme.cfg.php | 16 | ||||
-rw-r--r-- | themes/greyblock/templates/style.inc | 330 |
14 files changed, 531 insertions, 488 deletions
diff --git a/config/ampache.cfg.php.dist b/config/ampache.cfg.php.dist index 950ef7ff..021c5fda 100644 --- a/config/ampache.cfg.php.dist +++ b/config/ampache.cfg.php.dist @@ -119,13 +119,23 @@ require_session = "true" # DEFAULT: false #allow_zip_download = "false" -# This setting turns on/off public registration. It is -# recommended you leave this off, as it will allow anyone to -# sign up for an account on your server. +# This setting turns on/off public registration. It is +# recommended you leave this off, as it will allow anyone to +# sign up for an account on your server. # DEFAULT: false -# THIS IS CURRENTLY BROKEN! #allow_public_registration = "false" +# This setting will allow all registrants to be auto-approved +# as a user. By default, they will be added as a guest and +# must be "promoted" by the admin. +# DEFAULT: false +#auto_user = "false" + +# This will display the user agreement when registering +# For agreement text, edit templates/user_agreement.php +# User will need to accept the agreement before they can register +#user_agreement = "false" + # This sets which ID3 tag takes precedence. # we've found for those of you who don't have # good v2 tags it's sometimes nice to keep the v1 diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 589e0756..a680ab3e 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.3.2-Alpha4 + - Added pop-up submenus to classic Theme (Thx Sigger) + - Fixed genre pulldown so it's a good bit faster (1/2 the sql calls) - Updated Preferences (yet again) maybe it's better, maybe it's not we'll never know... - Fixed Classic Theme view in IE (had spaces) diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php index f69e2585..4a513421 100644 --- a/lib/class/rating.class.php +++ b/lib/class/rating.class.php @@ -78,17 +78,19 @@ class Rating { */ function get_average() { - $sql = "SELECT rating FROM ratings WHERE object_id='$this->id' AND object_type='$this->type'"; - $db_results = mysql_fetch_assoc($db_results); + $sql = "SELECT user_rating as rating FROM ratings WHERE object_id='$this->id' AND object_type='$this->type'"; + $db_results = mysql_query($sql, dbh()); $i = 0; while ($r = mysql_fetch_assoc($db_results)) { $i++; - $total = $r['rating']; + $total += $r['rating']; } // while we're pulling results - $average = floor($total/$i); + if ($total > 0) { + $average = floor($total/$i); + } $this->rating = $average; diff --git a/lib/class/update.class.php b/lib/class/update.class.php index 10532321..4d8e59c3 100644 --- a/lib/class/update.class.php +++ b/lib/class/update.class.php @@ -1239,7 +1239,7 @@ class Update { " `user` varchar(128) NOT NULL default ''," . " `object_type` enum('artist','album','song') NOT NULL default 'artist'," . " `object_id` int(11) unsigned NOT NULL default '0'," . - " `rating` enum('00','0','1','2','3','4','5') NOT NULL default '0'," . + " `user_rating` enum('00','0','1','2','3','4','5') NOT NULL default '0'," . " PRIMARY KEY (`id`))"; $db_results = mysql_query($sql, dbh()); diff --git a/lib/ui.lib.php b/lib/ui.lib.php index 81db6419..de906ed3 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -1067,19 +1067,30 @@ function show_preference_box($preferences) { * */ -function show_genre_pulldown ($name,$selected='',$size=1) { +function show_genre_pulldown ($name,$selected='',$size=1,$width=0,$style='') { /* Get them genre hippies */ $sql = "SELECT genre.id,genre.name FROM genre ORDER BY genre.name"; $db_result = mysql_query($sql, dbh()); - echo "<select name=\"" . $name . "[]\" multiple=\"multiple\" size=\"$size\">\n"; + if ($size > 0) { + $multiple_txt = "multiple=\"multiple\" size=\"$size\""; + } + if ($style) { + $style_txt = "style=\"$style\""; + } + + echo "<select name=\"" . $name . "[]\" $multiple_txt $style_txt>\n"; echo "\t<option value=\"-1\">" . _("All") . "</option>\n"; while ($r = mysql_fetch_assoc($db_result)) { - + $r['name'] = scrub_out($r['name']); + if ($width > 0) { + $r['name'] = truncate_with_ellipsis($r['name'],$width); + } + if ( $selected == $r['id'] ) { echo "\t<option value=\"" . $r['id'] . "\" selected=\"selected\">" . $r['name'] . "</option>\n"; } diff --git a/modules/init.php b/modules/init.php index 198eb010..48e71fe7 100644 --- a/modules/init.php +++ b/modules/init.php @@ -83,7 +83,7 @@ if (!$results['conf']['allow_stream_playback']) { } $results['conf']['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['conf']['web_path']; -$results['conf']['version'] = '3.3.2-Alpha4 (Build 004)'; +$results['conf']['version'] = '3.3.2-Alpha4 (Build 005)'; $results['conf']['catalog_file_pattern']= 'mp3|mpc|m4p|m4a|mp4|aac|ogg|rm|wma|asf|flac|spx'; $results['libglue']['local_table'] = 'session'; $results['libglue']['local_sid'] = 'id'; @@ -236,6 +236,9 @@ $gc_divisor = @ini_get('session.gc_divisor'); if (!$gc_divisor) { $gc_divisor = '100'; } +if (!$gc_probability) { + $gc_probability = '1'; +} // Force GC on 1:5 page loads if (($gc_divisor / $gc_probability) > 5) { diff --git a/register.php b/register.php index 010fb380..410f2e96 100644 --- a/register.php +++ b/register.php @@ -24,87 +24,96 @@ @header User Registration page @discussion this page handles new user registration, this is by default disabled - (it allows public reg) + (it allows public reg) */ -$no_session = 1; +$no_session = true; require_once ("modules/init.php"); /* Check Perms */ -if (!conf('allow_public_registration')) { +if (!conf('allow_public_registration')) { access_denied(); } $action = scrub_in($_REQUEST['action']); +?> -show_template('header'); +<?php -/* Start switch based on action passed */ +/* Start switch based on action passed */ switch ($action) { case 'add_user': - if (conf('demo_mode')) { break; } - $username = scrub_in($_REQUEST['username']); + // User information has been entered + // we need to check the database for possible existing username first + // if username exists, error and say "Please choose a different name." + // if username does not exist, insert user information into database + // then allow the user to 'click here to login' + // possibly by logging them in right then and there with their current info + // and 'click here to login' would just be a link back to index.php + if (conf('demo_mode')) { break; } + $accept_agreement = scrub_in($_REQUEST['accept_agreement']); $fullname = scrub_in($_REQUEST['fullname']); + $username = scrub_in($_REQUEST['username']); $email = scrub_in($_REQUEST['email']); $pass1 = scrub_in($_REQUEST['password_1']); $pass2 = scrub_in($_REQUEST['password_2']); - if ( $pass1 != $pass2 ) { - echo "<CENTER><B>Your passwords do not match</b><br />"; - echo "Click <B><a href=\"javascript:history.back(1)\">here</a></B> to go back"; + if(conf('user_agreement')==true){ + if(!$accept_agreement){ + echo("<center><b>You <u>must</u> accept the user agreement</b><br>"); + echo("Click <b><a href=\"javascript:history.back(1)\">here</a></b> to go back"); + break; + } + } + + if(!$username){ + echo("<center><b>You did not enter a username</b><br>"); + echo("Click <b><a href=\"javascript:history.back(1)\">here</a></b> to go back"); break; } -// INSERTED BY TERRY FOR MAIL ADDRESS CHECK - require("../templates/validateEmailFormat.php"); - require("../templates/validateEmail.php"); - // get the address from wherever you get it ... form input, etc. - // $email = "info@xs4all.nl"; - // $email = $_GET['email']; - // try a few extra times if we're concerned about fsockopen problems - $attempt = 0; - $max_attempts = 3; - $response_code = ""; - - while ( $response_code == "" || strstr( $response_code, "fsockopen error" )) { - $validate_results = validateEmail( $email ); - - $response_code = $validate_results[1]; - if($attempt == $max_attempts) break; - $attempt++; - } - - // display results - //echo "successful check during attempt #$attempt<br />"; - if ( $validate_results[0] ) { - $validation = str_rand(20); - $regdate = "2004-01-01"; - if (!$user->create($username, $fullname, $email, $pass1, $access, $validation)) { - echo "<CENTER>Registratie van gebruiker gefaald!<br />"; - echo "User ID of Email adres reeds in gebruik<br />"; - echo "Click <B><a href=\"javascript:history.back(1)\">here</a></B> to go back"; - break; + + if(!$fullname){ + echo("<center><b>Please enter your full name</b><br>"); + echo("Click <b><a href=\"javascript:history.back(1)\">here</a></b> to go back"); + break; + } + + if(!good_email($email)){ + echo("<center><b>You must enter a valid email address</b><br>"); + echo("Click <b><a href=\"javascript:history.back(1)\">here</a></b> to go back"); + break; } - echo "<CENTER>Successvol gechecked na #$attempt poging<br />"; - echo "Email verificatie van het email adres <B>$email</B> is gelukt<br />"; - echo "<B>Your User ID is Created<br />"; - echo "<P>You will receive an email when your account is approved<B><br />"; - echo "<A HREF=\"http://www.pb1unx.com\">Ga naar homepagina</A><br />"; - } else { - echo "<CENTER>Geen successvolle check. Er is/zijn #$attempt pogingen gedaan!<br />"; - echo "D'oh! <B>$email</B> is niet in orde!<br />"; - echo "$validate_results[1]<br />"; - echo "Click <B><a href=\"javascript:history.back(1)\">here</a></B> to go back"; + + if(!$pass1){ + echo("<center><b>You must enter a password</b><br>"); + echo("Click <b><a href=\"javascript:history.back(1)\">here</a></b> to go back"); + break; } - break; + if ( $pass1 != $pass2 ) { + echo("<center><b>Your passwords do not match</b><br>"); + echo("Click <b><a href=\"javascript:history.back(1)\">here</a></b> to go back"); + break; + } + $new_user = new_user("$username", "$fullname", "$email", "$pass1"); + if(!$new_user){ + echo("<center><b>That username already exists</b><br>"); + echo("Click <b><a href=\"javascript:history.back(1)\">here</a></b> to go back"); + break; + } + break; + // This is the default action. case 'show_add_user': default: if (conf('demo_mode')) { break; } $values = array('type'=>"new_user"); show_user_registration($values); break; + case 'new_user': + include("templates/show_new_user.inc"); + break; } diff --git a/templates/show_login_form.inc b/templates/show_login_form.inc index 09612512..119110a0 100644 --- a/templates/show_login_form.inc +++ b/templates/show_login_form.inc @@ -65,6 +65,13 @@ if (preg_match($subject,$_SERVER['HTTP_HOST'])) { <input type="hidden" name="action" value="login" /> </td> </tr> + <?php if(conf('allow_public_registration')==true){ ?> + <tr> + <td colspan=3 height=25 align=center> + <a href='register.php'>Register</a><br> + </td> + </tr> + <?php } ?> </table> </form> <p align="center"> diff --git a/templates/show_songs.inc b/templates/show_songs.inc index 5dd22f10..e3d1cae5 100644 --- a/templates/show_songs.inc +++ b/templates/show_songs.inc @@ -65,7 +65,6 @@ $username=$GLOBALS['user']->username; $totalsize += $song->size; $totaltime += $song->time; if ($song->status == "disabled") { $text_class = "class=\"disabled\""; } - include("get_song_ratings.inc"); ?> <tr class="<?php echo flip_class(); ?>"> <td align="center"> diff --git a/templates/show_user_registration.inc.php b/templates/show_user_registration.inc.php index e3e9f3a4..1f4bb6a5 100644 --- a/templates/show_user_registration.inc.php +++ b/templates/show_user_registration.inc.php @@ -21,53 +21,144 @@ */ ?> -<form name="update_user" method="post" action="<?php echo conf('web_path'); ?>/register.php" enctype="multipart/form-data"> -<table class="tabledata" cellspacing="0" cellpadding="0" border="0" width="90%"> -<tr> - <td> - <?php echo _("Username"); ?>: - </td> - <td> - <input type="textbox" name="username" value="<?php echo $_REQUEST['username']; ?>" /> - </td> -</tr> -<tr> - <td> - <?php echo _("Full Name"); ?>: - </td> - <td> - <input type="textbox" name="fullname" size="30" value="<?php echo $_REQUEST['fullname']; ?>" /> - </td> -</tr> -<tr> - <td> - <?php echo _("E-mail"); ?>: - </td> - <td> - <input type="textbox" name="email" size="30" value="<?php echo $_REQUEST['email']; ?>" /> - </td> -</tr> -<tr> - <td> - <?php echo _("Password"); ?> : - </td> - <td> - <input type="password" name="password_1" size="30" value="" /> - </td> -</tr> -<tr> - <td> - <?php echo _("Confirm Password"); ?>: - </td> - <td> - <input type="password" name="password_2" size="30" value="" /> - </td> -</tr> -<tr> - <td colspan="2"> - <input type="hidden" name="action" value="add_user" /> - <input type="submit" value="<?php echo _("Register User"); ?>" /> - </td> -</tr> -</table> -</form> +<!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'); ?>" /> +<?php show_template('style'); ?> +<title><?php echo conf('site_title'); ?> - <?php echo $location['title']; ?></title> +</head> +<body> +<script src="<?php echo conf('web_path'); ?>/lib/general.js" language="javascript" type="text/javascript"></script> + +<div id="maincontainer"> +<!-- This is the topbar row --> +<div id="topbar"> + <div id="topbarleft"> + <a href="http://www.ampache.org"> + <img class="pageheader" src="<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache.gif" border="0" title="Ampache: For the love of music" alt="Ampache: For the love of music" /> + </a> + </div> +</div> +<br><br> +<?php + +$action = scrub_in($_REQUEST['action']); +$fullname = scrub_in($_REQUEST['full_name']); +$username = scrub_in($_REQUEST['username']); +$password = scrub_in($_REQUEST['password']); +echo "$password"; + +?> + +<div align="center"> + <table class="border" width=600 cellpadding=0 cellspacing=0 border=0> + <tr class="table-header"> + <td> + <font size="2"><b><u>Ampache New User Registration</u></b></font> + </td> + </tr> + <form name="update_user" method="post" action="<?php echo conf('web_path'); ?>/register.php" enctype="multipart/form-data"> + <?php + // USER AGREEMENT + if(conf('user_agreement')==true){ ?> + <tr> + <td height=15 bgcolor="<?php print conf('base_color2'); ?>"> + </td> + </tr> + <tr> + <td bgcolor="<?php print conf('base_color2'); ?>" align=center valign=top> + <table width=100% border=0 cellpadding=0 cellspacing=0> + <tr class="table-header"> + <td align=center> + <font size="1"><b><u>User Agreement</u></b></font> + </td> + </tr> + <tr> + <td> + <?php include("templates/user_agreement.php"); ?> + </td> + </tr> + <tr> + <td align=center height=35 valign=center> + <input type='checkbox' name='accept_agreement'> I Accept + </td> + </tr> + </table> + </td> + </tr> + <? } ?> + <tr> + <td height=15 bgcolor="<?php print conf('base_color2'); ?>"> + </td> + </tr> + <tr> + <td bgcolor="<?php print conf('base_color2'); ?>" align=center valign=top> + <table width=100% cellpadding=0 cellspacing=0 border=0> + <tr class="table-header"> + <td align=center> + <font size="1"><b><u>User Information</u></b></font> + </td> + </tr> + </table> + <br> + <table width=60% cellpadding=0 cellspacing=0 border=0> + <tr> + <td align=right> + <?php echo _("Username"); ?>: + </td> + <td> + <font color=red>*</font> <input type='text' name='username' id='username'> + </td> + </tr> + <tr> + <td align=right> + <?php echo _("Full Name"); ?>: + </td> + <td> + <font color=red>*</font> <input type='text' name='fullname' id='fullname'> + </td> + </tr> + <tr> + <td align=right> + <?php echo _("E-mail"); ?>: + </td> + <td> + <font color=red>*</font> <input type='text' name='email' id='email'> + </td> + </tr> + <tr> + <td align=right> + <?php echo _("Password"); ?>: + </td> + <td> + <font color=red>*</font> <input type='password' name='password_1' id='password_1'> + </td> + </tr> + <tr> + <td align=right> + <?php echo _("Confirm Password"); ?>: + </td> + <td> + <font color=red>*</font> <input type='password' name='password_2' id='password_2'> + </td> + </tr> + <tr> + <td colspan=2 align=center height=20> + <font color=red>*</font>Required fields + </td> + </tr> + <tr> + <td colspan=2 align=center height=50> + <input type="hidden" name="action" value="add_user" /> + <input type='reset' name='clear_info' id='clear_info' value='Clear Info'> + <input type='submit' name='submit_registration' id='submit_registration' value='<?php echo _("Register User"); ?>'> + </td> + </tr> + </form> + </table> + </td> + </tr> + </table> +</div> diff --git a/templates/sidebar.inc.php b/templates/sidebar.inc.php index 60ac95a9..79a62283 100644 --- a/templates/sidebar.inc.php +++ b/templates/sidebar.inc.php @@ -35,10 +35,11 @@ $admin_items[] = array('title'=>'Access List','url'=>'admin/access.php','active' $browse_items[] = array('title'=>'Albums','url'=>'albums.php','active'=>''); $browse_items[] = array('title'=>'Artists','url'=>'artists.php','active'=>''); $browse_items[] = array('title'=>'Genre','url'=>'browse.php?action=genre','active'=>''); +$browse_items[] = array('title'=>'Lists','url'=>'browse.php','active'=>''); //$browse_items[] = array('title'=>'File','url'=>'files.php','active'=>''); ?> -<div id="navcontainer"> +<!-- <div id="navcontainer"> --> <!--sigger: appears this div is not neccesary and duplicates #sidebar --> <ul id="navlist"> <li id="active"> <a href="<?php echo conf('web_path'); ?>/index.php" id="current"><?php echo _("Home"); ?></a> @@ -46,15 +47,17 @@ $browse_items[] = array('title'=>'Genre','url'=>'browse.php?action=genre','activ <?php if ($GLOBALS['user']->has_access(100)) { ?> <li> <a href="<?php echo conf('web_path'); ?>/admin/index.php"><?php echo _("Admin"); ?></a> - <?php - if ($location['section'] == 'admin') { - if ($GLOBALS['theme']['orientation'] == 'vertical') { echo "\t</li>"; } - show_submenu($admin_items); - if ($GLOBALS['theme']['orientation'] != 'vertical') { echo "\t</li>"; } + <?php + if ($GLOBALS['theme']['submenu'] != 'simple') { + show_submenu($admin_items); + echo "\t</li>\n"; + } + else { + if ($location['section'] == 'admin') { + echo "\t</li>\n"; + show_submenu($admin_items); + } } // end if browse sub menu - else { - echo "\t</li>"; - } } // end if access ?> @@ -62,15 +65,17 @@ $browse_items[] = array('title'=>'Genre','url'=>'browse.php?action=genre','activ <a href="<?php echo conf('web_path'); ?>/preferences.php"><?php echo _("Preferences"); ?></a> </li> <li> - <a href="<?php echo conf('web_path'); ?>/browse.php"><?php echo _("Browse"); ?></a> + <a href="<?php echo conf('web_path'); ?>/browse.php"><?php echo _("Browse"); ?></a> <?php - if ($location['section'] == 'browse') { - if ($GLOBALS['theme']['orientation'] == 'vertical') { echo "\t</li>"; } + if ($GLOBALS['theme']['submenu'] != 'simple') { show_submenu($browse_items); - if ($GLOBALS['theme']['orientation'] != 'vertical') { echo "\t</li>"; } - } // end if browse sub menu - else { - echo "\t</li>"; + echo "\t</li>\n"; + } + else { + if ($location['section'] == 'browse') { + echo "\t</li>\n"; + show_submenu($browse_items); + } } ?> <?php if ($GLOBALS['user']->prefs['upload']) { ?> @@ -88,31 +93,24 @@ $browse_items[] = array('title'=>'Genre','url'=>'browse.php?action=genre','activ <?php } ?> <li> <a href="<?php echo conf('web_path'); ?>/search.php"><?php echo _("Search"); ?></a> - </li> - </ul> <?php if ($GLOBALS['theme']['orientation'] != 'horizontal') { ?> - <ul class="subnavside"> - <li class="subnavbutton"> + <li> <form name="sub_search" method="post" action="<?php echo conf('web_path'); ?>/search.php" enctype="multipart/form-data" style="Display:inline"> - <input type="text" name="search_string" value="<?php echo scrub_out($_REQUEST['search_string']); ?>" size="8" /> - <input class="smallbutton" type="submit" value="<?php echo _("Search"); ?>" /> + <input type="text" name="search_string" value="<?php echo scrub_out($_REQUEST['search_string']); ?>" size="5" /> + <input class="smallbutton" type="submit" value="<?php echo _("Search"); ?>" /> <input type="hidden" name="action" value="quick_search" /> <input type="hidden" name="method" value="fuzzy" /> <input type="hidden" name="object_type" value="song" /> <input type="hidden" name="search_object[]" value="all" /> </form> </li> - </ul> <?php } ?> - <ul> <li> <a href="<?php echo conf('web_path'); ?>/randomplay.php"><?php echo _("Random Play"); ?></a> </li> - </ul> - <?php if ($GLOBALS['theme']['orientation'] != 'horizontal') { ?> - <ul class="subnavside"> - <li class="subnavbutton"> - <form name="sub_random" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ?>/song.php" style="Display:inline"> + <?php if ($GLOBALS['theme']['orientation'] != 'horizontal') { ?> + <li> + <form name="random" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ?>/song.php" style="Display:inline"> <input type="hidden" name="action" value="m3u" /> <select name="random" style="width:110px;"> <option value="1">1</option> @@ -126,7 +124,8 @@ $browse_items[] = array('title'=>'Genre','url'=>'browse.php?action=genre','activ <option value="1000">1000</option> <option value="-1"><?php echo _("All"); ?></option> </select> - <br /> + <?php show_genre_pulldown('genre','','','13','width:110px;'); ?> + <br /> <select name="Quantifier" style="width:110px;"> <option value="Songs"><?php echo _("Songs"); ?></option> <option value="Minutes"><?php echo _("Minutes"); ?></option> @@ -134,16 +133,15 @@ $browse_items[] = array('title'=>'Genre','url'=>'browse.php?action=genre','activ <option value="Albums"><?php echo _("Albums"); ?></option> <option value="Less Played"><?php echo _("Less Played"); ?></option> </select> - <br /> - <?php show_catalog_pulldown('catalog','width:110px;'); ?> - <br /> + <br /> <input type="hidden" name="aaction" value="Play!" /> <input class="smallbutton" type="submit" name="aaction" value="<?php echo _("Enqueue"); ?>" /> </form> </li> - </ul> - <?php } ?> + <?php } ?> <?php if (conf('use_auth')) { ?> - <ul><li><a href="<?php echo conf('web_path'); ?>/logout.php">Logout</a></li></ul> + <li><a href="<?php echo conf('web_path'); ?>/logout.php">Logout</a></li> <?php } ?> -</div> + </li> </ul> + +<!-- </div> --> diff --git a/templates/style.inc b/templates/style.inc index cf8cdec1..730554c3 100644 --- a/templates/style.inc +++ b/templates/style.inc @@ -26,6 +26,25 @@ ampache, mod this to change the look and feel of the site */ ?> + +<script type="text/javascript" language="javascript"> +<!-- Begin Suckerfish hover menu JS +// function needed for IE. attaches mouseover/out events to give/remove css class .sfhover (fake hover) +sfHover = function(navlist) { +var sfEls = document.getElementById("navlist").getElementsByTagName("LI"); +for (var i=0; i <sfEls.length; i++) { + sfEls[i].onmouseover=function() { + this.className+=" sfhover"; + } + sfEls[i].onmouseout=function() { + this.className=this.className.replace(new RegExp("sfhover\\b"), ""); + } +} // end for +} // end function for sfHover +if (window.attachEvent) window.attachEvent("onload", sfHover); +// End Suckerfish hover menu JS--> +</script> + <style type="text/css"> <!-- body @@ -72,6 +91,11 @@ border-left:2px solid <?php echo conf('bg_color2'); ?>; border-top:2px solid <?php echo conf('bg_color2'); ?>; } + + .npsong + { + background-color: #FFFF66; + } table.tabledata { } @@ -114,79 +138,6 @@ background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2')?> repeat-x; vertical-align: top; } -/*************** Main Menu *****************/ - #mainmenu { - float: left; - width: 100%; - margin: 0; - padding: 0; - list-style: none; - border-top: 1px solid #000; - border-bottom: 1px solid #000; - border-right: 1px solid #000; - border-left: 1px solid #000; - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2');?> repeat-x; - } - #mainmenu li { - float: left; - margin: 0; - padding: 0 10px 0 10px; - border-right: 1px solid #000; - display: inline; - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2');?> repeat-x; - } - #mainmenu li.active { - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-dark-bg.gif) <?php echo conf('base_color2');?> repeat-x; - } - #mainmenu a { - text-decoration: none; - } - #mainmenu a:hover { - color: #000; - } - #mainmenu a:active { - color: #00a; - } -/*************** END Main Menu *************/ -/*************** Admin Menu *************/ - #adminmenu { - float: left; - width: 100%; - margin: 0; - padding: 0; - list-style: none; - border-bottom: 1px solid #000; - border-right: 1px solid #000; - border-left: 1px solid #000; - border-top: 1px solid #000; - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2')?> repeat; - } - #adminmenu li { - float: left; - margin: 0; - padding: 0 20px 0 20px; - border-right: 1px solid #000; - display: inline; - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2');?> repeat-x; - } - #adminmenu li.active { - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-dark-bg.gif) <?php echo conf('base_color2');?> repeat-x; - } - #adminmenu a { - text-decoration: none; - } - #adminmenu a:hover { - color: #000; - } - #adminmenu a:active { - color: #000; - } -/*************** END Main Menu *************/ -/*************** Page Header *********************/ - #pageheader { - background: #8B8B8B; - } -/*************** END Page Header *****************/ .header1 { color: <?php echo conf('font_color2'); ?>; @@ -270,7 +221,6 @@ padding-right:0px; padding-top: 0px; padding-left: 0px; - width:160px; background: <?php echo conf('base_color2'); ?>; } /** @@ -278,15 +228,15 @@ * These define how the page is layed out, be careful with these as changes to them * can cause drastic layout changes */ - #maincontrainer + #maincontainer { - margin:0px; + margin: 0px; } #topbar { - margin-left: 5px; - margin-top: 5px; height: 80px; + padding-top:10px; + padding-left:10px; background-color: <?php echo conf('bg_color1'); ?>; } #topbarright @@ -297,89 +247,82 @@ { float: left; } - #sidebar - { - clear: both; - height: 100%; - margin-left: 5px; - margin-top:0px; - float: left; - width: 170px; - } - - #sidebar ul - { - margin-left:0px; - margin-top:0px; - margin-bottom:0px; - margin-right: 10px; - padding: 0px; - list-style-type: none; - font-family: verdana, arial, Helvetica, sans-serif; - } - - #sidebar li { - margin: 0 0 1px 0; - padding-top:0px; - padding-bottom:0px; - } - - #sidebar a, .navbutton - { - display: block; - padding: 5px 10px; - color: <?php echo conf('font_color1'); ?>; - background-color: <?php echo conf('row_color2'); ?>; - text-decoration: none; - } - - #sidebar a:hover - { - color: <?php echo conf('font_color1'); ?>; - background-color: <?php echo conf('row_color3'); ?>; - text-decoration: none; - } - - #sidebar ul ul li { margin: 0 0 1px 0; } - - #sidebar ul ul a - { - display: block; - padding: 5px 5px 5px 30px; - width: 125px; - color: <?php echo conf('font_color1'); ?>; - background-color: <?php echo conf('row_color1'); ?>; - text-decoration: none; - } - #navcontainer ul li { - float:left; - width:100%; + float:left; + width:100%; } .subnavbutton { - background-color: <?php echo conf('row_color1'); ?>; - text-align:center; - text-decoration: none; - color: <?php echo conf('font_color2'); ?>; + background-color: <?php echo conf('row_color1'); ?>; + text-align:center; + text-decoration: none; + color: <?php echo conf('font_color2'); ?>; } - #sidebar ul ul a:hover - { - color: <?php echo conf('font_color2'); ?>; - background-color: <?php echo conf('row_color3'); ?>; - text-decoration: none; - } #content { + float: left; margin-left:0px; - padding-top:10px; - padding-left:10px; - vertical-align:top; } /** + * Experimental for menus (Thx Sigger) + * TO DO: Fill in 1px border around menus & submenu items + * Make padding appply to the li, not just an a. Moving paddng: to li throws off the dropdown menu alignment. + */ + #sidebar { + clear: both; + height: 100%; + margin: 0; + float: left; + /* width: 110px; /* this controls the width of the sidebar. horizontal menu needs more width */ + padding: 0; + list-style: none; + border: 1px solid #000; + line-height: 1; + } + #sidebar ul { + margin: 0px; + list-style: none; + padding: 0px; + font-family: verdana, arial, Helvetica, sans-serif; + line-height: 1; + } + #sidebar li { +/* margin: 0 0 1px 0; */ + margin: 0; + display: block; + border-bottom: 1px solid white; + border-left: 1px solid white; + border-right: 1px solid white; + padding: 5px 0px 5px 10px; + width: 10em; + background-color: <?php echo conf('row_color2'); ?>; + } + #sidebar a, .navbutton { + display: block; /*Not sure why this is neccesary, but it is for IE*/ + text-decoration: none; + } + #sidebar li:hover, #sidebar li.sfhover { + color: <?php echo conf('font_color2'); ?>; + background-color: <?php echo conf('row_color3'); ?>; + } + #sidebar li:active { + background-color: <?php echo conf('row_color1'); ?>; + } + #sidebar li ul { + float: left; + position: absolute; + width: 12em; + margin: -1.5em 0 0 10em; +/* -2em 0 0 10em for vertical menu puts the submenu back up and to the right of the hovered menu item by "the right amount"*/ + left: -999em; /* this puts the submenu item way off to the left until it's called back by a hover (below) */ + } + #sidebar li:hover ul, #sidebar li.sfhover ul { + left: auto; /* this calls the submenu back when the parent li is hovered. */ + } +/** * End Div Definitions * This is the end of the main structure def's */ diff --git a/themes/burgundy/theme.cfg.php b/themes/burgundy/theme.cfg.php index 725527f4..bf93db81 100644 --- a/themes/burgundy/theme.cfg.php +++ b/themes/burgundy/theme.cfg.php @@ -23,10 +23,24 @@ author = "S1amson" # maintaining this theme incase it's not working right # please include an e-mail address so you can be contacted # DEFAULT: N/A -#maintainer = "Ben Shields <foo@ampache.org>" +maintainer = "Karl Vollmer" +# Version +# This is the version of the Theme (usefull if you've updated it) +version = "1.1" + +# 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" + # Theme Colors ################### [color] diff --git a/themes/greyblock/templates/style.inc b/themes/greyblock/templates/style.inc index 64fe72f7..730554c3 100644 --- a/themes/greyblock/templates/style.inc +++ b/themes/greyblock/templates/style.inc @@ -26,10 +26,33 @@ ampache, mod this to change the look and feel of the site */ ?> + +<script type="text/javascript" language="javascript"> +<!-- Begin Suckerfish hover menu JS +// function needed for IE. attaches mouseover/out events to give/remove css class .sfhover (fake hover) +sfHover = function(navlist) { +var sfEls = document.getElementById("navlist").getElementsByTagName("LI"); +for (var i=0; i <sfEls.length; i++) { + sfEls[i].onmouseover=function() { + this.className+=" sfhover"; + } + sfEls[i].onmouseout=function() { + this.className=this.className.replace(new RegExp("sfhover\\b"), ""); + } +} // end for +} // end function for sfHover +if (window.attachEvent) window.attachEvent("onload", sfHover); +// End Suckerfish hover menu JS--> +</script> + <style type="text/css"> <!-- body { + padding-top: 0px; + margin-top: 0px; + margin-left: 0px; + margin-right: 0px; background: <?php echo conf('bg_color1'); ?>; font-family: <?php echo conf('font') ?>; font-size: <?php echo conf('font_size'); ?>px; @@ -68,6 +91,11 @@ border-left:2px solid <?php echo conf('bg_color2'); ?>; border-top:2px solid <?php echo conf('bg_color2'); ?>; } + + .npsong + { + background-color: #FFFF66; + } table.tabledata { } @@ -90,107 +118,26 @@ font-size: <?php echo conf('font_size'); ?>px; font-weight: bold; background-color: <?php echo conf('base_color2') ?>; - border-style: solid; - border-width: 1px; - border-color: <?php echo conf('bg_color2'); ?>; margin: 2px 2px 2px 2px; } select { color: <?php echo conf('font_color2'); ?>; font-family: <?php echo conf('font')?>; font-size: <?php echo conf('font_size'); ?>px; - background-color: <?php echo conf('base_color2') ?>; + background-color: <?php echo conf('base_color2'); ?>; } textarea - { + { + background-color: <?php echo conf('base_color2'); ?>; color: <?php echo conf('font_color2') ?>; font-family: <?php echo conf('font')?>; font-size: <?php echo conf('font_size'); ?>px; - } + } .table-header { background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2')?> repeat-x; vertical-align: top; } -/*************** Main Menu *****************/ - #mainmenu { - float: left; - width: 100%; - margin: 0; - padding: 0; - list-style: none; - border-top: 1px solid #000; - border-bottom: 1px solid #000; - border-right: 1px solid #000; - border-left: 1px solid #000; - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2');?> repeat-x; - } - #mainmenu li { - float: left; - margin: 0; - padding: 0 10px 0 10px; - border-right: 1px solid #000; - display: inline; - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2');?> repeat-x; - } - #mainmenu li.active { - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-dark-bg.gif) <?php echo conf('base_color2');?> repeat-x; - } - #mainmenu a { - text-decoration: none; - } - #mainmenu a:hover { - color: #000; - } - #mainmenu a:active { - color: #00a; - } -/*************** END Main Menu *************/ -/*************** Admin Menu *************/ - #adminmenu { - float: left; - width: 100%; - margin: 0; - padding: 0; - list-style: none; - border-bottom: 1px solid #000; - border-right: 1px solid #000; - border-left: 1px solid #000; - border-top: 1px solid #000; - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2')?> repeat; - } - #adminmenu li { - float: left; - margin: 0; - padding: 0 20px 0 20px; - border-right: 1px solid #000; - display: inline; - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2');?> repeat-x; - } - #adminmenu li.active { - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-dark-bg.gif) <?php echo conf('base_color2');?> repeat-x; - } - #adminmenu a { - text-decoration: none; - } - #adminmenu a:hover { - color: #000; - } - #adminmenu a:active { - color: #000; - } -/*************** END Main Menu *************/ -/*************** Page Header *********************/ - #pageheader { - background: <?php echo conf('bg_color1');?>; - } -/*************** END Page Header *****************/ - .navitem - { - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-light-bg.gif) <?php echo conf('base_color2')?> repeat-x; - vertical-align: top; - text-align: center; - } .header1 { color: <?php echo conf('font_color2'); ?>; @@ -205,12 +152,6 @@ font-size: <?php echo conf('font_size') + 2; ?>px; font-weight: 900; } - .active_navitem - { - background: url(<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache-dark-bg.gif) <?php echo conf('bg_color1')?> repeat-x; - vertical-align: top; - text-align: center; - } .headrow { background:<?php echo conf('row_color1'); ?>; @@ -264,113 +205,126 @@ font-size: <?php echo conf('font_size'); ?>px; font-weight: normal; } - #sidebar a:hover - { - color: #000; - background-color: #ccc; - text-decoration: none; - } - - #sidebar ul ul li { margin: 0 0 1px 0; } - - #sidebar ul ul a - { - display: block; - padding: 5px 5px 5px 30px; - width: 125px; - color: #000; - background-color: #ccc; - text-decoration: none; - } - - #sidebar ul - { - margin-left:0px; - margin-top:0px; - margin-bottom:0px; - margin-right: 10px; - padding: 0px; - list-style-type: none; - font-family: verdana, arial, Helvetica, sans-serif; - } - - #sidebar li { - margin: 0 0 1px 0; - padding-top:0px; - padding-bottom:0px; - } - - #sidebar a, .navbutton - { - display: block; - padding: 5px 10px; - color: #000; - background-color: #666; - text-decoration: none; - } - + .smallbutton + { + border:0px; + padding-left:1px; + padding-right:1px; + font-size: <?php echo conf('font_size') - 1; ?>px; + cursor: pointer; + } + .sidebar + { + margin-left:0px; + margin-top:0px; + margin-right:0px; + padding-right:0px; + padding-top: 0px; + padding-left: 0px; + background: <?php echo conf('base_color2'); ?>; + } /** * Div Definitions * These define how the page is layed out, be careful with these as changes to them * can cause drastic layout changes */ - #maincontrainer - { - margin: 0px; - } - #topbar - { - height: 80px; - background-color: <?php echo conf('bg_color1'); ?>; - } - #topbarright - { - float: right; - } - #topbarleft - { - float: left; - } - #sidebar - { - clear: both; - height: 100%; - margin-left: 0px; - margin-top:0px; - float: left; - width: 170px; - } - #navcontainer ul li - { - float:left; - width:100%; - } + #maincontainer + { + margin: 0px; + } + #topbar + { + height: 80px; + padding-top:10px; + padding-left:10px; + background-color: <?php echo conf('bg_color1'); ?>; + } + #topbarright + { + float: right; + } + #topbarleft + { + float: left; + } + #navcontainer ul li + { + float:left; + width:100%; + } - .subnavbutton - { - background-color: <?php echo conf('row_color1'); ?>; - text-align:center; - text-decoration: none; - color: #000; - } + .subnavbutton + { + background-color: <?php echo conf('row_color1'); ?>; + text-align:center; + text-decoration: none; + color: <?php echo conf('font_color2'); ?>; + } - #sidebar ul ul a:hover - { - color: <?php echo conf('font_color3'); ?>; - background-color: <?php echo conf('row_color2'); ?>; - text-decoration: none; - } - #content - { - margin-left:0px; - padding-top:10px; - padding-left:10px; - vertical-align:top; - } + #content + { + float: left; + margin-left:0px; + } +/** + * Experimental for menus (Thx Sigger) + * TO DO: Fill in 1px border around menus & submenu items + * Make padding appply to the li, not just an a. Moving paddng: to li throws off the dropdown menu alignment. + */ + #sidebar { + clear: both; + height: 100%; + margin: 0; + float: left; + /* width: 110px; /* this controls the width of the sidebar. horizontal menu needs more width */ + padding: 0; + list-style: none; + border: 1px solid #000; + line-height: 1; + } + #sidebar ul { + margin: 0px; + list-style: none; + padding: 0px; + font-family: verdana, arial, Helvetica, sans-serif; + line-height: 1; + } + #sidebar li { +/* margin: 0 0 1px 0; */ + margin: 0; + display: block; + border-bottom: 1px solid white; + border-left: 1px solid white; + border-right: 1px solid white; + padding: 5px 0px 5px 10px; + width: 10em; + background-color: <?php echo conf('row_color2'); ?>; + } + #sidebar a, .navbutton { + display: block; /*Not sure why this is neccesary, but it is for IE*/ + text-decoration: none; + } + #sidebar li:hover, #sidebar li.sfhover { + color: <?php echo conf('font_color2'); ?>; + background-color: <?php echo conf('row_color3'); ?>; + } + #sidebar li:active { + background-color: <?php echo conf('row_color1'); ?>; + } + #sidebar li ul { + float: left; + position: absolute; + width: 12em; + margin: -1.5em 0 0 10em; +/* -2em 0 0 10em for vertical menu puts the submenu back up and to the right of the hovered menu item by "the right amount"*/ + left: -999em; /* this puts the submenu item way off to the left until it's called back by a hover (below) */ + } + #sidebar li:hover ul, #sidebar li.sfhover ul { + left: auto; /* this calls the submenu back when the parent li is hovered. */ + } /** * End Div Definitions * This is the end of the main structure def's */ - --> </style> |