Просмотр исходного кода

add option for weather, default is off. Fixed #662

causefx 8 лет назад
Родитель
Сommit
b37f4fb2fe
3 измененных файлов с 371 добавлено и 346 удалено
  1. 2 0
      config/configDefaults.php
  2. 262 259
      index.php
  3. 107 87
      settings.php

+ 2 - 0
config/configDefaults.php

@@ -99,4 +99,6 @@ return array(
 	"couchURL" => "",
 	"couchAPI" => "",
 	"couchHomeAuth" => false,
+	"weather" => "false",
+	"weatherAuth" => "false",
 );

+ 262 - 259
index.php

@@ -19,7 +19,7 @@ ini_set("error_reporting", E_ALL | E_STRICT);
 $data = false;
 $databaseLocation = "databaseLocation.ini.php";
 $needSetup = "Yes";
-$tabSetup = "Yes";	
+$tabSetup = "Yes";
 $hasOptions = "No";
 $settingsicon = "No";
 $settingsActive = "";
@@ -67,7 +67,7 @@ if (file_exists('config/config.php')) {
 	$configReady = "Yes";
 	require_once("user.php");
 	$USER = new User("registration_callback");
-	
+
 	$dbfile = DATABASE_LOCATION  . constant('User::DATABASE_NAME') . ".db";
 	$database = new PDO("sqlite:" . $dbfile);
 	$query = "SELECT * FROM users";
@@ -102,7 +102,7 @@ if (file_exists('config/config.php')) {
 		}
 	}
 
-	if($tabSetup == "No") {	
+	if($tabSetup == "No") {
 		if($USER->authenticated && $USER->role == "admin") {
 			$result = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" ORDER BY `order` asc'));
 			$splash = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND splash = "true" ORDER BY `order` asc'));
@@ -150,7 +150,7 @@ if (file_exists('config/config.php')) {
 										(id INTEGER PRIMARY KEY,
 										timestamp INTEGER NOT NULL,
 										user TEXT NOT NULL)";
-						
+
 						$onlinetable = "CREATE TABLE IF NOT EXISTS chatpack_last_message
 										(
 										user TEXT PRIMARY KEY NOT NULL,
@@ -198,13 +198,13 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 ?>
 <!--
 
-	___       ___       ___       ___       ___       ___       ___       ___   
-   /\  \     /\  \     /\  \     /\  \     /\__\     /\  \     /\  \     /\  \  
-  /::\  \   /::\  \   /::\  \   /::\  \   /:| _|_   _\:\  \   _\:\  \   /::\  \ 
+	___       ___       ___       ___       ___       ___       ___       ___
+   /\  \     /\  \     /\  \     /\  \     /\__\     /\  \     /\  \     /\  \
+  /::\  \   /::\  \   /::\  \   /::\  \   /:| _|_   _\:\  \   _\:\  \   /::\  \
  /:/\:\__\ /::\:\__\ /:/\:\__\ /::\:\__\ /::|/\__\ /\/::\__\ /::::\__\ /::\:\__\
  \:\/:/  / \;:::/  / \:\:\/__/ \/\::/  / \/|::/  / \::/\/__/ \::;;/__/ \;:::/  /
-  \::/  /   |:\/__/   \::/  /    /:/  /    |:/  /   \:\__\    \:\__\    |:\/__/ 
-   \/__/     \|__|     \/__/     \/__/     \/__/     \/__/     \/__/     \|__|  
+  \::/  /   |:\/__/   \::/  /    /:/  /    |:/  /   \:\__\    \:\__\    |:\/__/
+   \/__/     \|__|     \/__/     \/__/     \/__/     \/__/     \/__/     \|__|
 
 					  [Organizr Version: <?php echo INSTALLEDVERSION; ?> - By: CauseFX]
 
@@ -216,7 +216,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 	<head>
 		<meta charset="UTF-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
-		<meta name="apple-mobile-web-app-capable" content="yes" />   
+		<meta name="apple-mobile-web-app-capable" content="yes" />
 		<meta name="mobile-web-app-capable" content="yes" /
 		<meta http-equiv="X-UA-Compatible" content="IE=edge">
 		<meta name="msapplication-tap-highlight" content="no" />
@@ -408,11 +408,11 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
 			background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
 		}img.titlelogoclass {
-			max-width: 250px; 
+			max-width: 250px;
 			max-height: <?=$slimBar;?>px;
 		}@media only screen and (max-width: 450px) {
 			img.titlelogoclass {
-				max-width: 150px; 
+				max-width: 150px;
 			}
 		}.login-btn {
 			-webkit-border-radius: 4;
@@ -522,15 +522,15 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 								<!--Start Tab List-->
 								<?php
 								if($tabSetup == "No") {
-									$tabCount = 1; 
-									$allPings = array(); 
+									$tabCount = 1;
+									$allPings = array();
 									if (is_array($result)) {
 										foreach($result as $row) {
 											$name = str_replace(array(':', '\\', '/', '*'), 'x', $row['ping_url']);
-											if($row['defaultz'] == "true") { 
-												$defaultz = "active"; 
-											}else { 
-												$defaultz = ""; 
+											if($row['defaultz'] == "true") {
+												$defaultz = "active";
+											}else {
+												$defaultz = "";
 											} ?>
 									<li window="<?=$row['window'];?>" class="tab-item <?=$defaultz;?>" id="<?=$row['url'];?>x" data-title="<?=$row['name'];?>" name="<?php echo strtolower($row['name']);?>">
 										<a class="tab-link">
@@ -554,9 +554,9 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 										</a>
 
 									</li>
-									<?php 
-										$tabCount++; 
-										}; 
+									<?php
+										$tabCount++;
+										};
 									}
 								}?>
 								<?php if($configReady == "Yes") : if($USER->authenticated && $USER->role == "admin") :?>
@@ -595,15 +595,15 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 				</li>
 
 				<li class="top-clock">
-					<?php 
-					if($configReady == "Yes") : 
-						if(TITLELOGO == "") : 
-							echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>"; 
-						else : 
+					<?php
+					if($configReady == "Yes") :
+						if(TITLELOGO == "") :
+							echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
+						else :
 							echo "<img class='titlelogoclass' src='" . TITLELOGO . "'>";
 						endif;
 					else :
-						echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>"; 
+						echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
 					endif;
 					?>
 				</li>
@@ -611,9 +611,9 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 				<li class="pull-right">
 					<ul class="nav navbar-right right-menu">
 						<?php if($configReady == "Yes"){?>
-						<li class="dropdown some-btn">	
+						<li class="dropdown some-btn">
 							<a class="show-members">
-								<i class="userpic"><?=$showPic;?></i> 
+								<i class="userpic"><?=$showPic;?></i>
 							</a>
 						</li>
 						<?php if(!$USER->authenticated){?>
@@ -622,7 +622,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 								<login class='login-btn text-uppercase'><?php echo $language->translate("LOGIN"); ?></login>
 							</a>
 						</li>
-						<?php } }?>								
+						<?php } }?>
 
 						<?php if(CHAT == "true" && qualifyUser(CHATAUTH)){?>
 						<li class="dropdown some-btn">
@@ -639,7 +639,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			<!--Content-->
 			<div id="content" class="content" style="">
 				<script>addToHomescreen();</script>
-				
+
 				<!--Load Framed Content-->
 				<?php if($needSetup == "Yes" && $configReady == "Yes") : ?>
 				<div class="table-wrapper" style="background:<?=$sidebar;?>;">
@@ -708,7 +708,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 
 				</div>
 				<?php endif; ?>
-				
+
 				<?php if($needSetup == "Yes" && $configReady == "No") : ?>
 				<div class="table-wrapper" style="background:<?=$sidebar;?>;">
 
@@ -739,11 +739,11 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 												<h5><?php echo $language->translate("SET_DATABASE_LOCATION");?></h5>
 												<?php echo getTimezone();?>
 												<h5><?php echo $language->translate("SET_TIMEZONE");?></h5>
-												<?php 
-												if(file_exists(dirname(__DIR__) . '/users.db') || file_exists(__DIR__ . '/users.db') || file_exists(__DIR__ . '/config/users.db')) : 
+												<?php
+												if(file_exists(dirname(__DIR__) . '/users.db') || file_exists(__DIR__ . '/users.db') || file_exists(__DIR__ . '/config/users.db')) :
 												echo '<h5 class="text-center red">';
 												echo $language->translate("DONT_WORRY");
-												echo '</h5>'; 
+												echo '</h5>';
 												endif;?>
 
 											</div>
@@ -764,7 +764,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 
 				</div>
 				<?php endif; ?>
-				
+
 				<?php if($configReady == "Yes") : if(!$USER->authenticated && $tabSetup == "Yes" && $needSetup == "No") :?>
 				<div class="table-wrapper">
 					<div class="table-row">
@@ -784,7 +784,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 					</div>
 				</div>
 				<?php endif; endif; ?>
-				<?php if($tabSetup == "No" && $needSetup == "No") :?>        
+				<?php if($tabSetup == "No" && $needSetup == "No") :?>
 				<div id="tabEmpty" class="table-wrapper" style="display: none; background:<?=$sidebar;?>;">
 					<div class="table-row">
 						<div class="table-cell text-center">
@@ -846,7 +846,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 											<input type="password" class="form-control material" name="password1" value="" autocomplete="off" placeholder="<?php echo $language->translate("PASSWORD");?>" required>
 										</div>
 										<div class="form-group">
-											<div class="i-block"> <input id="rememberMe" name="rememberMe" class="switcher switcher-success switcher-medium pull-left" value="true" type="checkbox" checked=""> 
+											<div class="i-block"> <input id="rememberMe" name="rememberMe" class="switcher switcher-success switcher-medium pull-left" value="true" type="checkbox" checked="">
 												<label for="rememberMe" class="pull-left"></label>
 												<label class="pull-right"> &nbsp; <?php echo $language->translate("REMEMBER_ME");?></label>
 											</div>
@@ -855,7 +855,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 
 										<button id="loginSubmit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="log in" onclick="User.processLogin()"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("LOGIN");?></text></button>
 
-									</form> 
+									</form>
 									<?php if (ENABLEMAIL == "true") : ?>
 									<button id="switchForgot" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("FORGOT_PASSWORD");?></text></button>
 									<?php endif; ?>
@@ -871,7 +871,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 
 										<button style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="reset password"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("RESET_PASSWORD");?></text></button>
 
-									</form> 
+									</form>
 									<button id="welcomeGoBack" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
 									<?php if(REGISTERPASSWORD != "") : ?>
 									<div id="userPassForm" style="display: none;">
@@ -922,7 +922,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 										<button id="registerSubmit" type="submit" class="btn green-bg btn-block btn-warning text-uppercase waves waves-effect waves-float" value="Register"><?php echo $language->translate("REGISTER");?></button>
 										<button id="welcomeGoBack3" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
 
-									</form> 
+									</form>
 									<?php endif; ?>
 								</div>
 							</div>
@@ -987,14 +987,14 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 
 										<button id="checkInviteForm_submit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="checkInvite"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SUBMIT_CODE");?></text></button>
 
-									</form> 
-									
+									</form>
+
 									<div style="display: none" id="chooseMethod">
 										<h4 class="text-center"><?php echo $language->translate("HAVE_ACCOUNT");?></h4>
 										<button id="yesPlexButton" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("YES");?></text></button>
 										<button id="noPlexButton" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("NO");?></text></button>
 									</div>
-									
+
 									<form style="display:none" name="useInviteForm" id="useInviteForm" onsubmit="return false;" data-smk-icon="glyphicon-remove-sign">
 										<h4 class="text-center"><?php echo $language->translate("ENTER_PLEX_NAME");?></h4>
 										<h4 id="accountMade" style="display: none" class="text-center">
@@ -1031,7 +1031,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 										<button id="joinPlexForm_submit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="useInvite"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SIGN_UP");?></text></button>
 										<button id="plexNoGoBack" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
 
-									</form> 
+									</form>
 
 								</div>
 							</div>
@@ -1044,14 +1044,14 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 		<?php if (file_exists('config/config.php') && $configReady == "Yes" && $tabSetup == "No" && SPLASH == "true" && $splash) {?>
 		<div id="splashScreen" class="splash-modal modal fade">
 			<div style="background:<?=$sidebar;?>;" class="table-wrapper big-box">
-				
+
 				<button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
 					<span aria-hidden="true">&times;</span>
 				</button>
 				<br/><br/>
 				<div class="row">
 					<div class="col-lg-12">
-						<div class="row">                      
+						<div class="row">
 							<?php if($tabSetup == "No") : $tabCount = 1; foreach($splash as $row) : ?>
 							<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2" id="splash-<?php echo strtolower($row['name']);?>">
 								<li style="list-style-type: none; cursor: pointer;" window="<?=$row['window'];?>" class="splash-item content-box small-box ultra-widget gray-bg" name="<?php echo strtolower($row['name']);?>">
@@ -1071,10 +1071,10 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 									</div>
 								</li>
 							</div>
-							<?php $tabCount++; endforeach; endif;?>  
+							<?php $tabCount++; endforeach; endif;?>
 						</div>
 						<?php if( $USER->authenticated && $USER->role == "admin" ){ ?>
-						<div class="row">                      
+						<div class="row">
 							<div class="col-lg-12">
 								<li style="list-style-type: none; cursor: pointer;" class="splash-item content-box small-box ultra-widget gray-bg" data-title="" name="settings">
 									<div class="w-content">
@@ -1102,7 +1102,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			<div class="email-body">
 				<div class="email-inner small-box" style="padding: 0">
 					<div class="email-inner-section" style="margin-top: 0;">
-						<div class="small-box fade in" style="padding: 0">											
+						<div class="small-box fade in" style="padding: 0">
 							<div class="main-wrapper" style="position: initial; left:0;">
 								<div id="content">
 									<div class="btn-group btn-group-justified grayish-blue-bg">
@@ -1148,7 +1148,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 										</div>
 									</div>
 								</div>
-							</div>		
+							</div>
 						</div>
 					</div>
 				</div>
@@ -1161,7 +1161,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			<div class="email-body">
 				<div class="email-inner small-box" style="padding: 0">
 					<div class="email-inner-section" style="margin-top: 0;">
-						<div class="small-box fade in" style="padding: 0">											
+						<div class="small-box fade in" style="padding: 0">
 							<div class="main-wrapper" style="position: initial; left:0;">
 								<div id="content">
 									<div class="btn-group btn-group-justified grayish-blue-bg">
@@ -1321,187 +1321,190 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 		<script src="<?=$baseURL;?>js/jquery.simpleWeather.js"></script>
 		<script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
 		<?php if(CHAT == "true" && qualifyUser(CHATAUTH)){?>
-		<script src="chatjs.php" defer="true"></script>
-		<script type="text/javascript">
-		var scrolling = function(e, c) {
-			e.scrollIntoView();
-			if (c < 5) setTimeout(scrolling, 300, e, c + 1);
-		};
-		var ensureVisible = function(e) {
-			setTimeout(scrolling, 300, e, 0);
-		};
-		var mainchatdiv = document.getElementById('main-chat');
-		mainchatdiv.addEventListener('touchmove', function(e) {
-
-			e.preventDefault();
-
-		}, false);  
-   		</script>
+			<script src="chatjs.php" defer="true"></script>
+			<script type="text/javascript">
+			var scrolling = function(e, c) {
+				e.scrollIntoView();
+				if (c < 5) setTimeout(scrolling, 300, e, c + 1);
+			};
+			var ensureVisible = function(e) {
+				setTimeout(scrolling, 300, e, 0);
+			};
+			var mainchatdiv = document.getElementById('main-chat');
+			mainchatdiv.addEventListener('touchmove', function(e) {
+
+				e.preventDefault();
+
+			}, false);
+	   	</script>
 		<?php }?>
-		<script>
-		/* Does your browser support geolocation? */
-		if ("geolocation" in navigator) {
-			$('#weather').show(); 
-		} else {
-			$('#weathern').hide();
-		}
-		function setWeatherIcon(condid) {
-		var icon = '';
-			switch(condid) {
-				case '0': icon  = 'wi-tornado';
-				break;
-				case '1': icon = 'wi-storm-showers';
-				break;
-				case '2': icon = 'wi-tornado';
-				break;
-				case '3': icon = 'wi-thunderstorm';
-				break;
-				case '4': icon = 'wi-thunderstorm';
-				break;
-				case '5': icon = 'wi-snow';
-				break;
-				case '6': icon = 'wi-rain-mix';
-				break;
-				case '7': icon = 'wi-rain-mix';
-				break;
-				case '8': icon = 'wi-sprinkle';
-				break;
-				case '9': icon = 'wi-sprinkle';
-				break;
-				case '10': icon = 'wi-hail';
-				break;
-				case '11': icon = 'wi-showers';
-				break;
-				case '12': icon = 'wi-showers';
-				break;
-				case '13': icon = 'wi-snow';
-				break;
-				case '14': icon = 'wi-storm-showers';
-				break;
-				case '15': icon = 'wi-snow';
-				break;
-				case '16': icon = 'wi-snow';
-				break;
-				case '17': icon = 'wi-hail';
-				break;
-				case '18': icon = 'wi-hail';
-				break;
-				case '19': icon = 'wi-cloudy-gusts';
-				break;
-				case '20': icon = 'wi-fog';
-				break;
-				case '21': icon = 'wi-fog';
-				break;
-				case '22': icon = 'wi-fog';
-				break;
-				case '23': icon = 'wi-cloudy-gusts';
-				break;
-				case '24': icon = 'wi-cloudy-windy';
-				break;
-				case '25': icon = 'wi-thermometer';
-				break;
-				case '26': icon = 'wi-cloudy';
-				break;
-				case '27': icon = 'wi-night-cloudy';
-				break;
-				case '28': icon = 'wi-day-cloudy';
-				break;
-				case '29': icon = 'wi-night-cloudy';
-				break;
-				case '30': icon = 'wi-day-cloudy';
-				break;
-				case '31': icon = 'wi-night-clear';
-				break;
-				case '32': icon = 'wi-day-sunny';
-				break;
-				case '33': icon = 'wi-night-clear';
-				break;
-				case '34': icon = 'wi-day-sunny-overcast';
-				break;
-				case '35': icon = 'wi-hail';
-				break;
-				case '36': icon = 'wi-day-sunny';
-				break;
-				case '37': icon = 'wi-thunderstorm';
-				break;
-				case '38': icon = 'wi-thunderstorm';
-				break;
-				case '39': icon = 'wi-thunderstorm';
-				break;
-				case '40': icon = 'wi-storm-showers';
-				break;
-				case '41': icon = 'wi-snow';
-				break;
-				case '42': icon = 'wi-snow';
-				break;
-				case '43': icon = 'wi-snow';
-				break;
-				case '44': icon = 'wi-cloudy';
-				break;
-				case '45': icon = 'wi-lightning';
-				break;
-				case '46': icon = 'wi-snow';
-				break;
-				case '47': icon = 'wi-thunderstorm';
-				break;
-				case '3200': icon = 'wi-cloud';
-				break;
-				default: icon = 'wi-cloud';
-				break;
+		<?php if(WEATHER == "true" && qualifyUser(WEATHERAUTH)){?>
+			<script>
+			/* Does your browser support geolocation? */
+			if ("geolocation" in navigator) {
+				$('#weather').show();
+			} else {
+				$('#weathern').hide();
 			}
-		
-			return '<i class="wi '+icon+' wi-fw"></i>';
-		}
-		$(document).ready(function() {
-			getWeather();
-			setInterval(getWeather, 600000);
-		});
-		function getWeather(){
-			navigator.geolocation.getCurrentPosition(function(position) {
-				loadWeather(position.coords.latitude+','+position.coords.longitude);
-			});
-			console.log('grabbing weather');
-		}
-		function loadWeather(location, woeid) {
-			$.simpleWeather({
-				location: location,
-				woeid: woeid,
-				unit: 'f',
-				success: function(weather) {
-					//html = '<h5 class="text-uppercase text-center">Weather For '+weather.city+', '+weather.region+'</h5>';
-					html = '<h5 class="text-center yellow">Current Weather</h5>';
-					html += '<div class="content-box ultra-widget yellow-bg">';
-					html += '<div class="w-icon right pull-right">'+setWeatherIcon(weather.code)+'</div>';
-					html += '<div class="w-descr left pull-left text-center">';
-					html += '<span class="w-name">'+weather.temp+'&deg;'+weather.units.temp+' / '+weather.alt.temp+'&deg;C</span><br>';
-					html += '<span class="w-name">'+weather.currently+'</span>';
-					html += '</div></div>';
-					//Forecast
-					html += '<div class="content-box big-box"><h4 class="">'+weather.city+', '+weather.region+' Forecast</h4><div class="table-responsive"><table class="table table-striped table-condensed">';
-					//html += '<caption>'+weather.city+', '+weather.region+'</caption>';
-					html += '<thead><tr><th>Day</th><th>High</th><th>Low</th><th>Weather</th><th>Visual</th></tr></thead><tbody>';
-					//Days
-					html += '<tr><th scope="row">'+weather.forecast[0].day+'</th><td>'+weather.forecast[0].high+'&deg;'+weather.units.temp+' / '+weather.forecast[0].alt.high+'&deg;C</td>';
-					html += '<td>'+weather.forecast[0].low+'&deg;'+weather.units.temp+' / '+weather.forecast[0].alt.low+'&deg;C</td><td>'+weather.forecast[0].text+'</td><td>'+setWeatherIcon(weather.forecast[0].code)+'</td></tr>';
-					html += '<tr><th scope="row">'+weather.forecast[1].day+'</th><td>'+weather.forecast[1].high+'&deg;'+weather.units.temp+' / '+weather.forecast[1].alt.high+'&deg;C</td>';
-					html += '<td>'+weather.forecast[1].low+'&deg;'+weather.units.temp+' / '+weather.forecast[1].alt.low+'&deg;C</td><td>'+weather.forecast[1].text+'</td><td>'+setWeatherIcon(weather.forecast[1].code)+'</td></tr>';
-					html += '<tr><th scope="row">'+weather.forecast[2].day+'</th><td>'+weather.forecast[2].high+'&deg;'+weather.units.temp+' / '+weather.forecast[2].alt.high+'&deg;C</td>';
-					html += '<td>'+weather.forecast[2].low+'&deg;'+weather.units.temp+' / '+weather.forecast[2].alt.low+'&deg;C</td><td>'+weather.forecast[2].text+'</td><td>'+setWeatherIcon(weather.forecast[2].code)+'</td></tr>';
-					html += '<tr><th scope="row">'+weather.forecast[3].day+'</th><td>'+weather.forecast[3].high+'&deg;'+weather.units.temp+' / '+weather.forecast[3].alt.high+'&deg;C</td>';
-					html += '<td>'+weather.forecast[3].low+'&deg;'+weather.units.temp+' / '+weather.forecast[3].alt.low+'&deg;C</td><td>'+weather.forecast[3].text+'</td><td>'+setWeatherIcon(weather.forecast[3].code)+'</td></tr>';
-					html += '<tr><th scope="row">'+weather.forecast[4].day+'</th><td>'+weather.forecast[4].high+'&deg;'+weather.units.temp+' / '+weather.forecast[4].alt.high+'&deg;C</td>';
-					html += '<td>'+weather.forecast[4].low+'&deg;'+weather.units.temp+' / '+weather.forecast[4].alt.low+'&deg;C</td><td>'+weather.forecast[4].text+'</td><td>'+setWeatherIcon(weather.forecast[4].code)+'</td></tr>';
-					//Days End
-					html += '</tbody></table></div></div>';
-
-					$("#weather").html(html);
-				},
-				error: function(error) {
-					$("#weather").html('<p>'+error+'</p>');
+			function setWeatherIcon(condid) {
+			var icon = '';
+				switch(condid) {
+					case '0': icon  = 'wi-tornado';
+					break;
+					case '1': icon = 'wi-storm-showers';
+					break;
+					case '2': icon = 'wi-tornado';
+					break;
+					case '3': icon = 'wi-thunderstorm';
+					break;
+					case '4': icon = 'wi-thunderstorm';
+					break;
+					case '5': icon = 'wi-snow';
+					break;
+					case '6': icon = 'wi-rain-mix';
+					break;
+					case '7': icon = 'wi-rain-mix';
+					break;
+					case '8': icon = 'wi-sprinkle';
+					break;
+					case '9': icon = 'wi-sprinkle';
+					break;
+					case '10': icon = 'wi-hail';
+					break;
+					case '11': icon = 'wi-showers';
+					break;
+					case '12': icon = 'wi-showers';
+					break;
+					case '13': icon = 'wi-snow';
+					break;
+					case '14': icon = 'wi-storm-showers';
+					break;
+					case '15': icon = 'wi-snow';
+					break;
+					case '16': icon = 'wi-snow';
+					break;
+					case '17': icon = 'wi-hail';
+					break;
+					case '18': icon = 'wi-hail';
+					break;
+					case '19': icon = 'wi-cloudy-gusts';
+					break;
+					case '20': icon = 'wi-fog';
+					break;
+					case '21': icon = 'wi-fog';
+					break;
+					case '22': icon = 'wi-fog';
+					break;
+					case '23': icon = 'wi-cloudy-gusts';
+					break;
+					case '24': icon = 'wi-cloudy-windy';
+					break;
+					case '25': icon = 'wi-thermometer';
+					break;
+					case '26': icon = 'wi-cloudy';
+					break;
+					case '27': icon = 'wi-night-cloudy';
+					break;
+					case '28': icon = 'wi-day-cloudy';
+					break;
+					case '29': icon = 'wi-night-cloudy';
+					break;
+					case '30': icon = 'wi-day-cloudy';
+					break;
+					case '31': icon = 'wi-night-clear';
+					break;
+					case '32': icon = 'wi-day-sunny';
+					break;
+					case '33': icon = 'wi-night-clear';
+					break;
+					case '34': icon = 'wi-day-sunny-overcast';
+					break;
+					case '35': icon = 'wi-hail';
+					break;
+					case '36': icon = 'wi-day-sunny';
+					break;
+					case '37': icon = 'wi-thunderstorm';
+					break;
+					case '38': icon = 'wi-thunderstorm';
+					break;
+					case '39': icon = 'wi-thunderstorm';
+					break;
+					case '40': icon = 'wi-storm-showers';
+					break;
+					case '41': icon = 'wi-snow';
+					break;
+					case '42': icon = 'wi-snow';
+					break;
+					case '43': icon = 'wi-snow';
+					break;
+					case '44': icon = 'wi-cloudy';
+					break;
+					case '45': icon = 'wi-lightning';
+					break;
+					case '46': icon = 'wi-snow';
+					break;
+					case '47': icon = 'wi-thunderstorm';
+					break;
+					case '3200': icon = 'wi-cloud';
+					break;
+					default: icon = 'wi-cloud';
+					break;
 				}
-			});
-		}
 
+				return '<i class="wi '+icon+' wi-fw"></i>';
+			}
+			$(document).ready(function() {
+				getWeather();
+				setInterval(getWeather, 600000);
+			});
+			function getWeather(){
+				navigator.geolocation.getCurrentPosition(function(position) {
+					loadWeather(position.coords.latitude+','+position.coords.longitude);
+				});
+				console.log('grabbing weather');
+			}
+			function loadWeather(location, woeid) {
+				$.simpleWeather({
+					location: location,
+					woeid: woeid,
+					unit: 'f',
+					success: function(weather) {
+						//html = '<h5 class="text-uppercase text-center">Weather For '+weather.city+', '+weather.region+'</h5>';
+						html = '<h5 class="text-center yellow">Current Weather</h5>';
+						html += '<div class="content-box ultra-widget yellow-bg">';
+						html += '<div class="w-icon right pull-right">'+setWeatherIcon(weather.code)+'</div>';
+						html += '<div class="w-descr left pull-left text-center">';
+						html += '<span class="w-name">'+weather.temp+'&deg;'+weather.units.temp+' / '+weather.alt.temp+'&deg;C</span><br>';
+						html += '<span class="w-name">'+weather.currently+'</span>';
+						html += '</div></div>';
+						//Forecast
+						html += '<div class="content-box big-box"><h4 class="">'+weather.city+', '+weather.region+' Forecast</h4><div class="table-responsive"><table class="table table-striped table-condensed">';
+						//html += '<caption>'+weather.city+', '+weather.region+'</caption>';
+						html += '<thead><tr><th>Day</th><th>High</th><th>Low</th><th>Weather</th><th>Visual</th></tr></thead><tbody>';
+						//Days
+						html += '<tr><th scope="row">'+weather.forecast[0].day+'</th><td>'+weather.forecast[0].high+'&deg;'+weather.units.temp+' / '+weather.forecast[0].alt.high+'&deg;C</td>';
+						html += '<td>'+weather.forecast[0].low+'&deg;'+weather.units.temp+' / '+weather.forecast[0].alt.low+'&deg;C</td><td>'+weather.forecast[0].text+'</td><td>'+setWeatherIcon(weather.forecast[0].code)+'</td></tr>';
+						html += '<tr><th scope="row">'+weather.forecast[1].day+'</th><td>'+weather.forecast[1].high+'&deg;'+weather.units.temp+' / '+weather.forecast[1].alt.high+'&deg;C</td>';
+						html += '<td>'+weather.forecast[1].low+'&deg;'+weather.units.temp+' / '+weather.forecast[1].alt.low+'&deg;C</td><td>'+weather.forecast[1].text+'</td><td>'+setWeatherIcon(weather.forecast[1].code)+'</td></tr>';
+						html += '<tr><th scope="row">'+weather.forecast[2].day+'</th><td>'+weather.forecast[2].high+'&deg;'+weather.units.temp+' / '+weather.forecast[2].alt.high+'&deg;C</td>';
+						html += '<td>'+weather.forecast[2].low+'&deg;'+weather.units.temp+' / '+weather.forecast[2].alt.low+'&deg;C</td><td>'+weather.forecast[2].text+'</td><td>'+setWeatherIcon(weather.forecast[2].code)+'</td></tr>';
+						html += '<tr><th scope="row">'+weather.forecast[3].day+'</th><td>'+weather.forecast[3].high+'&deg;'+weather.units.temp+' / '+weather.forecast[3].alt.high+'&deg;C</td>';
+						html += '<td>'+weather.forecast[3].low+'&deg;'+weather.units.temp+' / '+weather.forecast[3].alt.low+'&deg;C</td><td>'+weather.forecast[3].text+'</td><td>'+setWeatherIcon(weather.forecast[3].code)+'</td></tr>';
+						html += '<tr><th scope="row">'+weather.forecast[4].day+'</th><td>'+weather.forecast[4].high+'&deg;'+weather.units.temp+' / '+weather.forecast[4].alt.high+'&deg;C</td>';
+						html += '<td>'+weather.forecast[4].low+'&deg;'+weather.units.temp+' / '+weather.forecast[4].alt.low+'&deg;C</td><td>'+weather.forecast[4].text+'</td><td>'+setWeatherIcon(weather.forecast[4].code)+'</td></tr>';
+						//Days End
+						html += '</tbody></table></div></div>';
+
+						$("#weather").html(html);
+					},
+					error: function(error) {
+						$("#weather").html('<p>'+error+'</p>');
+					}
+				});
+			}
+			</script>
+		<?php } ?>
+		<script>
 		var datetime = null,
         date = null;
 
@@ -1526,7 +1529,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
             scrollspeed: 30,
             mousescrollstep: 60
         });
-		<?php if (file_exists('config/config.php') && $configReady == "Yes" && $tabSetup == "No" && SPLASH == "true") {?>    
+		<?php if (file_exists('config/config.php') && $configReady == "Yes" && $tabSetup == "No" && SPLASH == "true") {?>
 		$('.splash-modal').modal("show");
 		<?php } ?>
 		var fixed = document.getElementById('gn-scroller');
@@ -1534,7 +1537,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 
 			e.preventDefault();
 
-		}, false);  
+		}, false);
 
 		function setHeight() {
 			windowHeight = $(window).innerHeight();
@@ -1546,14 +1549,14 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			var notifyIcon = notifyIcon;
 			var notifyType = notifyType;
 			var notifyLength = notifyLength;
-			var notifyLayout = notifyLayout; 
+			var notifyLayout = notifyLayout;
 			var notifyEffect = notifyEffect;
 			if (notifyEffect === "slidetop"){
 				var addMeesage = '<span class="fa fa-' + notifyIcon + ' fa-2x"></span>' + '<p>' + notifyString + '</p>';
 			}else if (notifyEffect === "exploader"){
 				var addMeesage = '<span class="fa fa-' + notifyIcon + ' fa-2x pull-left"></span>' + '<p>' + notifyString + '</p>';
 			}else if (notifyEffect === "thumbslider"){
-				var addMeesage = '<div class="ns-thumb"><img src="images/alert.png"/></div><div class="ns-content"><p>' + notifyString + '</p></div>';    
+				var addMeesage = '<div class="ns-thumb"><img src="images/alert.png"/></div><div class="ns-content"><p>' + notifyString + '</p></div>';
 			}else{
 				var addMeesage = '<p>' + notifyString + '</p>';
 			}
@@ -1609,7 +1612,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 		$("#plexYesGoBack").click(function(){
 			$("#useInviteForm").toggle();
 			$("#chooseMethod").toggle();
-		});	
+		});
 		$("#welcomeGoBack2").click(function(){
 			$( "form[id^='login']" ).toggle();
 			$("#userPassForm").toggle();
@@ -1618,7 +1621,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			$("#welcomeGoBack2").toggle();
 		});
 		$("#welcomeGoBack3").click(function(){
-			$("#registration").toggle();  
+			$("#registration").toggle();
 			$("#welcomeGoBack3").toggle();
 			$( "form[id^='login']" ).toggle();
 			$("#switchForgot").toggle();
@@ -1637,7 +1640,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			$("#switchForgot").toggle();
 			$("#switchCreateUser").toggle();
 			$("#welcomeGoBack2").toggle();
-		});  
+		});
 		//Sign in
 		$(".log-in").click(function(e){
 			var e1 = document.querySelector(".log-in"),
@@ -1649,7 +1652,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 		});
 		//InviteCode
 		<?php if(isset($_GET['inviteCode'])){ ?>
-		$('#inviteSet').modal("show");	
+		$('#inviteSet').modal("show");
 		<?php } ?>
 
 		//Logout
@@ -1677,8 +1680,8 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 		});
 
 		$(document).ready(function(){
-			
-			<?php 
+
+			<?php
 			if($configReady == "Yes"){
 				$pingCount = 1; if($USER->authenticated && $USER->role == "admin"){ $pingTimer = "60000"; }else{ $pingTimer = "600000"; }
 				foreach($allPings as $type => $ping){
@@ -1702,7 +1705,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			$('#checkInviteForm').on('submit', function () {
 				ajax_request('POST', 'validate-invite', {
 					invitecode: $('#checkInviteForm [name=inviteCode]').val(),
-				}).done(function(data){ 
+				}).done(function(data){
 					var result = JSON.stringify(data).includes("success");
 					if(result === true){
 						$('#checkInviteForm').hide();
@@ -1716,7 +1719,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 				ajax_request('POST', 'use-invite', {
 					invitecode: $('#useInviteForm [name=inviteCode]').val(),
 					inviteuser: $('#useInviteForm [name=inviteUser]').val(),
-				}).done(function(data){ 
+				}).done(function(data){
 					var result = JSON.stringify(data).includes("success");
 					console.log(result);
 					if(result === true){
@@ -1733,7 +1736,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 					joinuser: $('#joinPlexForm [name=joinUser]').val(),
 					joinemail: $('#joinPlexForm [name=joinEmail]').val(),
 					joinpassword: $('#joinPlexForm [name=joinPassword]').val(),
-				}).done(function(data){ 
+				}).done(function(data){
 					var result = JSON.stringify(data).includes("success");
 					if(result === true){
 						$('#joinPlexForm').hide();
@@ -1760,15 +1763,15 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 				};
 
 				$.ajax({
-					type        : 'POST', 
-					url         : 'register.php', 
+					type        : 'POST',
+					url         : 'register.php',
 					data        : formData,
 					dataType    : 'json',
 					encode      : true
 				})
 					.done(function(data) {
 
-						console.log(data); 
+						console.log(data);
 						if ( ! data.success) {
 
 							$('#userCreateErrors').html('Wrong Password!'); // add the actual error message under our input
@@ -1776,7 +1779,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 						} else {
 
 							$("#userPassForm").toggle();
-							$("#registration").toggle(); 
+							$("#registration").toggle();
 							$("#welcomeGoBack3").toggle();
 
 						}
@@ -1806,7 +1809,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			}
 			if (defaultTab == null){
 				$("div[id^='tabEmpty']").show();
-				<?php 
+				<?php
 				echo "console.log('Need Setup = $needSetup | Config Ready = $configReady');";
 				if($needSetup == "No" && $configReady == "Yes"){
 					if(!$USER->authenticated){
@@ -1823,13 +1826,13 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 				var getLiTab = $("li[name^='" + gotHash + "']");
 				if(gotHash === "upgrade"){ getLiTab.toggle(); console.log("got it"); }
 				getLiTab.trigger("click");
-				
 
-			}   
+
+			}
 
 			setHeight();
 
-		}); 
+		});
 		<?php if(!empty($USER->info_log)) : ?>
 
 		notify("<?php echo printArray($USER->info_log); ?>","info-circle","notice","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
@@ -1893,7 +1896,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			var activeFrame = $('#content').find('.active').children('iframe');
 			console.log(activeFrame.attr('src'));
 			window.open(activeFrame.attr('src'), '_blank');"reload"
-		});  
+		});
 		$('#chat-open').on('click tap', function(){
 			$('.chat-box').toggleClass('email-active');
 			$(".mdi-forum").removeClass("tada loop-animation new-message");//SET MESSAGE TO ZERO
@@ -1966,7 +1969,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			$("img[class^='TabOpened']").parents("li").trigger("click");
 			activeFrame.remove();
 		});
-		<?php if($iconRotate == "true") : ?>   
+		<?php if($iconRotate == "true") : ?>
 		$("li[id^='settings.phpx']").on('click tap', function(){
 
 			$("img[id^='settings-icon']").addClass("fa-spin");
@@ -1999,7 +2002,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			$('.splash-modal').modal("hide");
 
 		});
-			
+
 		$("li[class^='tab-item']").on('click vclick', function(){
 			var thisidfull = $(this).attr("id");
 			var thistitle = $(this).attr("data-title");
@@ -2047,7 +2050,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 
 					$(this).attr("class", "tab-item active");
 					jQuery(this).find("img").addClass("TabOpened");
-					
+
 				}
 
 			}
@@ -2115,13 +2118,13 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 			var previousTab = getCurrentTab.prev().attr( "class", "tab-item" );
 			previousTab.trigger("click");
 			return false;
-		}); 
+		});
 		Mousetrap.bind('ctrl+shift+down', function(e) {
 			var getCurrentTab = $("li[class^='tab-item active']");
 			var nextTab = getCurrentTab.next().attr( "class", "tab-item" );
 			nextTab.trigger("click");
 			return false;
-		});     
+		});
 
 		Mousetrap.bind('s s', function() { $("li[id^='settings.phpx']").trigger("click");  });
 		Mousetrap.bind('p p', function() { $("a[class^='fix-nav']").trigger("click");  });
@@ -2129,13 +2132,13 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 		Mousetrap.bind('r r', function() { $("button[id^='reload']").trigger("click");  });
 		Mousetrap.bind('f f', function() { $("button[class^='fullscreen']").trigger("click");  });
 		<?php if($tabSetup == "No") : foreach(range(1,$tabCount) as $index) : if ($index == 10) : break; endif;?>
-		Mousetrap.bind('ctrl+shift+<?php echo $index; ?>', function() { $("ul[id^='tabList'] li:nth-child(<?php echo $index; ?>)").trigger("click"); });    
+		Mousetrap.bind('ctrl+shift+<?php echo $index; ?>', function() { $("ul[id^='tabList'] li:nth-child(<?php echo $index; ?>)").trigger("click"); });
 		<?php endforeach; endif; ?>
 		Mousetrap.bind('esc esc', function() {
 			$("#content").attr("class", "content");
 			$("li[class^='tab-item rightActive']").attr("class", "tab-item");
 			$("#contentRight").html('');
-		});    
+		});
 		var ref = document.referrer;
 		if(ref.indexOf("updated")>=0){
 
@@ -2146,7 +2149,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
 
 			notify("<?php echo $language->translate('CUSTOM_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
 
-		} 
+		}
 		</script>
 
 	</body>

+ 107 - 87
settings.php

@@ -1,4 +1,4 @@
-<?php 
+<?php
 // Include functions if not already included
 require_once('functions.php');
 
@@ -36,11 +36,11 @@ foreach(loadAppearance() as $key => $value) {
 
 // Slimbar
 if(SLIMBAR == "true") {
-	$slimBar = "30"; 
+	$slimBar = "30";
 	$userSize = "25";
 } else {
-	$slimBar = "56"; 
-	$userSize = "40"; 
+	$slimBar = "56";
+	$userSize = "40";
 }
 //Theme Info
 $themeName = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[0] : null);
@@ -63,8 +63,8 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
         <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
         <link rel="stylesheet" href="bower_components/mdi/css/materialdesignicons.min.css">
         <link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
-        <link rel="stylesheet" href="bower_components/Waves/dist/waves.min.css"> 
-        <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css"> 
+        <link rel="stylesheet" href="bower_components/Waves/dist/waves.min.css">
+        <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css">
 
         <link rel="stylesheet" href="js/selects/cs-select.css">
         <link rel="stylesheet" href="js/selects/cs-skin-elastic.css">
@@ -92,7 +92,7 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
         <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
         <script src="bower_components/respondJs/dest/respond.min.js"></script>
         <![endif]-->
-		
+
         <!--Scripts-->
         <script src="bower_components/jquery/dist/jquery.min.js"></script>
         <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
@@ -116,12 +116,12 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
 
         <script src="bower_components/smoke/dist/js/smoke.min.js"></script>
         <script src="bower_components/numbered/jquery.numberedtextarea.js"></script>
-		
+
         <!--Other-->
         <script src="js/ajax.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
         <script src="bower_components/raphael/raphael-min.js"></script>
         <script src="bower_components/morris.js/morris.min.js"></script>
-        
+
 
         <!--Notification-->
         <script src="js/notifications/notificationFx.js"></script>
@@ -136,7 +136,7 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
         <script src="bower_components/datatables-tabletools/js/dataTables.tableTools.js"></script>
          <!--Summernote-->
         <script src="bower_components/summernote/dist/summernote.min.js"></script>
-		
+
 		<!--Other-->
 		<script>
 			function addTab() {
@@ -159,7 +159,7 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
 			function submitTabs(form) {
 				var formData = {};
 				var ids = [];
-				
+
 				$.each($(form).serializeArray(), function(i,v) {
 					var regmatch = /(\w+)\[((?:new-)?\d+)\]/i.exec(v.name);
 					if (regmatch) {
@@ -169,18 +169,18 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
 							formData['order'][regmatch[2]] = ids.length;
 						}
 						if (typeof formData[regmatch[1]] !== 'object') { formData[regmatch[1]] = {}; }
-						formData[regmatch[1]][regmatch[2]] = v.value; 
+						formData[regmatch[1]][regmatch[2]] = v.value;
 					} else {
 						console.log(regmatch);
 					}
 				});
 				console.log(formData);
 				ajax_request('POST', 'submit-tabs', formData);
-				
+
 				return false;
 			}
 		</script>
-		
+
         <style>
             body{
                 background: #273238;
@@ -205,7 +205,7 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
 			@-webkit-keyframes fadeIn {
 				from { opacity: 0; }
 				to { opacity: 1; }
-			}  
+			}
 			@keyframes fadeIn {
 				from { opacity: 0; }
 				to { opacity: 1; }
@@ -318,7 +318,7 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
                 width:auto;
                 padding:0 12px;
             }.dragging{
-                border: 2px solid;    
+                border: 2px solid;
             }.todo .action-btns a span {
                 color: #76828e !important;
             }.todo li:nth-child(even) {
@@ -328,10 +328,10 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
                 left: 160px;
                 top: 0px;
                 height: 400px;
-            }.chooseTheme a span { 
-                position:absolute; display:none; z-index:99; 
-            }.chooseTheme a:hover span { 
-                display:block; 
+            }.chooseTheme a span {
+                position:absolute; display:none; z-index:99;
+            }.chooseTheme a:hover span {
+                display:block;
             }ul.nav.nav-tabs.apps {
                 border: solid;
                 border-top: 0;
@@ -398,7 +398,7 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
                 <br/>
                 <div id="versionCheck"></div>
                 <div class="row">
-					<?php 
+					<?php
 					if($userDevice !== "phone"){
 						echo '<div class="col-xs-1" style="width: 60px">';
 						echo '
@@ -408,12 +408,12 @@ $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null
 					</button>
 						';
 					}else{
-						echo '<div class="col-sm-2">'; 
+						echo '<div class="col-sm-2">';
 						echo '<button id="apply" style="width: 100%; display: none;" class="btn waves btn-success btn-sm text-uppercase waves-effect waves-float animated tada" type="submit">'.$language->translate("APPLY_CHANGES").'</button>';
 					}?>
-						
 
-<?php 
+
+<?php
 $buildMenu = array(
 	array(
 		'id' => 'open-tabs',
@@ -515,7 +515,7 @@ $buildMenu = array(
 	),
 );
 if($userDevice !== "phone"){ echo "<br><br><br>".buildMenu($buildMenu); }else{ echo buildMenuPhone($buildMenu); }
-?>								
+?>
 
 
                     </div>
@@ -559,19 +559,19 @@ if($userDevice !== "phone"){ echo "<br><br><br>".buildMenu($buildMenu); }else{ e
 										<div id="viewAllIcons" style="display: none;">
 											<h4><strong><?php echo $language->translate("ALL_ICONS");?></strong> [<?php echo $language->translate("CLICK_ICON");?>]</h4>
 											<div class="row">
-												<textarea id="copyTarget" class="hideCopy" style="left: -9999px; top: 0; position: absolute;"></textarea>                                           
+												<textarea id="copyTarget" class="hideCopy" style="left: -9999px; top: 0; position: absolute;"></textarea>
 <?php
 $dirname = "images/";
 $images = scandir($dirname);
 $ignore = Array(".", "..", "favicon", "settings", "cache", "platforms", "._.DS_Store", ".DS_Store", "confused.png", "sowwy.png", "sort-btns", "loading.png", "titlelogo.png", "default.svg", "login.png", "no-np.png", "no-list.png", "no-np.psd", "no-list.psd", "themes", "nadaplaying.jpg", "organizr-logo-h-d.png", "organizr-logo-h.png");
 foreach($images as $curimg){
 	if(!in_array($curimg, $ignore)) { ?>
-												<div class="col-xs-2" style="width: 75px; height: 75px; padding-right: 0px;">    
+												<div class="col-xs-2" style="width: 75px; height: 75px; padding-right: 0px;">
 													<a data-toggle="tooltip" data-placement="bottom" title="<?=$dirname.$curimg;?>" class="thumbnail" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
 														<img style="width: 50px; height: 50px;" src="<?=$dirname.$curimg;?>" alt="thumbnail" class="allIcons">
 													</a>
 												</div>
-<?php 
+<?php
 	}
 }
 ?>
@@ -826,7 +826,7 @@ echo buildSettings(
 $urlPattern = '([hH][tT][tT][pP][sS]?):\/\/([\w\.\-]{1,250})(?::(\d{1,5}))?((?:\/[^?.\s]+))?';
 
 // Once configurable user groups is added change to select-multi to allow specific group selection
-$userSelectType = 'select'; 
+$userSelectType = 'select';
 $userTypes = array(
 	'None' => 'false',
 	'User' => 'user|admin',
@@ -1824,7 +1824,7 @@ echo buildSettings(
 			array(
 				'title' => 'Chat Settings',
 				'id' => 'chat_settings',
-				'image' => 'images/settings/full-color/png/64px/chat.png',//onsubmit="ajax_request(\'POST\', \'deleteLog\'); return false;"
+				'image' => 'images/settings/full-color/png/64px/chat.png',
 				'fields' => array(
 						array(
 							'type' => $userSelectType,
@@ -1849,7 +1849,27 @@ echo buildSettings(
 						),
 				),
 			),
-            array(
+			array(
+				'title' => 'Weather Settings',
+				'id' => 'weather_settings',
+				'image' => 'images/settings/full-color/png/64px/weather.png',
+				'fields' => array(
+						array(
+							'type' => $userSelectType,
+							'labelTranslate' => 'WEATHER_AUTH',
+							'name' => 'weatherAuth',
+							'value' => WEATHERAUTH,
+							'options' => $userTypes,
+						),
+						array(
+							'type' => 'checkbox',
+							'labelTranslate' => 'ENABLE_WEATHER',
+							'name' => 'weather',
+							'value' => WEATHER,
+						),
+				),
+			),
+      array(
 				'title' => 'Backup Settings',
 				'id' => 'backup_settings',
 				'image' => 'images/backup.png',
@@ -2001,7 +2021,7 @@ echo buildSettings(
                         <div class="email-inner small-box">
                             <div class="email-inner-section">
                                 <div class="small-box fade in">
-                                   
+
 
                                         <div class="mail-header">
                                             <p>
@@ -2021,8 +2041,8 @@ echo buildSettings(
 
                                         <div class="summernote"></div>
                                         <button id="sendEmail" class="btn btn-success waves">Send</button>
-              
-                       
+
+
                             	</div>
                         	</div>
                     	</div>
@@ -2082,8 +2102,8 @@ echo buildSettings(
                                     <h4><img src="images/organizr-logo-h-d.png" height="50px"></h4>
                                     <p id="version"></p>
                                     <p id="submitFeedback">
-                                        <a href='https://reddit.com/r/organizr' target='_blank' type='button' style="background: #AD80FD" class='btn waves btn-labeled btn-success btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-reddit'></i></span>SUBREDDIT</a> 
-                                        <a href='https://github.com/causefx/Organizr/issues/new' target='_blank' type='button' class='btn waves btn-labeled btn-success btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-github-alt'></i></span><?php echo $language->translate("SUBMIT_ISSUE");?></a> 
+                                        <a href='https://reddit.com/r/organizr' target='_blank' type='button' style="background: #AD80FD" class='btn waves btn-labeled btn-success btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-reddit'></i></span>SUBREDDIT</a>
+                                        <a href='https://github.com/causefx/Organizr/issues/new' target='_blank' type='button' class='btn waves btn-labeled btn-success btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-github-alt'></i></span><?php echo $language->translate("SUBMIT_ISSUE");?></a>
                                         <a href='https://github.com/causefx/Organizr' target='_blank' type='button' class='btn waves btn-labeled btn-primary btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-github'></i></span><?php echo $language->translate("VIEW_ON_GITHUB");?></a>
                                         <a href='https://gitter.im/Organizrr/Lobby' target='_blank' type='button' class='btn waves btn-labeled btn-dark btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-comments-o'></i></span><?php echo $language->translate("CHAT_WITH_US");?></a>
                                         <button type="button" class="class='btn waves btn-labeled btn-warning btn text-uppercase waves-effect waves-float" data-toggle="modal" data-target=".Help-Me-modal-lg"><span class='btn-label'><i class='fa fa-life-ring'></i></span><?php echo $language->translate("HELP");?></button>
@@ -2134,7 +2154,7 @@ echo buildSettings(
                                                                         <li><strong><?php echo $language->translate("ACTIVE");?></strong> <?php echo $language->translate("ACTIVE_ABOUT");?></li>
                                                                         <li><strong><?php echo $language->translate("USER");?></strong> <?php echo $language->translate("USER_ABOUT");?></li>
                                                                         <li><strong><?php echo $language->translate("GUEST");?></strong> <?php echo $language->translate("GUEST_ABOUT");?></li>
-                                                                        <li><strong><?php echo $language->translate("NO_IFRAME");?></strong> <?php echo $language->translate("NO_IFRAME_ABOUT");?></li>        
+                                                                        <li><strong><?php echo $language->translate("NO_IFRAME");?></strong> <?php echo $language->translate("NO_IFRAME_ABOUT");?></li>
 
                                                                     </ul>
 
@@ -2256,7 +2276,7 @@ echo buildSettings(
 
                                                                     <p><?php echo $language->translate("TAB_NOT_LOADING_ABOUT");?></p>
 
-                                                                    <?php 
+                                                                    <?php
                                                                     if(get_browser_name() == "Chrome") : echo get_browser_name() . ": <a href='https://chrome.google.com/webstore/detail/ignore-x-frame-headers/gleekbfjekiniecknbkamfmkohkpodhe' target='_blank'><strong>Ignore X-Frame headers</strong> by Guillaume Ryder</a>";
                                                                     elseif(get_browser_name() == "Firefox") : echo get_browser_name() . ": <a href='https://addons.mozilla.org/en-us/firefox/addon/ignore-x-frame-options/' target='_blank'><strong>Ignore X-Frame headers</strong> by rjhoukema</a>";
                                                                     else : echo "Sorry, currently there is no other alternative for " . get_browser_name(); endif;
@@ -2321,7 +2341,7 @@ echo buildSettings(
                                                 </div>
 
                                                 <div class="modal-footer">
-													
+
 													<button type="button" class="btn special" style="background: transparent !important;color: transparent !important;">Special</button>
                                                     <button type="button" class="btn btn-default waves" data-dismiss="modal"><?php echo $language->translate("CLOSE");?></button>
 
@@ -2417,13 +2437,13 @@ echo buildSettings(
 
                                                     </button>
 
-                                                </form>               
+                                                </form>
                                             </div>
                                         </div>
                                     </div>
                                     <div class="small-box">
                                         <form class="content-form form-inline" name="unregister" id="unregister" action="" method="POST">
-                                            
+
                                             <p id="inputUsername"></p>
 
                                             <div class="table-responsive">
@@ -2453,24 +2473,24 @@ echo buildSettings(
 
                                                     <tbody>
 
-                                                        <?php $countUsers = 1; 
-                                                        foreach($gotUsers as $row) : 
-                                                        if($row['role'] == "admin" && $countUsers == 1) : 
+                                                        <?php $countUsers = 1;
+                                                        foreach($gotUsers as $row) :
+                                                        if($row['role'] == "admin" && $countUsers == 1) :
                                                             $userColor = "red";
                                                             $disableAction = "disabled=\"disabled\"";
-                                                        else : 
+                                                        else :
                                                             $userColor = "blue";
                                                             $disableAction = "";
                                                         endif;
-                                                        if($row['active'] == "true") : 
+                                                        if($row['active'] == "true") :
                                                             $userActive = $language->translate("LOGGED_IN");
                                                             $userActiveColor = "primary";
-                                                        else : 
+                                                        else :
                                                             $userActive = $language->translate("LOGGED_OUT");
                                                             $userActiveColor = "danger";
                                                         endif;
                                                         $userpic = md5( strtolower( trim( $row['email'] ) ) );
-                                                        if(!empty($row["last"])) : 
+                                                        if(!empty($row["last"])) :
                                                            $lastActive = date("Y-m-d H:i", intval($row["last"]));
                                                         else :
                                                             $lastActive = "";
@@ -2565,14 +2585,14 @@ echo buildSettings(
 
                                                     </button>
 
-                                                </form>               
+                                                </form>
                                             </div>
                                         </div>
                                     </div>
                                     <div class="small-box">
-                                        
+
 										<form class="content-form form-inline" name="deleteInviteForm" id="deleteInviteForm" action="" method="POST">
-                                            
+
 											<p id="inputInvite"></p>
 
                                             <div class="table-responsive">
@@ -2600,7 +2620,7 @@ echo buildSettings(
                                                     </thead>
 
                                                     <tbody><!-- onsubmit="return false;" -->
-														
+
 
                                                         <?php
                                                         foreach($gotInvites as $row) :
@@ -2609,7 +2629,7 @@ echo buildSettings(
 															$dateInviteUsed = ($row['dateused'] != "" ? $row['dateused'] : "Not Used");
 															$ipUsed = ($row['ip'] != "" ? $row['ip'] : "Not Used");
 															$usedBy = ($row['usedby'] != "" ? $row['usedby'] : "Not Used");
-              
+
                                                         ?>
 
 															<tr id="<?=$row['id'];?>">
@@ -2640,16 +2660,16 @@ echo buildSettings(
 															</tr>
 
                                                         <?php endforeach; ?>
-														
+
 
                                                     </tbody>
 
                                                 </table>
 
                                             </div>
-											
+
 										</form>
-                                        
+
                                     </div>
 
                                 </div>
@@ -2673,7 +2693,7 @@ echo buildSettings(
                                         <button id="viewLoginLogs" class="btn waves btn-labeled grayish-blue-bg text-uppercase waves-effect waves-float" type="button" style="display: none"><span class="btn-label"><i class="fa fa-user"></i></span>Login Log </button>
                                         <?php } ?>
                                     </div>
-                                    
+
                                     <?php if(file_exists("org.log")){ ?>
                                     <div id="orgLogTable" class="table-responsive" style="display: none">
                                         <table id="orgLogs" class="datatable display">
@@ -2774,7 +2794,7 @@ echo buildSettings(
 
                                                     }
 
-                                                    foreach (array_reverse($gotFailLog["auth"]) as $key => $val) : 
+                                                    foreach (array_reverse($gotFailLog["auth"]) as $key => $val) :
 
                                                     if($val["auth_type"] == "bad_auth") : $badLogin++; elseif($val["auth_type"] == "good_auth") : $goodLogin++; endif;
                                                 ?>
@@ -2791,14 +2811,14 @@ echo buildSettings(
 
                                                 </tr>
 
-                                                <?php endforeach; ?> 
+                                                <?php endforeach; ?>
 
                                             </tbody>
 
                                         </table>
 
-                                        <?php 
-                                        $totalLogin = $goodLogin + $badLogin;     
+                                        <?php
+                                        $totalLogin = $goodLogin + $badLogin;
                                         $goodPercent = round(($goodLogin / $totalLogin) * 100);
                                         $badPercent = round(($badLogin / $totalLogin) * 100);
 
@@ -2870,15 +2890,15 @@ echo buildSettings(
         </div>
 		 <?php if(isset($_POST['op'])) : ?>
         <script>
-            
+
             parent.notify("<?php echo printArray($USER->info_log); ?>","info-circle","notice","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
-            
+
             <?php if(!empty($USER->error_log)) : ?>
-            
+
             parent.notify("<?php echo printArray($USER->error_log); ?>","exclamation-circle ","error","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
-            
+
             <?php endif; ?>
-            
+
         </script>
         <?php endif; ?>
 
@@ -3062,7 +3082,7 @@ echo buildSettings(
 				}, 100);
 			}
 
-              
+
           	$(function () {
 				//Data Tables
 				$('.datatable').DataTable({
@@ -3117,7 +3137,7 @@ echo buildSettings(
             })(jQuery);
 
             $(function () {
-                
+
                 $('.summernote').summernote({
                     height: 120,
                     codemirror: { // codemirror options
@@ -3126,7 +3146,7 @@ echo buildSettings(
 						lineNumbers: true,
 						theme: 'monokai'
 					}
-				});		
+				});
 
                 // summernote.change
                 $('.summernote').on('summernote.change', function(we, contents, $editable) {
@@ -3341,7 +3361,7 @@ echo buildSettings(
                 });
                 console.log("ajax done");
             });
-            //Custom Themes            
+            //Custom Themes
             function changeColor(elementName, elementColor) {
                 var definedElement = document.getElementById(elementName);
                 definedElement.focus();
@@ -3526,10 +3546,10 @@ echo buildSettings(
               borderColor: 'null',
 
               // CSS class to be added to the line numbers
-              class: null, 
+              class: null,
 
               // if true Tab key creates indentation
-              allowTabChar: true,       
+              allowTabChar: true,
 
             });
             //more/less
@@ -3561,7 +3581,7 @@ echo buildSettings(
                     $('html').removeClass("overhid");
                     $("#settings-list").find("li").removeClass("active");
                 }
-            }); 
+            });
             $( document ).on( 'keydown', function ( e ) {
                 if ( e.keyCode === 27 ) { // ESC
                     var container = $(".email-content");
@@ -3606,7 +3626,7 @@ echo buildSettings(
                 },600);
                 e.preventDefault();
             });
-          
+
             function checkGithub() {
                 $.ajax({
                     type: "GET",
@@ -3619,7 +3639,7 @@ echo buildSettings(
                         infoTabNew = $('#about').find('#whatsnew');
                         infoTabDownload = $('#about').find('#downloadnow');
                         $.each(github, function(i,v) {
-                            if(i === 0){ 
+                            if(i === 0){
                                 console.log(v.tag_name);
                                 githubVersion = v.tag_name;
                                 githubDescription = v.body;
@@ -3752,7 +3772,7 @@ echo buildSettings(
                     async: false,
                     success: function(msg){
                         gotinformation = msg.replace(/\r\n|\r|\n/g,"<br/>");
-                        
+
                     },
                     error: function(msg){
                         gotinformation = "There is no information for theme "+name;
@@ -3836,7 +3856,7 @@ echo buildSettings(
             //Stop Div behind From Scrolling
             $( '.email-content' ).on( 'mousewheel', function ( e ) {
                 e.preventDefault();
-            }, false);  
+            }, false);
             //Set Hide Function
 			         if (0) {
                 var authTypeFunc = function() {
@@ -3863,15 +3883,15 @@ echo buildSettings(
                 //Hide Settings on Load
                 authTypeFunc();
 			         } else { console.log() }
-            //Simulate Edit Tabs Click 
+            //Simulate Edit Tabs Click
             //$("#open-tabs").trigger("click");
             //Append Delete log to User Logs and Org Logs
             $("#datatable_wrapper > div[class^='DTTT_container']").append('<form style="display: inline; margin-left: 3px;" id="deletelog" method="post" onsubmit="ajax_request(\'POST\', \'deleteLog\'); return false;"><input type="hidden" name="action" value="deleteLog" /><button class="btn waves btn-labeled btn-danger text-uppercase waves-effect waves-float" type="submit"><span class="btn-label"><i class="fa fa-trash"></i></span><?php echo $language->translate("PURGE_LOG");?> </button></form>');
             $("#orgLogs_wrapper > div[class^='DTTT_container']").append('<form style="display: inline; margin-left: 3px;" id="deleteOrglog" method="post" onsubmit="ajax_request(\'POST\', \'deleteOrgLog\'); return false;"><input type="hidden" name="action" value="deleteOrgLog" /><button class="btn waves btn-labeled btn-danger text-uppercase waves-effect waves-float" type="submit"><span class="btn-label"><i class="fa fa-trash"></i></span><?php echo $language->translate("PURGE_LOG");?> </button></form>')
             $("a[id^='ToolTables_datatable_0'] span").html('<?php echo $language->translate("PRINT");?>')
             //Enable Tooltips
-            $('[data-toggle="tooltip"]').tooltip(); 
-            //AJAX call to github to get version info	
+            $('[data-toggle="tooltip"]').tooltip();
+            //AJAX call to github to get version info
 			<?php if (GIT_CHECK == "true") { echo 'checkGithub()'; } ?>
 
             //Edit Info tab with Github info
@@ -3882,14 +3902,14 @@ echo buildSettings(
             badCount = $('#loginStats').find('#badCount');
             badPercent = $('#loginStats').find('#badPercent');
             badTitle = $('#loginStats').find('#badTitle');
-            $(goodCount).html("<?php echo $goodLogin;?>");            
-            $(goodTitle).html("<?php echo $goodPercent;?>%");            
-            $(goodPercent).attr('aria-valuenow', "<?php echo $goodPercent;?>");            
-            $(goodPercent).attr('style', "width: <?php echo $goodPercent;?>%");            
+            $(goodCount).html("<?php echo $goodLogin;?>");
+            $(goodTitle).html("<?php echo $goodPercent;?>%");
+            $(goodPercent).attr('aria-valuenow', "<?php echo $goodPercent;?>");
+            $(goodPercent).attr('style', "width: <?php echo $goodPercent;?>%");
             $(badCount).html("<?php echo $badLogin;?>");
-            $(badTitle).html("<?php echo $badPercent;?>%");            
-            $(badPercent).attr('aria-valuenow', "<?php echo $badPercent;?>");            
-            $(badPercent).attr('style', "width: <?php echo $badPercent;?>%"); 
+            $(badTitle).html("<?php echo $badPercent;?>%");
+            $(badPercent).attr('aria-valuenow', "<?php echo $badPercent;?>");
+            $(badPercent).attr('style', "width: <?php echo $badPercent;?>%");
             <?php endif; ?>
         });
         </script>