Explorar el Código

Merge pull request #39 from causefx/develop

Develop Merge - Moved Icon Folder to Images - DB Location Support
causefx hace 9 años
padre
commit
64092191d6

+ 1 - 1
ajax_remove_file.php

@@ -1,6 +1,6 @@
 <?php
 if(isset($_POST['file'])){
-    $file = 'icons/' . $_POST['file'];
+    $file = 'images/' . $_POST['file'];
     if(file_exists($file)){
         unlink($file);
     }

+ 1 - 1
ajax_upload_file.php

@@ -7,7 +7,7 @@
         'maxSize' => 1, //Maximum Size of files {null, Number(in MB's)}
         'extensions' => array('jpg', 'png'), //Whitelist for file extension. {null, Array(ex: array('jpg', 'png'))}
         'required' => false, //Minimum one file is required for upload {Boolean}
-        'uploadDir' => 'icons/', //Upload directory {String}
+        'uploadDir' => 'images/', //Upload directory {String}
         'title' => array('name'), //New file name {null, String, Array} *please read documentation in README.md
         'removeFiles' => true, //Enable file exclusion {Boolean(extra for jQuery.filer), String($_POST field name containing json data with file names)}
         'replace' => true, //Replace the file if it already exists  {Boolean}

+ 1 - 0
bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css

@@ -114,6 +114,7 @@ y-axis
 		margin: 0 auto;
 		-webkit-border-radius: 16px; -moz-border-radius: 16px; border-radius: 16px;
 		text-align: center;
+        margin-left: 13px;
 	}
 	
 	.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, 

+ 0 - 3
check.php

@@ -146,9 +146,6 @@ $folder = USER_HOME;
 
 
         <link rel="stylesheet" href="css/style.css">
-
-        <link rel="icon" href="img/favicon.ico" type="image/x-icon" />
-        <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
         
     </head>
 

+ 0 - 0
icons/couchpotato.png → images/couchpotato.png


+ 0 - 0
icons/deluge.png → images/deluge.png


+ 0 - 0
icons/emby.png → images/emby.png


+ 0 - 0
icons/favicon/android-chrome-192x192.png → images/favicon/android-chrome-192x192.png


+ 0 - 0
icons/favicon/android-chrome-512x512.png → images/favicon/android-chrome-512x512.png


+ 0 - 0
icons/favicon/apple-touch-icon.png → images/favicon/apple-touch-icon.png


+ 1 - 1
icons/favicon/browserconfig.xml → images/favicon/browserconfig.xml

@@ -2,7 +2,7 @@
 <browserconfig>
   <msapplication>
     <tile>
-      <square150x150logo src="icons/favicon/mstile-150x150.png"/>
+      <square150x150logo src="images/favicon/mstile-150x150.png"/>
       <TileColor>#2d89ef</TileColor>
     </tile>
   </msapplication>

+ 0 - 0
icons/favicon/favicon-16x16.png → images/favicon/favicon-16x16.png


+ 0 - 0
icons/favicon/favicon-32x32.png → images/favicon/favicon-32x32.png


+ 0 - 0
icons/favicon/favicon.ico → images/favicon/favicon.ico


+ 2 - 2
icons/favicon/manifest.json → images/favicon/manifest.json

@@ -2,12 +2,12 @@
 	"name": "Organizr",
 	"icons": [
 		{
-			"src": "icons\/favicon\/android-chrome-192x192.png",
+			"src": "images\/favicon\/android-chrome-192x192.png",
 			"sizes": "192x192",
 			"type": "image\/png"
 		},
 		{
-			"src": "icons\/favicon\/android-chrome-512x512.png",
+			"src": "images\/favicon\/android-chrome-512x512.png",
 			"sizes": "512x512",
 			"type": "image\/png"
 		}

+ 0 - 0
icons/favicon/mstile-150x150.png → images/favicon/mstile-150x150.png


+ 0 - 0
icons/favicon/safari-pinned-tab.svg → images/favicon/safari-pinned-tab.svg


+ 0 - 0
icons/headphones.png → images/headphones.png


+ 0 - 0
icons/lazylibrarian.png → images/lazylibrarian.png


+ 0 - 0
icons/mylar.png → images/mylar.png


+ 0 - 0
icons/nzbget.png → images/nzbget.png


+ 0 - 0
icons/nzbhydra.png → images/nzbhydra.png


+ 0 - 0
icons/ombi.png → images/ombi.png


+ 0 - 0
icons/openvpn.png → images/openvpn.png


+ 0 - 0
icons/plex.png → images/plex.png


+ 0 - 0
icons/plexpy.png → images/plexpy.png


+ 0 - 0
icons/sabnzbd.png → images/sabnzbd.png


+ 0 - 0
icons/settings.png → images/settings.png


+ 0 - 0
icons/sickbeard.png → images/sickbeard.png


+ 0 - 0
icons/sickrage.png → images/sickrage.png


+ 0 - 0
icons/sonarr.png → images/sonarr.png


+ 0 - 0
icons/watcher.png → images/watcher.png


+ 0 - 0
icons/webmin.png → images/webmin.png


+ 216 - 116
index.php

@@ -1,20 +1,35 @@
 <?php 
-
-date_default_timezone_set('America/Los_Angeles');
-
-$data = false;
-
+//Set some variables
 ini_set("display_errors", 1);
 ini_set("error_reporting", E_ALL | E_STRICT);
-
-function registration_callback($username, $email, $userdir)
-{
+date_default_timezone_set('America/Los_Angeles');
+$data = false;
+$databaseLocation = "databaseLocation.ini.php";
+$needSetup = "Yes";
+$tabSetup = "Yes";	
+$hasOptions = "No";
+$settingsicon = "No";
+$settingsActive = "";
+$action = "";
+$title = "Organizr";
+$topbar = "#eb6363"; 
+$topbartext = "#FFFFFF";
+$bottombar = "#eb6363";
+$sidebar = "#000000";
+$hoverbg = "#eb6363";
+$activetabBG = "#eb6363";
+$activetabicon = "#FFFFFF";
+$activetabtext = "#FFFFFF";
+$inactiveicon = "#FFFFFF";
+$inactivetext = "#FFFFFF";
+
+function registration_callback($username, $email, $userdir){
+    
     global $data;
+    
     $data = array($username, $email, $userdir);
-}
 
-require_once("user.php");
-$USER = new User("registration_callback");
+}
 
 function printArray($arrayName){
     
@@ -25,126 +40,160 @@ function printArray($arrayName){
     endforeach;
     
 }
+
+function write_ini_file($content, $path) { 
+    
+    if (!$handle = fopen($path, 'w')) {
+        
+        return false; 
     
-$dbfile = DATABASE_LOCATION  . constant('User::DATABASE_NAME') . ".db";
+    }
+    
+    $success = fwrite($handle, $content);
+    
+    fclose($handle); 
+    
+    return $success; 
 
-$database = new PDO("sqlite:" . $dbfile);
+}
+                
+if(isset($_POST['action'])) :
 
-$needSetup = "Yes";
+    $action = $_POST['action'];
+    
+endif;
 
-$query = "SELECT * FROM users";
-			
-foreach($database->query($query) as $data) {
+if($action == "createLocation") :
 
-    $needSetup = "No";
+    $databaseData = '; <?php die("Access denied"); ?>' . "\r\n";
 
-}
+    foreach ($_POST as $postName => $postValue) {
+            
+        if($postName !== "action") :
+        
+            if(substr($postValue, -1) == "/") : $postValue = rtrim($postValue, "/"); endif;
+        
+            $databaseData .= $postName . " = \"" . $postValue . "\"\r\n";
+        
+        endif;
+        
+    }
 
-$db = DATABASE_LOCATION  . constant('User::DATABASE_NAME') . ".db";
-$file_db = new PDO("sqlite:" . $db);
-$file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+    write_ini_file($databaseData, $databaseLocation);
 
-$dbTab = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"');
-$dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"');
+endif;
 
-$tabSetup = "Yes";	
-$hasOptions = "No";
-$settingsicon = "No";
+if(!file_exists($databaseLocation)) :
 
-foreach($dbTab as $row) :
+    $configReady = "No";
+    $userpic = "";
 
-    if (in_array("tabs", $row)) :
-    
-        $tabSetup = "No";
-    
-    endif;
+else :
 
-endforeach;
+    $configReady = "Yes";
 
-foreach($dbOptions as $row) :
+    require_once("user.php");
 
-    if (in_array("options", $row)) :
-    
-        $hasOptions = "Yes";
+    $USER = new User("registration_callback");
+
+    $dbfile = DATABASE_LOCATION  . constant('User::DATABASE_NAME') . ".db";
+
+    $database = new PDO("sqlite:" . $dbfile);
+
+    $query = "SELECT * FROM users";
+
+    foreach($database->query($query) as $data) {
+
+        $needSetup = "No";
+
+    }
+
+    $db = DATABASE_LOCATION  . constant('User::DATABASE_NAME') . ".db";
+    $file_db = new PDO("sqlite:" . $db);
+    $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+    $dbTab = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"');
+    $dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"');
+
+    foreach($dbTab as $row) :
+
+        if (in_array("tabs", $row)) :
+
+            $tabSetup = "No";
+
+        endif;
+
+    endforeach;
+
+    if($tabSetup == "Yes") :
+
+        $settingsActive = "active";
     
     endif;
 
-endforeach;
+    foreach($dbOptions as $row) :
 
-if($tabSetup == "No") :
+        if (in_array("options", $row)) :
 
-    if($USER->authenticated && $USER->role == "admin") :
+            $hasOptions = "Yes";
 
-        $result = $file_db->query('SELECT * FROM tabs WHERE active = "true"');
-        $getsettings = $file_db->query('SELECT * FROM tabs WHERE active = "true"');
+        endif;
 
-        foreach($getsettings as $row) :
+    endforeach;
 
-            if(!empty($row['iconurl']) && $settingsicon == "No") :
+    if($tabSetup == "No") :
 
-                $settingsicon = "Yes";
+        if($USER->authenticated && $USER->role == "admin") :
 
-            endif;
+            $result = $file_db->query('SELECT * FROM tabs WHERE active = "true"');
+            $getsettings = $file_db->query('SELECT * FROM tabs WHERE active = "true"');
 
-        endforeach;
+            foreach($getsettings as $row) :
 
-    elseif($USER->authenticated && $USER->role == "user") :
+                if(!empty($row['iconurl']) && $settingsicon == "No") :
 
-        $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND user = "true"');
+                    $settingsicon = "Yes";
 
-    else :
+                endif;
 
-        $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND guest = "true"');
+            endforeach;
 
-    endif;
-    
-endif;
+        elseif($USER->authenticated && $USER->role == "user") :
 
-$settingsActive = "";
+            $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND user = "true"');
 
-if($tabSetup == "Yes") :
+        else :
 
-    $settingsActive = "active";
-    
-endif;
+            $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND guest = "true"');
 
-if($hasOptions == "Yes") :
+        endif;
 
-    $resulto = $file_db->query('SELECT * FROM options');
+    endif;
 
-    foreach($resulto as $row) : 
-                                    
-        $title = $row['title'];
-        $topbartext = $row['topbartext'];
-        $topbar = $row['topbar'];
-        $bottombar = $row['bottombar'];
-        $sidebar = $row['sidebar'];
-        $hoverbg = $row['hoverbg'];
-        $activetabBG = $row['activetabBG'];
-        $activetabicon = $row['activetabicon'];
-        $activetabtext = $row['activetabtext'];
-        $inactiveicon = $row['inactiveicon'];
-        $inactivetext = $row['inactivetext'];
+    if($hasOptions == "Yes") :
 
-    endforeach;
+        $resulto = $file_db->query('SELECT * FROM options');
 
-elseif($hasOptions == "No") :
+        foreach($resulto as $row) : 
 
-    $title = "Organizr";
-    $topbar = "#eb6363"; 
-    $topbartext = "#FFFFFF";
-    $bottombar = "#eb6363";
-    $sidebar = "#000000";
-    $hoverbg = "#eb6363";
-    $activetabBG = "#eb6363";
-    $activetabicon = "#FFFFFF";
-    $activetabtext = "#FFFFFF";
-    $inactiveicon = "#FFFFFF";
-    $inactivetext = "#FFFFFF";
+            $title = $row['title'];
+            $topbartext = $row['topbartext'];
+            $topbar = $row['topbar'];
+            $bottombar = $row['bottombar'];
+            $sidebar = $row['sidebar'];
+            $hoverbg = $row['hoverbg'];
+            $activetabBG = $row['activetabBG'];
+            $activetabicon = $row['activetabicon'];
+            $activetabtext = $row['activetabtext'];
+            $inactiveicon = $row['inactiveicon'];
+            $inactivetext = $row['inactivetext'];
 
-endif;
+        endforeach;
+
+    endif;
 
-$userpic = md5( strtolower( trim( $USER->email ) ) );
+    $userpic = md5( strtolower( trim( $USER->email ) ) );
+
+endif;
 
 ?>
 
@@ -183,13 +232,13 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
         <link rel="stylesheet" href="css/style.css">
 
         
-        <link rel="apple-touch-icon" sizes="180x180" href="icons/favicon/apple-touch-icon.png">
-        <link rel="icon" type="image/png" href="icons/favicon/favicon-32x32.png" sizes="32x32">
-        <link rel="icon" type="image/png" href="icons/favicon/favicon-16x16.png" sizes="16x16">
-        <link rel="manifest" href="icons/favicon/manifest.json">
-        <link rel="mask-icon" href="icons/favicon/safari-pinned-tab.svg" color="#2d89ef">
-        <link rel="shortcut icon" href="icons/favicon/favicon.ico">
-        <meta name="msapplication-config" content="icons/favicon/browserconfig.xml">
+        <link rel="apple-touch-icon" sizes="180x180" href="images/favicon/apple-touch-icon.png">
+        <link rel="icon" type="image/png" href="images/favicon/favicon-32x32.png" sizes="32x32">
+        <link rel="icon" type="image/png" href="images/favicon/favicon-16x16.png" sizes="16x16">
+        <link rel="manifest" href="images/favicon/manifest.json">
+        <link rel="mask-icon" href="images/favicon/safari-pinned-tab.svg" color="#2d89ef">
+        <link rel="shortcut icon" href="images/favicon/favicon.ico">
+        <meta name="msapplication-config" content="images/favicon/browserconfig.xml">
         <meta name="theme-color" content="#2d89ef">
         
         <!--[if lt IE 9]>
@@ -399,7 +448,7 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
                                 
                                 <?php endforeach; endif;?>
                                 
-                                <?php if($USER->authenticated && $USER->role == "admin") :?>
+                                <?php if($configReady == "Yes") : if($USER->authenticated && $USER->role == "admin") :?>
                                 <li class="tab-item <?=$settingsActive;?>" id="settings.phpx">
                                                             
                                     <a class="tab-link">
@@ -407,7 +456,7 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
                                         <?php if($settingsicon == "Yes") :
                                         
                                             echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
-                                                <img id="settings-icon" src="icons/settings.png" style="height: 30px; margin-top: -2px;"></i>';
+                                                <img id="settings-icon" src="images/settings.png" style="height: 30px; margin-top: -2px;"></i>';
                                         
                                         else :
                                         
@@ -420,7 +469,7 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
                                     </a>
                                 
                                 </li>
-                                <?php endif;?>
+                                <?php endif; endif;?>
                                 
                                 <!--End Tab List-->
                            
@@ -432,9 +481,6 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
                         <div class="bottom-bnts">
                             
                             <a class="fix-nav"><i class="mdi mdi-pin"></i></a>
-                            <?php if($USER->authenticated) : ?>
-                            <a class="logout"><i class="fa fa-sign-out fa-lg"></i></a>
-                            <?php endif ?>
                         
                         </div>
                     
@@ -454,17 +500,17 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
                         
                         <li class="dropdown notifications">
                             
-                            <?php if(!$USER->authenticated) : ?>
+                            <?php if($configReady == "Yes") : if(!$USER->authenticated) : ?>
                             
                             <a class="log-in">
                             
-                            <?php endif; ?>
+                            <?php endif; endif;?>
                             
-                            <?php if($USER->authenticated) : ?>
+                            <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
                             
                             <a class="show-members">
                                 
-                            <?php endif; ?>
+                            <?php endif; endif;?>
                                 
                                 <i class="userpic"><img src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=40&d=mm" class="img-circle"></i> 
                                 
@@ -501,7 +547,7 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
             <div id="content" class="content" style="">
 
                 <!--Load Framed Content-->
-                <?php if($needSetup == "Yes") : ?>
+                <?php if($needSetup == "Yes" && $configReady == "Yes") : ?>
                 <div class="table-wrapper">
 
                     <div class="table-row">
@@ -567,7 +613,61 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
 
                 </div>
                 <?php endif; ?>
-                <?php if(!$USER->authenticated && $tabSetup == "Yes" && $needSetup == "No") :?>
+                
+                
+                <?php if($needSetup == "Yes" && $configReady == "No") : ?>
+                <div class="table-wrapper">
+
+                    <div class="table-row">
+
+                        <div class="table-cell text-center">
+
+                            <div class="login i-block">
+
+                                <div class="content-box">
+
+                                    <div class="green-bg biggest-box">
+
+                                        <h1 class="zero-m text-uppercase">Database Path</h1>
+
+                                    </div>
+
+                                    <div class="big-box text-left registration-form">
+
+                                        <h3 class="text-center">Specify the location of which you want to save your database files.</h3>
+                                        <h5 class="text-left"><strong>Current Direcotry: <?php echo __DIR__; ?> <br>Parent Directory: <?php echo dirname(__DIR__); ?></strong></h5>
+                                        
+                                        <form class="controlbox" name="setupDatabase" id="setupDatabase" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
+                                            
+                                            <input type="hidden" name="action" value="createLocation" />
+
+                                            <div class="form-group">
+
+                                                <input type="text" class="form-control material" name="databaseLocation" autofocus value="<?php echo dirname(__DIR__);?>" autocorrect="off" autocapitalize="off" required>
+                                                
+                                                <?php if(file_exists(dirname(__DIR__) . '/users.db') || file_exists(__DIR__ . '/users.db')) : echo '<h5 class="text-center red">Don\'t worry, you\'re database is still there.  Just use the same location you have it in.</h5>'; endif;?>
+
+                                            </div>
+
+                                            <input id="databaseLocationSubmit" type="submit" class="btn green-bg btn-block btn-sm text-uppercase waves waves-effect waves-float" value="Save Location">
+
+                                        </form>
+
+                                    </div>
+
+                                </div>
+
+                            </div>
+
+                        </div>
+
+                    </div>
+
+                </div>
+                <?php endif; ?>
+                
+                
+                <?php if($configReady == "Yes") : if(!$USER->authenticated && $tabSetup == "Yes" && $needSetup == "No") :?>
                 <div class="table-wrapper">
                 
                     <div class="table-row">
@@ -601,7 +701,7 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
                     </div>
                 
                 </div>
-                <?php endif; ?>
+                <?php endif; endif; ?>
                 <?php if($tabSetup == "No" && $needSetup == "No") :?>        
                 <div id="tabEmpty" class="table-wrapper" style="display: none">
                 
@@ -656,7 +756,7 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
                 
                 <div class="clearfix"><br/></div>
                 
-                <?php if($USER->authenticated) : ?>
+                <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
                 
                 <div class="content-box profile-sidebar box-shadow">
                 
@@ -728,12 +828,12 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
                     
                 </div>
 
-                <?php endif;?>
+                <?php endif; endif;?>
 
             </div>
 
         </div>
-        <?php if(!$USER->authenticated) : ?>
+        <?php if($configReady == "Yes") : if(!$USER->authenticated && $configReady == "Yes") : ?>
         <div class="login-modal modal fade">
             
             <div style="background:<?=$sidebar;?>;" class="table-wrapper">
@@ -829,8 +929,8 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
             </div>
         
         </div>
-        <?php endif;?>
-        <?php if($USER->authenticated) : ?>
+        <?php endif; endif;?>
+        <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
         <div style="background:<?=$topbar;?>;" class="logout-modal modal fade">
             
             <div class="table-wrapper" style="background: <?=$topbar;?>">
@@ -872,7 +972,7 @@ $userpic = md5( strtolower( trim( $USER->email ) ) );
             </div>
     
         </div>
-        <?php endif;?>
+        <?php endif; endif;?>
 
         <!--Scripts-->
         <script src="bower_components/jquery/dist/jquery.min.js"></script>

+ 2 - 2
js/custom.js

@@ -18,7 +18,7 @@ $(document).ready(function(){
 									<div class="jFiler-item-thumb-overlay">\
 										<div class="jFiler-item-info">\
 											<div style="display:table-cell;vertical-align: middle;">\
-												<span class="jFiler-item-title"><b title="{{fi-name}}">icons/{{fi-name}}</b></span>\
+												<span class="jFiler-item-title"><b title="{{fi-name}}">images/{{fi-name}}</b></span>\
 												<span class="jFiler-item-others">{{fi-size2}}</span>\
 											</div>\
 										</div>\
@@ -44,7 +44,7 @@ $(document).ready(function(){
 										<div class="jFiler-item-thumb-overlay">\
 											<div class="jFiler-item-info">\
 												<div style="display:table-cell;vertical-align: middle;">\
-													<span class="jFiler-item-title"><b title="{{fi-name}}">icons/{{fi-name}}</b></span>\
+													<span class="jFiler-item-title"><b title="{{fi-name}}">images/{{fi-name}}</b></span>\
 													<span class="jFiler-item-others">{{fi-size2}}</span>\
 												</div>\
 											</div>\

+ 49 - 8
settings.php

@@ -438,8 +438,6 @@ if($action == "addTabz") :
         $stmt->execute();
         
     endforeach;
-
-    //echo "<script>window.onload = function() {if(!window.location.hash) {window.location = window.location + '#loaded';window.location.reload();}}</script>";
     
 endif;
 
@@ -633,10 +631,10 @@ endif;
                                             <textarea id="copyTarget" class="hideCopy" style="left: -9999px; top: 0; position: absolute;"></textarea>
                                            <!-- style="height: 1px; width: 0px; display: block;"!-->
                                             <?php
-                                            $dirname = "icons/";
+                                            $dirname = "images/";
                                             $images = scandir($dirname);
                                             //shuffle($images);
-                                            $ignore = Array(".", "..", "favicon/", "favicon");
+                                            $ignore = Array(".", "..", "favicon/", "favicon", "._.DS_Store", ".DS_Store");
                                             foreach($images as $curimg){
                                                 if(!in_array($curimg, $ignore)) { ?>
 
@@ -1037,12 +1035,40 @@ endif;
                                         
                                         <input type="hidden" name="action" value="addOptionz" />
                                         
-                                        <button id="plexTheme" style="background: #E49F0C" type="button" class="btn waves btn-dark btn-sm text-uppercase waves-effect waves-float">Plex</button>
+                                        <div class="btn-group">
+                                            
+                                            <button type="button" class="btn btn-dark dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                                            Choose Theme  <span class="caret"></span>
+                                            </button>
+                                            
+                                            <ul class="dropdown-menu gray-bg">
+                                            
+                                                <li id="plexTheme" style="background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #E49F0C !important;" href="#">Plex</a></li>
+                                            
+                                                <li id="embyTheme" style="background: #212121; border-radius: 5px; margin: 5px;"><a style="color: #52B54B !important;" href="#">Emby</a></li>
+                                                
+                                                <li id="bookTheme" style="background: #3B5998; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Facebook</a></li>
+                                                
+                                                <li id="spaTheme" style="background: #66BBAE; border-radius: 5px; margin: 5px;"><a style="color: #5B391E !important;" href="#">Spa</a></li>
+                                                
+                                                <li id="darklyTheme" style="background: #375A7F; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Darkly</a></li>
+                                                
+                                                <li id="slateTheme" style="background: #272B30; border-radius: 5px; margin: 5px;"><a style="color: #C8C8C8 !important;" href="#">Slate</a></li>
+                                            
+                                                <li role="separator" class="divider"></li>
+                                            
+                                                <li id="defaultTheme" style="background: #eb6363; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Default</a></li>
+                                            
+                                            </ul>
+                                            
+                                        </div>
+                                        
+                                       <!-- <button id="plexTheme" style="background: #E49F0C" type="button" class="btn waves btn-dark btn-sm text-uppercase waves-effect waves-float">Plex</button>
                                         <button id="embyTheme" style="background: #52B54B" type="button" class="btn waves btn-dark btn-sm text-uppercase waves-effect waves-float">Emby</button>
                                         <button id="bookTheme" style="background: #3B5998" type="button" class="btn waves btn-dark btn-sm text-uppercase waves-effect waves-float">Book</button>
                                         <button id="spaTheme" style="background: #66BBAE" type="button" class="btn waves btn-dark btn-sm text-uppercase waves-effect waves-float">Spa</button>
                                         <button id="darklyTheme" style="background: #375A7F" type="button" class="btn waves btn-dark btn-sm text-uppercase waves-effect waves-float">Darkly</button>
-                                        <button id="slateTheme" style="background: #272B30" type="button" class="btn waves btn-dark btn-sm text-uppercase waves-effect waves-float">Slate</button>
+                                        <button id="slateTheme" style="background: #272B30" type="button" class="btn waves btn-dark btn-sm text-uppercase waves-effect waves-float">Slate</button> -->
                                         
                                         <button class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
                                                 
@@ -1620,6 +1646,21 @@ endif;
                 changeColor("inactivetext", "#C8C8C8");
                 
             });
+            
+            $('#defaultTheme').on('click touchstart', function(){
+
+                changeColor("topbartext", "#FFFFFF");
+                changeColor("topbar", "#eb6363");
+                changeColor("bottombar", "#eb6363");
+                changeColor("sidebar", "#000000");
+                changeColor("hoverbg", "#eb6363");
+                changeColor("activetabBG", "#eb6363");
+                changeColor("activetabicon", "#FFFFFF");
+                changeColor("activetabtext", "#FFFFFF");
+                changeColor("inactiveicon", "#FFFFFF");
+                changeColor("inactivetext", "#FFFFFF");
+                
+            });
         
         </script>
         
@@ -1636,7 +1677,7 @@ endif;
                 dataType: "json",
                 success: function(github) {
                    
-                    var currentVersion = "0.98";
+                    var currentVersion = "0.985";
                     var githubVersion = github.tag_name;
                     var githubDescription = github.body;
                     var githubName = github.name;
@@ -1681,7 +1722,7 @@ endif;
                     
                     }
 
-                    $(infoTabVersion).html("<strong>Installed Version: </strong>" + currentVersion + " <strong>Current Version: </strong>" + githubVersion);
+                    $(infoTabVersion).html("<strong>Installed Version: </strong>" + currentVersion + " <strong>Current Version: </strong>" + githubVersion + " <strong>Database Location:  </strong> <?php echo DATABASE_LOCATION;?>");
                     
                 }
                 

+ 3 - 3
user.php

@@ -7,9 +7,9 @@
 	 *	entry is assigned a new random token,  which is used in
 	 * salting subsequent password checks.
 	 */
-
-    define('USER_HOME', dirname(__DIR__) . '/users/');
-    define('DATABASE_LOCATION', dirname(__DIR__) . '/');
+    $databaseConfig = parse_ini_file('databaseLocation.ini.php', true);
+    define('USER_HOME', $databaseConfig['databaseLocation'] . '/users/');
+    define('DATABASE_LOCATION', $databaseConfig['databaseLocation'] . '/');
 
 	class User
 	{