4
0
Эх сурвалжийг харах

Logout coding plus mobile coding (not complete)

resolved issue #6
causefx 10 жил өмнө
parent
commit
1b8a3b9e0c
2 өөрчлөгдсөн 44 нэмэгдсэн , 2 устгасан
  1. 25 2
      index.php
  2. 19 0
      settings.php

+ 25 - 2
index.php

@@ -11,13 +11,24 @@ foreach ($config as $keyname => $section) {
         if(!empty($section["useicons"]) && ($section["useicons"]=="true")){ 
             
             $icons = "active";
-            if($icons == "active"){ $px = "80px"; }else{ $px = "50px";}
             
             $guesticons = "<span><i class=\"fa fa-toggle-on\"></i></span>";
             $adminicons = "<span><i class=\"fa fa-toggle-on\"></i></span>";
             $refreshicons = "<span><i class=\"fa fa-refresh\"></i></span>";
         }
     
+        if($icons == "active"){
+                
+            $px = "80px";
+            $pxmobile = "-30px";
+                
+        }else{
+                
+            $px = "50px";
+            $pxmobile = "0px";
+                
+        }
+    
         //Guest
         if($_COOKIE["logged"] !== $cookiepass && !empty($section["enabled"]) && ($section["enabled"]=="true") && !empty($section["guest"]) && ($section["guest"]=="true") ) {
             if($icons == "active"){ $listicons = "<span><i class=\"fa ". $section["icon"] ."\"></i></span>"; }
@@ -74,6 +85,14 @@ if(!file_exists('settings.ini.php')){
     color: <?=$fontcolor;?>; background-color: <?=$tabcolor;?>; text-shadow: 0 1px <?=$tabshadow;?>;
 }
         </style>
+        <style>.z-tabs.mobile {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    overflow: overlay;
+}</style>
         
         <script>
 
@@ -111,7 +130,11 @@ if(!file_exists('settings.ini.php')){
 
                 <!-- Content container -->
                 <style> .z-container { position: fixed; top: 50px; right: 0px; bottom: 0px; left: 0px; margin: 10px; } </style>
-                <div style="top: <?=$px;?>">              
+                <style> .z-tabs.mobile.top > .z-container {margin-top: <?=$pxmobile;?>;} </style>
+                <style> .z-video{overflow-x: hidden;overflow-y: auto;}</style>
+                <style> .z-content-inner{overflow-x: hidden;overflow-y: auto;;}</style>
+                <style> .z-nopadding.z-content{overflow-x: hidden;overflow-y: auto;}</style>
+                <div style="top: <?=$px;?>; overflow: overlay;">              
 
                     <?=$loadedurls;?>
                     <?=$lasttaburl;?>

+ 19 - 0
settings.php

@@ -25,6 +25,24 @@ if($_COOKIE["logged"] !== $cookiepass){
 
 if(isset($_GET["action"])){$action = $_GET["action"];}
 
+if($action == "logout"){
+    
+    if (isset($_COOKIE['logged'])) {
+        unset($_COOKIE['logged']);
+        setcookie('logged', '', time() - 3600, '/');
+        
+    }
+    
+    sleep(.5);
+    echo "<!DOCTYPE html>";
+    echo "<head>";
+    echo "<title>Logout</title>";
+    echo "<script type='text/javascript'>window.parent.location.reload();</script>";
+    echo "</head>";
+    echo "<body></body></html>";
+    
+}
+
 function write_ini_file($content, $path) { 
 
     if (!$handle = fopen($path, 'w')) { 
@@ -176,6 +194,7 @@ if(array_key_exists('category-0', $_POST) == true){
                     echo "<input style=\"margin-bottom: 0px\" type=\"password\" name=\"password-0\" class=\"form-control\" placeholder=\"Leave Blank if no change\" value=\"\"></div> ";
                     if($section['useicons'] == "true"){echo "<input type=\"checkbox\" name=\"useicons-0\" id=\"useicons-0\" class=\"css-checkbox\" checked> ";}else {echo "<input type=\"checkbox\" name=\"useicons-0\" id=\"useicons-0\" class=\"css-checkbox\"> ";}
                     echo "<label for=\"useicons-0\" class=\"css-label\">Icons</label>  ";
+                    echo "<a href=\"?action=logout\" class=\"btn btn-warning\" style=\"float: right;\" role=\"button\">Logout</a>";
                     echo "</div>";
                     echo "<div class=\"form-group clearfix well well-sm\" style=\"padding-bottom: 0px;p adding-top: 10px; margin-bottom: 5px;\">";
                     echo "<span class=\"btn btn-inactive \" type=\"button\"><span class=\"fa fa-paint-brush\"></span></span> ";