Browse Source

Themes: Add body_opacity (Enhanced & Minimized) and menu_opacity (Minimized only) settings.
Login: Prevent error on logout, if session not set.

Nate Jones 10 năm trước cách đây
mục cha
commit
d26cee2600

+ 4 - 2
login.php

@@ -29,8 +29,10 @@ include "root.php";
 	session_start();
 	session_start();
 
 
 //retain message
 //retain message
-	$message_mood = $_SESSION["message_mood"];
-	$message = $_SESSION["message"];
+	if (isset($_SESSION["message"])) {
+		$message_mood = $_SESSION["message_mood"];
+		$message = $_SESSION["message"];
+	}
 
 
 //destroy session
 //destroy session
 	session_unset();
 	session_unset();

+ 14 - 0
themes/enhanced/app_defaults.php

@@ -153,6 +153,20 @@ if ($domains_processed == 1) {
 		$array[$x]['default_setting_value'] = '1.75';
 		$array[$x]['default_setting_value'] = '1.75';
 		$array[$x]['default_setting_enabled'] = 'true';
 		$array[$x]['default_setting_enabled'] = 'true';
 		$array[$x]['default_setting_description'] = 'Set the hide delay of the message bar (seconds).';
 		$array[$x]['default_setting_description'] = 'Set the hide delay of the message bar (seconds).';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'body_opacity';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '0.93';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the opacity of the body and content (decimal).';
+		$x++;
+		$array[$x]['default_setting_category'] = 'theme';
+		$array[$x]['default_setting_subcategory'] = 'menu_opacity';
+		$array[$x]['default_setting_name'] = 'text';
+		$array[$x]['default_setting_value'] = '0.96';
+		$array[$x]['default_setting_enabled'] = 'false';
+		$array[$x]['default_setting_description'] = 'Set the opacity of the main menu (decimal, Minimized theme only).';
 
 
 	//iterate and add each, if necessary
 	//iterate and add each, if necessary
 		foreach ($array as $index => $default_settings) {
 		foreach ($array as $index => $default_settings) {

+ 32 - 46
themes/enhanced/template.php

@@ -470,7 +470,6 @@ table.tr_hover tr:hover td a {
 
 
 .border {
 .border {
 	border: solid 1px #a4aebf;
 	border: solid 1px #a4aebf;
-	/*background-color: #FFFFFF;*/
 }
 }
 
 
 
 
@@ -488,9 +487,7 @@ table.tr_hover tr:hover td a {
 }
 }
 
 
 table {
 table {
-	/*background:#ccc;*/
-	/*margin:20px;*/
-	/*border:#ccc 1px solid;*/
+
 }
 }
 
 
 table th {
 table th {
@@ -498,8 +495,7 @@ table th {
 }
 }
 
 
 table td {
 table td {
-	/*background:#fff;*/
-	/*padding:2px 10px 4px 10px*/
+
 }
 }
 
 
 table tr.even td {
 table tr.even td {
@@ -557,6 +553,34 @@ legend {
 	padding-right: 2px;
 	padding-right: 2px;
 }
 }
 
 
+#main_content {
+	<?php
+	if (
+		strlen($_SESSION["username"]) > 0 &&
+		(
+			isset($_SESSION['theme']['background_image']) ||
+			$_SESSION['theme']['background_color'][0] != '' ||
+			$_SESSION['theme']['background_color'][1] != ''
+		)) { ?>
+		background-color: #FFFFFF;
+		background-attachment: fixed;
+		opacity: <?php echo ($_SESSION['theme']['body_opacity']['text'] != '') ? $_SESSION['theme']['body_opacity']['text'] : "0.93"; ?>;
+		filter:alpha(opacity=<?php echo ($_SESSION['theme']['body_opacity']['text'] != '') ? (100 * (float) $_SESSION['theme']['body_opacity']['text']) : "93"; ?>);
+		-moz-opacity: <?php echo ($_SESSION['theme']['body_opacity']['text'] != '') ? $_SESSION['theme']['body_opacity']['text'] : "0.93"; ?>;
+		-khtml-opacity: <?php echo ($_SESSION['theme']['body_opacity']['text'] != '') ? $_SESSION['theme']['body_opacity']['text'] : "0.93"; ?>;
+		-webkit-border-radius: 4px;
+		-moz-border-radius: 4px;
+		border-radius: 4px;
+		-webkit-box-shadow: 0 1px 4px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
+		-moz-box-shadow: 0 1px 4px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
+		box-shadow: 0 1px 4px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
+		padding: 20px;
+	<?php } else { ?>
+		padding: 10px;
+	<?php } ?>
+	text-align: left;
+}
+
 /* begin the menu css*/
 /* begin the menu css*/
 
 
 	.menu_bar {
 	.menu_bar {
@@ -587,13 +611,10 @@ legend {
 		?>
 		?>
 		background-repeat: repeat-x;
 		background-repeat: repeat-x;
 		background-attachment: fixed;
 		background-attachment: fixed;
-		/*background-color: #FFFFFF;*/
-
 		opacity: 0.9;
 		opacity: 0.9;
 		filter:alpha(opacity=90);
 		filter:alpha(opacity=90);
 		-moz-opacity:0.9;
 		-moz-opacity:0.9;
 		-khtml-opacity: 0.9;
 		-khtml-opacity: 0.9;
-
 		-webkit-border-radius: 3px;
 		-webkit-border-radius: 3px;
 		-moz-border-radius: 3px;
 		-moz-border-radius: 3px;
 		border-radius: 3px;
 		border-radius: 3px;
@@ -604,34 +625,6 @@ legend {
 		padding-right:20px;
 		padding-right:20px;
 	}
 	}
 
 
-	.main_content {
-		<?php
-		if (
-			strlen($_SESSION["username"]) > 0 &&
-			(
-				isset($_SESSION['theme']['background_image']) ||
-				$_SESSION['theme']['background_color'][0] != '' ||
-				$_SESSION['theme']['background_color'][1] != ''
-			)) { ?>
-			background-color: #FFFFFF;
-			background-attachment: fixed;
-			opacity: 0.93;
-			filter:alpha(opacity=93);
-			-moz-opacity:0.93;
-			-khtml-opacity: 0.93;
-			-webkit-border-radius: 4px;
-			-moz-border-radius: 4px;
-			border-radius: 4px;
-			-webkit-box-shadow: 0 1px 4px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
-			-moz-box-shadow: 0 1px 4px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
-			box-shadow: 0 1px 4px <?php echo ($_SESSION['theme']['login_shadow_color']['text'] != '') ? $_SESSION['theme']['login_shadow_color']['text'] : "#888"; ?>;
-			padding: 20px;
-		<?php } else { ?>
-			padding: 10px;
-		<?php } ?>
-		text-align: left;
-	}
-
 	#menu{
 	#menu{
 		width:100%;
 		width:100%;
 		float:left;
 		float:left;
@@ -640,7 +633,6 @@ legend {
 	#menu a, #menu h2{
 	#menu a, #menu h2{
 		font:bold 11px/16px arial,helvetica,sans-serif;
 		font:bold 11px/16px arial,helvetica,sans-serif;
 		display:block;
 		display:block;
-		/*border-color:#ccc #888 #555 #bbb;*/
 		white-space:nowrap;
 		white-space:nowrap;
 		margin:0;
 		margin:0;
 		padding: 3px;
 		padding: 3px;
@@ -648,8 +640,6 @@ legend {
 
 
 	#menu h2{
 	#menu h2{
 		color:#FFFFFF;
 		color:#FFFFFF;
-		/*background:#222222 url(<!--{project_path}-->/css/images/expand3.gif) no-repeat 100% 100%;*/
-		/*text-transform:uppercase*/
 		<?php
 		<?php
 		if ($_SESSION['domain']['language']['code'] == "en-us") {
 		if ($_SESSION['domain']['language']['code'] == "en-us") {
 			echo "width:125px;\n";
 			echo "width:125px;\n";
@@ -667,8 +657,6 @@ legend {
 	}
 	}
 
 
 	#menu h2 h2{
 	#menu h2 h2{
-		/*background:#4e4b56 url(<!--{project_path}-->/css/images/expand3.gif) no-repeat 100% 100%;*/
-		/*text-transform:uppercase*/
 		padding: 3px;
 		padding: 3px;
 	}
 	}
 
 
@@ -689,7 +677,7 @@ legend {
 
 
 	#menu .menu_sub {
 	#menu .menu_sub {
 		display:none;
 		display:none;
-		padding-top:10px;
+		padding: 5px 0px 8px 0px;
 		<?php
 		<?php
 		if ($_SESSION['domain']['language']['code'] == "en-us") {
 		if ($_SESSION['domain']['language']['code'] == "en-us") {
 			echo "width:125px;\n";
 			echo "width:125px;\n";
@@ -761,7 +749,6 @@ legend {
 		-webkit-border-radius: 3px;
 		-webkit-border-radius: 3px;
 		-moz-border-radius: 3px;
 		-moz-border-radius: 3px;
 		border-radius: 3px;
 		border-radius: 3px;
-		/*background:#1F1F1F url(<!--{project_path}-->/css/images/expand3.gif) no-repeat -999px -9999px;*/
 	}
 	}
 
 
 	div#menu li:hover{
 	div#menu li:hover{
@@ -784,7 +771,6 @@ legend {
 	#menu a.x, #menu a.x:visited{
 	#menu a.x, #menu a.x:visited{
 		font-weight:bold;
 		font-weight:bold;
 		color:#000;
 		color:#000;
-		/*background:#a4aebf url(<!--{project_path}-->/css/images/expand3.gif) no-repeat 100% 100%;*/
 	}
 	}
 
 
 	#menu a.x:hover{
 	#menu a.x:hover{
@@ -1652,7 +1638,7 @@ if (strlen($_SESSION['message']) > 0) {
 						<table cellpadding='0' cellspacing='1' border='0' width='100%' style='margin-bottom: 60px;'>
 						<table cellpadding='0' cellspacing='1' border='0' width='100%' style='margin-bottom: 60px;'>
 
 
 							<tr>
 							<tr>
-								<td class='main_content' valign='top' align='center'>
+								<td id='main_content' valign='top' align='center'>
 									<!--{body}-->
 									<!--{body}-->
 								</td>
 								</td>
 							</tr>
 							</tr>

+ 17 - 23
themes/minimized/template.php

@@ -470,7 +470,6 @@ table.tr_hover tr:hover td a {
 
 
 .border {
 .border {
 	border: solid 1px #a4aebf;
 	border: solid 1px #a4aebf;
-	/*background-color: #FFFFFF;*/
 }
 }
 
 
 
 
@@ -488,9 +487,7 @@ table.tr_hover tr:hover td a {
 }
 }
 
 
 table {
 table {
-	/*background:#ccc;*/
-	/*margin:20px;*/
-	/*border:#ccc 1px solid;*/
+
 }
 }
 
 
 table th {
 table th {
@@ -498,8 +495,7 @@ table th {
 }
 }
 
 
 table td {
 table td {
-	/*background:#fff;*/
-	/*padding:2px 10px 4px 10px*/
+
 }
 }
 
 
 table tr.even td {
 table tr.even td {
@@ -568,10 +564,10 @@ legend {
 		)) { ?>
 		)) { ?>
 		background-color: #FFFFFF;
 		background-color: #FFFFFF;
 		background-attachment: fixed;
 		background-attachment: fixed;
-		opacity: 0.93;
-		filter:alpha(opacity=93);
-		-moz-opacity:0.93;
-		-khtml-opacity: 0.93;
+		opacity: <?php echo ($_SESSION['theme']['body_opacity']['text'] != '') ? $_SESSION['theme']['body_opacity']['text'] : "0.93"; ?>;
+		filter:alpha(opacity=<?php echo ($_SESSION['theme']['body_opacity']['text'] != '') ? (100 * (float) $_SESSION['theme']['body_opacity']['text']) : "93"; ?>);
+		-moz-opacity: <?php echo ($_SESSION['theme']['body_opacity']['text'] != '') ? $_SESSION['theme']['body_opacity']['text'] : "0.93"; ?>;
+		-khtml-opacity: <?php echo ($_SESSION['theme']['body_opacity']['text'] != '') ? $_SESSION['theme']['body_opacity']['text'] : "0.93"; ?>;
 		-webkit-border-radius: 4px;
 		-webkit-border-radius: 4px;
 		-moz-border-radius: 4px;
 		-moz-border-radius: 4px;
 		border-radius: 4px;
 		border-radius: 4px;
@@ -594,17 +590,17 @@ legend {
 		right: 0;
 		right: 0;
 		z-index: 10001;
 		z-index: 10001;
 		text-align: left;
 		text-align: left;
-		opacity: 0.93;
-		filter:alpha(opacity=93);
-		-moz-opacity:0.93;
-		-khtml-opacity: 0.93;
 	}
 	}
 
 
 	#menu_bar_content {
 	#menu_bar_content {
 		background-image: url('<!--{project_path}-->/themes/minimized/images/background_black.png');
 		background-image: url('<!--{project_path}-->/themes/minimized/images/background_black.png');
 		background-position: 0px -1px;
 		background-position: 0px -1px;
-		background-color: #000000;
 		background-repeat: repeat-x;
 		background-repeat: repeat-x;
+		background-color: #000000;
+		opacity: <?php echo ($_SESSION['theme']['menu_opacity']['text'] != '') ? $_SESSION['theme']['menu_opacity']['text'] : "0.93"; ?>;
+		filter:alpha(opacity=<?php echo ($_SESSION['theme']['menu_opacity']['text'] != '') ? (100 * (float) $_SESSION['theme']['menu_opacity']['text']) : "93"; ?>);
+		-moz-opacity: <?php echo ($_SESSION['theme']['menu_opacity']['text'] != '') ? $_SESSION['theme']['menu_opacity']['text'] : "0.93"; ?>;
+		-khtml-opacity: <?php echo ($_SESSION['theme']['menu_opacity']['text'] != '') ? $_SESSION['theme']['menu_opacity']['text'] : "0.93"; ?>;
 		-webkit-border-radius: 0px 0px 4px 4px;
 		-webkit-border-radius: 0px 0px 4px 4px;
 		-moz-border-radius: 0px 0px 4px 4px;
 		-moz-border-radius: 0px 0px 4px 4px;
 		border-radius: 0px 0px 4px 4px;
 		border-radius: 0px 0px 4px 4px;
@@ -649,7 +645,6 @@ legend {
 		font-weight: normal;
 		font-weight: normal;
 		font-family: Arial, Helvetica, sans-serif;
 		font-family: Arial, Helvetica, sans-serif;
 		display:block;
 		display:block;
-		/*border-color:#ccc #888 #555 #bbb;*/
 		white-space:nowrap;
 		white-space:nowrap;
 		margin:0;
 		margin:0;
 		padding: 3px;
 		padding: 3px;
@@ -685,7 +680,7 @@ legend {
 	}
 	}
 
 
 	#menu .menu_sub {
 	#menu .menu_sub {
-		display:none;
+		display: none;
 		top: 31px;
 		top: 31px;
 		padding: 5px 0px 10px 0px;
 		padding: 5px 0px 10px 0px;
 		<?php
 		<?php
@@ -702,7 +697,8 @@ legend {
 			echo "width:190px;\n";
 			echo "width:190px;\n";
 		}
 		}
 		?>
 		?>
-		background: #141414;
+		background-color: #141414;
+		background: rgba(<?php echo hex2rgb("#141414", ','); ?>, <?php echo ($_SESSION['theme']['menu_opacity']['text'] != '') ? $_SESSION['theme']['menu_opacity']['text'] : "0.95"; ?>);
 		-webkit-border-radius: 0 0 3px 3px;
 		-webkit-border-radius: 0 0 3px 3px;
 		-moz-border-radius: 0 0 3px 3px;
 		-moz-border-radius: 0 0 3px 3px;
 		border-radius: 0 0 3px 3px;
 		border-radius: 0 0 3px 3px;
@@ -712,9 +708,9 @@ legend {
 	}
 	}
 
 
 	#menu a:hover{
 	#menu a:hover{
-		width:114px;
-		color:#fd9c03;
-		background:#1F1F1F;
+		width: 114px;
+		color: #fd9c03;
+		background-color: #141414;
 		-webkit-border-radius: 3px;
 		-webkit-border-radius: 3px;
 		-moz-border-radius: 3px;
 		-moz-border-radius: 3px;
 		border-radius: 3px;
 		border-radius: 3px;
@@ -758,7 +754,6 @@ legend {
 		-webkit-border-radius: 3px;
 		-webkit-border-radius: 3px;
 		-moz-border-radius: 3px;
 		-moz-border-radius: 3px;
 		border-radius: 3px;
 		border-radius: 3px;
-		/*background:#1F1F1F url(<!--{project_path}-->/css/images/expand3.gif) no-repeat -999px -9999px;*/
 	}
 	}
 
 
 	div#menu li:hover{
 	div#menu li:hover{
@@ -781,7 +776,6 @@ legend {
 	#menu a.x, #menu a.x:visited{
 	#menu a.x, #menu a.x:visited{
 		font-weight:bold;
 		font-weight:bold;
 		color:#000;
 		color:#000;
-		/*background:#a4aebf url(<!--{project_path}-->/css/images/expand3.gif) no-repeat 100% 100%;*/
 	}
 	}
 
 
 	#menu a.x:hover{
 	#menu a.x:hover{