index.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <?php
  2. try {
  3. $config = parse_ini_file('settings.ini.php', true);
  4. } catch(Exception $e) {
  5. die('<b>Unable to read config.ini.php. Did you rename it from config.ini.php-example?</b><br><br>Error message: ' .$e->getMessage());
  6. }
  7. foreach ($config as $keyname => $section) {
  8. if(!empty($section["useicons"]) && ($section["useicons"]=="true")){
  9. $icons = "active";
  10. $guesticons = "<span><i class=\"fa fa-toggle-on\"></i></span>";
  11. $adminicons = "<span><i class=\"fa fa-toggle-on\"></i></span>";
  12. $refreshicons = "<span><i class=\"fa fa-refresh\"></i></span>";
  13. }
  14. if($icons == "active"){
  15. $px = "80px";
  16. $pxmobile = "-30px";
  17. }else{
  18. $px = "50px";
  19. $pxmobile = "0px";
  20. }
  21. //Guest
  22. if($_COOKIE["logged"] !== $cookiepass && !empty($section["enabled"]) && ($section["enabled"]=="true") && !empty($section["guest"]) && ($section["guest"]=="true") ) {
  23. if($icons == "active"){ $listicons = "<span><i class=\"fa ". $section["icon"] ."\"></i></span>"; }
  24. $loadedlist .= "<li id=\"". $section["url"] ."x\"><a>" . $keyname . " " . $listicons ."</a></li>\n";
  25. $loadedurls .= "<div class=\"z-nopadding\" data-content-url=\"". $section["url"] ."\" data-content-type=\"iframe\"></div>\n";
  26. }
  27. //Full Access
  28. if($_COOKIE["logged"] == $cookiepass && !empty($section["enabled"]) && ($section["enabled"]=="true")) {
  29. if($icons == "active"){ $listicons = "<span><i class=\"fa ". $section["icon"] ."\"></i></span>"; }
  30. $loadedlist .= "<li id=\"". $section["url"] ."x\"><a>" . $keyname . " " . $listicons ."</a></li>\n";
  31. $loadedurls .= "<div class=\"z-nopadding\" data-content-url=\"". $section["url"] ."\" data-content-type=\"iframe\"></div>\n";
  32. }
  33. //General
  34. if (empty($title)) $title = 'Manage My HTPC';
  35. if(($keyname == "general")) { $title = $section["title"]; $tabcoloractive = $section["tabcoloractive"]; $fontcoloractive = $section["fontcoloractive"]; $tabcolor = $section["tabcolor"]; $fontcolor = $section["fontcolor"]; $tabshadowactive = $section["tabshadowactive"]; $tabshadow = $section["tabshadow"]; $cookiepass = $section["password"];}
  36. }
  37. if($_COOKIE["logged"] !== $cookiepass){
  38. $lasttablist .= "<li><a>Login" . $guesticons . "</a></li>\n";
  39. $lasttaburl .= "<div class=\"z-nopadding\" data-content-url=\"setup.php\" data-content-type=\"iframe\"></div>\n";
  40. }
  41. if($_COOKIE["logged"] == $cookiepass){
  42. $lasttablist .= "<li><a>Settings" . $adminicons . "</a></li>\n";
  43. $lasttaburl .= "<div class=\"z-nopadding\" data-content-url=\"setup.php\" data-content-type=\"iframe\"></div>\n";
  44. }
  45. if(!file_exists('settings.ini.php')){
  46. $lasttablist = "<li><a>Setup<span><i class=\"fa fa-spinner\"></i></span></a></li>\n";
  47. $lasttaburl = "<div class=\"z-nopadding\" data-content-url=\"setup.php\" data-content-type=\"iframe\"></div>\n";
  48. }
  49. ?>
  50. <!doctype html>
  51. <html class="z-white z-width1200">
  52. <head>
  53. <title><?=$title;?></title>
  54. <meta charset="utf-8">
  55. <meta name="viewport" content="width = device-width, initial-scale = 1.0" />
  56. <link href="css/min.css" rel="stylesheet" />
  57. <link href="css/tabs.min.css" rel="stylesheet" />
  58. <script src="js/jquery.min.js"></script>
  59. <script src="js/tabs.min.js"></script>
  60. <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'>
  61. <style>
  62. .z-tabs.white.z-bordered > ul > li.z-active > a {color: <?=$fontcoloractive;?>; background-color: <?=$tabcoloractive;?>; text-shadow: 0 1px <?=$tabshadowactive;?>;}
  63. </style>
  64. <style>
  65. .z-tabs.horizontal.responsive > ul > li > a, .z-tabs.horizontal.top-compact > ul > li > a, .z-tabs.horizontal.bottom-compact > ul > li > a, .z-tabs.horizontal.top-center > ul > li > a, .z-tabs.horizontal.bottom-center > ul > li > a {
  66. color: <?=$fontcolor;?>; background-color: <?=$tabcolor;?>; text-shadow: 0 1px <?=$tabshadow;?>;
  67. }
  68. </style>
  69. <style>.z-tabs.mobile {
  70. position: absolute;
  71. top: 0;
  72. bottom: 0;
  73. left: 0;
  74. right: 0;
  75. overflow: overlay;
  76. }</style>
  77. <script>
  78. $(document).ready(function(){
  79. $("li").dblclick(function(){
  80. var frame = this.id.slice(0, -1);
  81. var f = document.getElementById(frame);
  82. f.src = f.src;
  83. });
  84. });
  85. </script>
  86. </head>
  87. <body style="position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: white;
  88. -webkit-background-size: cover;
  89. -moz-background-size: cover;
  90. -o-background-size: cover;
  91. background-size: cover;">
  92. <span>&nbsp;</span>
  93. <div id="page">
  94. <!--Tabs Start-->
  95. <div id="tabbed-nav">
  96. <ul>
  97. <?=$loadedlist;?>
  98. <?=$lasttablist;?>
  99. </ul>
  100. <!-- Content container -->
  101. <style> .z-container { position: fixed; top: 50px; right: 0px; bottom: 0px; left: 0px; margin: 10px; } </style>
  102. <style> .z-tabs.mobile.top > .z-container {margin-top: <?=$pxmobile;?>;} </style>
  103. <style> .z-video{overflow-x: hidden;overflow-y: auto;}</style>
  104. <style> .z-content-inner{overflow-x: hidden;overflow-y: auto;;}</style>
  105. <style> .z-nopadding.z-content{overflow-x: hidden;overflow-y: auto;}</style>
  106. <div style="top: <?=$px;?>; overflow: overlay;">
  107. <?=$loadedurls;?>
  108. <?=$lasttaburl;?>
  109. </div>
  110. </div>
  111. <!--Tabs End-->
  112. </div>
  113. <script>
  114. jQuery(document).ready(function ($) {
  115. /* jQuery activation and setting options for the tabs*/
  116. $("#tabbed-nav").zozoTabs({
  117. defaultTab: "tab1",
  118. multiline: true,
  119. theme: "white",
  120. position: "top-compact",
  121. size: "medium",
  122. animation: {
  123. easing: "easeInOutExpo",
  124. duration: 450,
  125. effects: "fade"
  126. }
  127. });
  128. });
  129. </script>
  130. <script>
  131. jQuery('iframe','#container').attr('src',url);
  132. </script>
  133. </body>
  134. </html>