4
0

index.php 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244
  1. <?php
  2. // Include functions if not already included
  3. require_once('functions.php');
  4. // Upgrade environment
  5. upgradeCheck();
  6. // Lazyload settings
  7. $databaseConfig = configLazy('config/config.php');
  8. // Load Colours/Appearance
  9. foreach(loadAppearance() as $key => $value) {
  10. $$key = $value;
  11. }
  12. //Set some variables
  13. ini_set("display_errors", 1);
  14. ini_set("error_reporting", E_ALL | E_STRICT);
  15. $data = false;
  16. $databaseLocation = "databaseLocation.ini.php";
  17. $needSetup = "Yes";
  18. $tabSetup = "Yes";
  19. $hasOptions = "No";
  20. $settingsicon = "No";
  21. $settingsActive = "";
  22. $action = "";
  23. $loadingIcon = "images/organizr-load-w-thick.gif";
  24. $baseURL = "";
  25. $dbcreated = false;
  26. $splash = false;
  27. // Get Action
  28. if(isset($_POST['action'])) {
  29. $action = $_POST['action'];
  30. unset($_POST['action']);
  31. }
  32. //Get Invite Code
  33. $inviteCode = isset($_GET['inviteCode']) ? $_GET['inviteCode'] : null;
  34. // Check for config file
  35. if(!file_exists('config/config.php')) {
  36. if($action == "createLocation") {
  37. if (isset($_POST['database_Location'])) {
  38. $_POST['database_Location'] = str_replace('//','/',$_POST['database_Location'].'/');
  39. if(substr($_POST['database_Location'], -1) != "/") : $_POST['database_Location'] = $_POST['database_Location'] . "/"; endif;
  40. $_POST['user_home'] = $_POST['database_Location'].'users/';
  41. }
  42. if (file_exists($_POST['database_Location'])) {
  43. updateConfig($_POST);
  44. } else {
  45. debug_out('Dir doesn\'t exist: '.$_POST['database_Location'],1); // Pretty Up
  46. }
  47. } else {
  48. $configReady = "No";
  49. $userpic = "";
  50. $showPic = "";
  51. }
  52. }
  53. if (file_exists('config/config.php')) {
  54. if (!DATABASE_LOCATION){
  55. die(header("Refresh:0"));
  56. }
  57. $configReady = "Yes";
  58. require_once("user.php");
  59. $USER = new User("registration_callback");
  60. $group = $USER->role;
  61. $dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
  62. $database = new PDO("sqlite:" . $dbfile);
  63. $query = "SELECT * FROM users";
  64. foreach($database->query($query) as $data) {
  65. $needSetup = "No";
  66. }
  67. $db = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
  68. $file_db = new PDO("sqlite:" . $db);
  69. $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  70. $dbTab = q2a($file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"'));
  71. $dbOptions = q2a($file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"'));
  72. if (is_array($dbTab)) {
  73. foreach($dbTab as $row) {
  74. if (in_array("tabs", $row)) {
  75. $tabSetup = "No";
  76. }
  77. }
  78. }
  79. if($tabSetup == "Yes"){
  80. $settingsActive = "active";
  81. }
  82. if (is_array($dbOptions)) {
  83. foreach($dbOptions as $row) {
  84. if (in_array("options", $row)) {
  85. $hasOptions = "Yes";
  86. }
  87. }
  88. }
  89. if($tabSetup == "No") {
  90. if($USER->authenticated && $USER->role == "admin") {
  91. $result = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" ORDER BY `order` asc'));
  92. $splash = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND splash = "true" ORDER BY `order` asc'));
  93. if (is_array($result)) {
  94. foreach($result as $row) {
  95. if(!empty($row['iconurl']) && $settingsicon == "No") {
  96. $settingsicon = "Yes";
  97. }
  98. }
  99. }
  100. }elseif($USER->authenticated && $USER->role == "user") {
  101. $result = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND user = "true" ORDER BY `order` asc'));
  102. $splash = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND splash = "true" AND user = "true" ORDER BY `order` asc'));
  103. }else {
  104. $result = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND guest = "true" ORDER BY `order` asc'));
  105. $splash = q2a($file_db->query('SELECT * FROM tabs WHERE active = "true" AND splash = "true" AND guest = "true" ORDER BY `order` asc'));
  106. }
  107. }
  108. $userpic = md5( strtolower( trim( $USER->email ) ) );
  109. $showPic = "<i class=\"mdi mdi-account-circle\"></i>";
  110. if(LOADINGICON !== "") : $loadingIcon = LOADINGICON; endif;
  111. if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
  112. //NEW CHAT
  113. if(CHAT == "true" && qualifyUser(CHATAUTH)){
  114. if( $db = new SQLite3("chatpack.db") ){
  115. if( $db->busyTimeout(5000) ){
  116. if( $db->exec("PRAGMA journal_mode = wal;") ) {
  117. $logtable = "CREATE TABLE IF NOT EXISTS chatpack_log
  118. (id INTEGER PRIMARY KEY,
  119. timestamp INTEGER NOT NULL,
  120. user TEXT NOT NULL,
  121. avatar TEXT NOT NULL,
  122. message TEXT NOT NULL,
  123. liked INTEGER DEFAULT 0)";
  124. if( $db->exec($logtable) ){
  125. $usertable = "CREATE TABLE IF NOT EXISTS chatpack_typing
  126. (id INTEGER PRIMARY KEY,
  127. timestamp INTEGER NOT NULL,
  128. user TEXT NOT NULL)";
  129. $onlinetable = "CREATE TABLE IF NOT EXISTS chatpack_last_message
  130. (
  131. user TEXT PRIMARY KEY NOT NULL,
  132. timestamp INTEGER NOT NULL,
  133. avatar TEXT NOT NULL)";
  134. if( $db->exec($usertable) && $db->exec($onlinetable) ){
  135. $dbcreated = true;
  136. }else{
  137. errormessage("creating database table for typing");
  138. }
  139. }else{
  140. errormessage("creating database table for messages");
  141. }
  142. if( !$db->close() ){
  143. errormessage("closing database connection");
  144. }
  145. }else{
  146. errormessage("setting journal mode");
  147. }
  148. }else{
  149. errormessage("setting busy timeout");
  150. }
  151. }else{
  152. errormessage("using SQLite");
  153. }
  154. }
  155. }
  156. if(!defined('SLIMBAR')) : define('SLIMBAR', 'true'); endif;
  157. if(!defined('AUTOHIDE')) : define('AUTOHIDE', 'false'); endif;
  158. if(!defined('ENABLEMAIL')) : define('ENABLEMAIL', 'false'); endif;
  159. if(!defined('CUSTOMCSS')) : define('CUSTOMCSS', 'false'); endif;
  160. if(!defined('LOADINGSCREEN')) : define('LOADINGSCREEN', 'true'); endif;
  161. if(!isset($notifyExplode)) : $notifyExplode = array("bar","slidetop"); endif;
  162. if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; $chatSize = "142px"; else : $slimBar = "56"; $userSize = "40"; $chatSize = "171px";endif;
  163. if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon = "settings2.png"; else: $iconRotate = "true"; $settingsIcon = "settings.png"; endif;
  164. $group = (isset($group) ? $group : "guest");
  165. ?>
  166. <!--
  167. ___ ___ ___ ___ ___ ___ ___ ___
  168. /\ \ /\ \ /\ \ /\ \ /\__\ /\ \ /\ \ /\ \
  169. /::\ \ /::\ \ /::\ \ /::\ \ /:| _|_ _\:\ \ _\:\ \ /::\ \
  170. /:/\:\__\ /::\:\__\ /:/\:\__\ /::\:\__\ /::|/\__\ /\/::\__\ /::::\__\ /::\:\__\
  171. \:\/:/ / \;:::/ / \:\:\/__/ \/\::/ / \/|::/ / \::/\/__/ \::;;/__/ \;:::/ /
  172. \::/ / |:\/__/ \::/ / /:/ / |:/ / \:\__\ \:\__\ |:\/__/
  173. \/__/ \|__| \/__/ \/__/ \/__/ \/__/ \/__/ \|__|
  174. [Organizr Version: <?php echo INSTALLEDVERSION; ?> - By: CauseFX]
  175. -->
  176. <!DOCTYPE html>
  177. <html lang="<?php echo $language->getLang(); ?>" class="no-js">
  178. <head>
  179. <meta charset="UTF-8">
  180. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  181. <meta name="apple-mobile-web-app-capable" content="yes" />
  182. <meta name="mobile-web-app-capable" content="yes" /
  183. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  184. <meta name="msapplication-tap-highlight" content="no" />
  185. <title><?=$title;?><?php if($title !== "Organizr") : echo " - Organizr"; endif; ?></title>
  186. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/bootstrap/dist/css/bootstrap.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  187. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/font-awesome/css/font-awesome.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  188. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/mdi/css/materialdesignicons.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  189. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/metisMenu/dist/metisMenu.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  190. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/Waves/dist/waves.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  191. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css?v=<?php echo INSTALLEDVERSION; ?>">
  192. <link rel="stylesheet" href="<?=$baseURL;?>js/selects/cs-select.css?v=<?php echo INSTALLEDVERSION; ?>">
  193. <link rel="stylesheet" href="<?=$baseURL;?>js/selects/cs-skin-elastic.css?v=<?php echo INSTALLEDVERSION; ?>">
  194. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/google-material-color/dist/palette.css?v=<?php echo INSTALLEDVERSION; ?>">
  195. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/sweetalert/dist/sweetalert.css?v=<?php echo INSTALLEDVERSION; ?>">
  196. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/smoke/dist/css/smoke.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  197. <link rel="stylesheet" href="<?=$baseURL;?>js/notifications/ns-style-growl.css?v=<?php echo INSTALLEDVERSION; ?>">
  198. <link rel="stylesheet" href="<?=$baseURL;?>js/notifications/ns-style-other.css?v=<?php echo INSTALLEDVERSION; ?>">
  199. <script src="<?=$baseURL;?>js/menu/modernizr.custom.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  200. <script type="text/javascript" src="<?=$baseURL;?>js/sha1.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  201. <script type="text/javascript" src="<?=$baseURL;?>js/user.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  202. <link rel="stylesheet" href="<?=$baseURL;?>css/style.css?v=<?php echo INSTALLEDVERSION; ?>">
  203. <link rel="stylesheet" href="<?=$baseURL;?>css/weather-icons.css?v=<?php echo INSTALLEDVERSION; ?>">
  204. <link rel="stylesheet" href="bower_components/animate.css/animate.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  205. <link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/android-chrome-192x192.png" sizes="192x192">
  206. <link rel="apple-touch-icon" sizes="180x180" href="<?=$baseURL;?>images/favicon/apple-touch-icon.png">
  207. <link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/favicon-32x32.png" sizes="32x32">
  208. <link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/favicon-16x16.png" sizes="16x16">
  209. <link rel="manifest" href="<?=$baseURL;?>images/favicon/manifest.json">
  210. <link rel="mask-icon" href="<?=$baseURL;?>images/favicon/safari-pinned-tab.svg" color="#2d89ef">
  211. <link rel="shortcut icon" href="<?=$baseURL;?>images/favicon/favicon.ico">
  212. <meta name="msapplication-config" content="<?=$baseURL;?>images/favicon/browserconfig.xml">
  213. <meta name="theme-color" content="#2d89ef">
  214. <link rel="stylesheet" type="text/css" href="css/addtohomescreen.css">
  215. <script src="js/addtohomescreen.js"></script>
  216. <script src="js/push.js"></script>
  217. <!--Other-->
  218. <script src="js/ajax.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  219. <!--[if lt IE 9]>
  220. <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
  221. <script src="bower_components/respondJs/dest/respond.min.js"></script>
  222. <![endif]-->
  223. </head>
  224. <style>
  225. .la-ball-scale-multiple.la-3x {
  226. width: auto !important;
  227. height: auto !important;
  228. }
  229. .logo img {
  230. display: block;
  231. margin: auto;
  232. }
  233. #splashScreen ping span {
  234. margin-top: 0 !important;
  235. font-size: 10px;
  236. zoom: 2;
  237. }
  238. #weather .w-icon.right.pull-right {
  239. font-size: 70px;
  240. }
  241. .new-message{
  242. color: #46bc99 !important;
  243. }
  244. @media screen and (max-width:737px){
  245. .email-body{width: 100%; overflow: auto;height: 100%;}
  246. .email-content, .email-new {
  247. -webkit-overflow-scrolling: touch;
  248. -webkit-transform: translateZ(0);
  249. overflow: scroll;
  250. position: fixed;
  251. height:100% !important;
  252. margin-top:<?=$slimBar;?>px;
  253. }.email-content .email-header, .email-new .email-header{
  254. padding: 10px 30px;
  255. z-index: 1000;
  256. }
  257. }@media screen and (min-width:737px){
  258. .email-body{width: 100%}
  259. .email-content .close-button, .email-content .email-actions, .email-new .close-button, .email-new .email-actions {
  260. position: relative;
  261. top: 15px;
  262. right: 0px;
  263. float: right;
  264. }.email-inner-section {
  265. margin-top: 30px;
  266. }.email-content, .email-new {
  267. overflow: auto;
  268. margin: <?=$slimBar;?>px 0 0 0 !important;
  269. height: 100%;
  270. position: fixed;
  271. max-width: 100%;
  272. width: calc(35%) !important;
  273. right: calc(-35%);
  274. }.email-content .email-header, .email-new .email-header{
  275. position: fixed;
  276. padding: 0px 30px;
  277. width: calc(35%) !important;
  278. z-index: 1000;
  279. }
  280. }
  281. .loop-animation {
  282. animation-iteration-count: infinite;
  283. -webkit-animation-iteration-count: infinite;
  284. -moz-animation-iteration-count: infinite;
  285. -o-animation-iteration-count: infinite;
  286. }
  287. .loop-animation-timeout {
  288. animation-iteration-count: 5;
  289. -webkit-animation-iteration-count: 5;
  290. -moz-animation-iteration-count: 5;
  291. -o-animation-iteration-count: 5;
  292. }
  293. .ping-success {
  294. background: #46bc99 !important;
  295. box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  296. }.ping-warning {
  297. background: #ff3333 !important;
  298. box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  299. }
  300. .TabOpened {
  301. -webkit-filter: drop-shadow(0px 0px 5px <?=$topbartext;?>);
  302. filter: drop-shadow(0px 0px 5px <?=$topbartext;?>);
  303. }.bottom-bnts a {
  304. background: <?=$bottombar;?> !important;
  305. color: <?=$topbartext;?> !important;
  306. }.bottom-bnts {
  307. background: <?=$bottombar;?> !important;
  308. }.gn-menu-main {
  309. background: <?=$topbar;?>;
  310. }.gn-menu-main ul.gn-menu {
  311. background: <?=$sidebar;?>;
  312. }.gn-menu-wrapper {
  313. background: <?=$sidebar;?>;
  314. }.la-timer.la-dark {
  315. color: <?=$topbartext;?>
  316. }.refresh-preloader {
  317. background: <?=$loading;?>;
  318. }.la-timer {
  319. width: 75px;
  320. height: 75px;
  321. padding-top: 20px;
  322. border-radius: 100px;
  323. background: <?=$sidebar;?>;
  324. border: 2px solid <?=$topbar;?>;
  325. }@media screen and (min-width:737px){
  326. .tab-item:hover a {
  327. color: <?=$hovertext;?> !important;
  328. background: <?=$hoverbg;?>;
  329. border-radius: 100px 0 0 100px;
  330. }
  331. }.gn-menu li.active > a {
  332. color: <?=$activetabtext;?> !important;
  333. background: <?=$activetabBG;?>;
  334. border-radius: 100px 0 0 100px;
  335. }.gn-menu li.rightActive > a {
  336. background: <?=$hoverbg;?>;
  337. border-radius: 100px 0 0 100px;
  338. }.gn-menu li.active i.fa {
  339. color: <?=$activetabicon;?>;
  340. }.gn-menu li i.fa {
  341. color: <?=$inactiveicon;?>;
  342. }.gn-menu-main ul.gn-menu a {
  343. color: <?=$inactivetext;?>;
  344. }li.dropdown.some-btn .mdi {
  345. color: <?=$topbartext;?>;
  346. }li.dropdown.some-btn .mdi:hover {
  347. color: <?=$hoverbg;?>;
  348. }.nav>li>a:focus, .nav>li>a:hover {
  349. text-decoration: none;
  350. background-color: transparent;
  351. }div#preloader {
  352. background: <?=$loading;?>;
  353. }.iframe {
  354. -webkit-overflow-scrolling: touch;
  355. }.main-wrapper{
  356. position: absolute !important;
  357. }#menu-toggle span {
  358. background: <?=$topbartext;?>;
  359. }logo.logo {
  360. opacity: 0.5;
  361. filter: alpha(opacity=50);
  362. }.mini-nav .split {
  363. width: calc(50% - 25px);
  364. }.splitRight {
  365. width: 50%;
  366. margin-left: 50% !important;
  367. position: absolute !important;
  368. }.split {
  369. width: 50%;
  370. position: absolute !important;
  371. }.mini-nav .splitRight {
  372. margin-left: calc(50% + 25px) !important;
  373. width: calc(50% - 25px);
  374. }.form-control.material {
  375. background-image: -webkit-gradient(linear, left top, left bottom, from(<?=$topbartext;?>), to(<?=$topbartext;?>)), -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#d2d2d2));
  376. background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
  377. background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
  378. }img.titlelogoclass {
  379. max-width: 250px;
  380. max-height: <?=$slimBar;?>px;
  381. }@media only screen and (max-width: 450px) {
  382. img.titlelogoclass {
  383. max-width: 150px;
  384. }
  385. }.login-btn {
  386. -webkit-border-radius: 4;
  387. -moz-border-radius: 4;
  388. border-radius: 4px;
  389. -webkit-box-shadow: 0px 1px 3px #666666;
  390. -moz-box-shadow: 0px 1px 3px #666666;
  391. box-shadow: 0px 1px 3px #666666;
  392. font-family: Arial;
  393. color: <?=$topbar;?>;
  394. font-size: 10px;
  395. vertical-align: top;
  396. background: <?=$topbartext;?>;
  397. padding: 5px 10px 5px 10px;
  398. text-decoration: none;
  399. font-weight: 700;
  400. font-style: normal;
  401. }.login-btn:hover {
  402. background: <?=$hoverbg;?>;
  403. color: <?=$hovertext;?>;
  404. text-decoration: none;
  405. font-weight: 700;
  406. }
  407. <?php if(SLIMBAR == "true") : ?>
  408. /* Slim Styling */
  409. body{
  410. padding-top: 30px !important;
  411. }.gn-menu-main {
  412. height: 30px !important;
  413. }.gn-menu-wrapper {
  414. top: 30px !important;
  415. }.gn-menu-main .navbar-right {
  416. line-height: 30px !important;
  417. }img.img-circle {
  418. vertical-align: inherit;
  419. margin-top: 2px;
  420. }.menu-toggle .hamburger {
  421. top: 0px !important;
  422. }.top-clock {
  423. line-height: 30px !important;
  424. }img.titlelogoclass {
  425. vertical-align: inherit;
  426. }.members-sidebar {
  427. top: 30px !important;
  428. }.menu-toggle .cross span:nth-child(2) {
  429. left: -9px;
  430. top: 41px;
  431. }.menu-toggle.gn-selected .cross span:nth-child(2) {
  432. width: 53%;
  433. }.menu-toggle.gn-selected .cross span:nth-child(1) {
  434. height: 105% !important;
  435. }.menu-toggle .cross span:nth-child(1) {
  436. left: 6px !important;
  437. top: 26px !important;
  438. }.menu-toggle .hamburger span {
  439. margin: 5px 0;
  440. width: 25px;
  441. }.menu-toggle .hamburger {
  442. margin-left: -17px;
  443. }.ns-effect-slidetop {
  444. padding: 6px 22px;
  445. }.ns-effect-exploader {
  446. padding: 5px 22px;
  447. }
  448. [class^="icon-"]:before, [class*=" icon-"]:before {
  449. display: inline !important;
  450. }
  451. <?php endif; ?>
  452. <?php customCSS(); ?>
  453. </style>
  454. <body id="body-index" class="group-<?php echo $group;?>" style="overflow: hidden">
  455. <?php if (LOADINGSCREEN == "true") : ?>
  456. <!--Preloader-->
  457. <div id="preloader" class="preloader table-wrapper">
  458. <div class="table-row">
  459. <div class="table-cell">
  460. <div class="la-ball-scale-multiple la-3x" style="color: <?=$topbar;?>">
  461. <logo class="logo"><img height="192px" src="<?=$loadingIcon;?>"></logo>
  462. </div>
  463. </div>
  464. </div>
  465. </div>
  466. <?php endif; ?>
  467. <div id="main-wrapper" class="main-wrapper" tabindex="-1">
  468. <ul id="gn-menu" class="gn-menu-main">
  469. <li class="gn-trigger">
  470. <a id="menu-toggle" class="menu-toggle gn-icon gn-icon-menu">
  471. <div class="hamburger">
  472. <span></span>
  473. <span></span>
  474. <span></span>
  475. </div>
  476. <div class="cross">
  477. <span></span>
  478. <span></span>
  479. </div>
  480. </a>
  481. <nav class="gn-menu-wrapper">
  482. <div class="gn-scroller" id="gn-scroller">
  483. <ul id="tabList" class="gn-menu metismenu">
  484. <!--Start Tab List-->
  485. <?php
  486. if($tabSetup == "No") {
  487. $tabCount = 1;
  488. $allPings = array();
  489. if (is_array($result)) {
  490. foreach($result as $row) {
  491. $name = str_replace(array(':', '\\', '/', '*'), 'x', $row['ping_url']);
  492. if($row['defaultz'] == "true") {
  493. $defaultz = "active";
  494. }else {
  495. $defaultz = "";
  496. } ?>
  497. <li window="<?=$row['window'];?>" class="tab-item <?=$defaultz;?>" id="<?=$row['url'];?>x" data-title="<?=$row['name'];?>" name="<?php echo strtolower($row['name']);?>">
  498. <a class="tab-link">
  499. <?php if($row['iconurl']) { ?>
  500. <i style="font-size: 19px; padding: 0 10px; font-size: 19px" data-toggle="tooltip" data-placement="bottom" data-original-title="<?=$row['name'];?>">
  501. <span id="<?=$row['url'];?>s" class="badge badge-success" style="position: absolute;z-index: 100;right: 0px;"></span>
  502. <img src="<?=$row['iconurl'];?>" style="height: 30px; width: 30px; margin-top: -2px;">
  503. <?php if($row['ping'] == "true" && $row['ping_url']){ $allPings["image".$name] = $row['ping_url']; ?>
  504. <ping class="ping-<?=$name;?> startPingTimer"></ping>
  505. <?php }?>
  506. </i>
  507. <?php }else { ?>
  508. <i class="fa <?=$row['icon'];?> fa-lg" data-toggle="tooltip" data-placement="bottom" data-original-title="<?=$row['name'];?>">
  509. <span id="<?=$row['url'];?>s" class="badge badge-success" style="position: absolute;z-index: 100;right: 0px;"></span>
  510. <?php if($row['ping'] == "true" && $row['ping_url']){ $allPings["icon".$name] = $row['ping_url']; ?>
  511. <ping class="ping-<?=$name;?> startPingTimer"></ping>
  512. <?php }?>
  513. </i>
  514. <?php } ?>
  515. <?=$row['name'];?>
  516. </a>
  517. </li>
  518. <?php
  519. $tabCount++;
  520. };
  521. }
  522. }?>
  523. <?php if($configReady == "Yes") : if($USER->authenticated && $USER->role == "admin") :?>
  524. <li class="tab-item <?=$settingsActive;?>" id="settings.phpx" data-title="Settings" name="settings">
  525. <a class="tab-link">
  526. <?php if($settingsicon == "Yes") :
  527. echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  528. <img id="settings-icon" src="images/' . $settingsIcon . '" style="height: 30px; margin-top: -2px;"></i>';
  529. else :
  530. echo '<i id="settings-icon" class="fa fa-cog"></i>';
  531. endif; ?>
  532. <?php echo $language->translate("SETTINGS");?>
  533. </a>
  534. </li>
  535. <li style="display: none;" class="tab-item" id="updatedb.phpx" data-title="Upgrade" name="upgrade">
  536. <a class="tab-link">
  537. <?php if($settingsicon == "Yes") :
  538. echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  539. <img id="upgrade-icon" src="images/upgrade.png" style="height: 30px; margin-top: -2px;"></i>';
  540. else :
  541. echo '<i id="upgrade-icon" class="fa fa-arrow-up"></i>';
  542. endif; ?>
  543. <?php echo $language->translate("UPGRADE");?>
  544. </a>
  545. </li>
  546. <?php endif; endif;?>
  547. <!--End Tab List-->
  548. </ul>
  549. </div>
  550. <!-- /gn-scroller -->
  551. <div class="bottom-bnts">
  552. <a class="fix-nav"><i class="mdi mdi-pin"></i></a>
  553. </div>
  554. </nav>
  555. </li>
  556. <li class="top-clock">
  557. <?php
  558. if($configReady == "Yes") :
  559. if(TITLELOGO == "") :
  560. echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
  561. else :
  562. echo "<img class='titlelogoclass' src='" . TITLELOGO . "'>";
  563. endif;
  564. else :
  565. echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
  566. endif;
  567. ?>
  568. </li>
  569. <li class="pull-right">
  570. <ul class="nav navbar-right right-menu">
  571. <?php if($configReady == "Yes"){?>
  572. <li class="dropdown some-btn">
  573. <a class="show-members">
  574. <i class="userpic"><?=$showPic;?></i>
  575. </a>
  576. </li>
  577. <?php if(!$USER->authenticated){?>
  578. <li class="dropdown some-btn">
  579. <a class="log-in">
  580. <login class='login-btn text-uppercase'><?php echo $language->translate("LOGIN"); ?></login>
  581. </a>
  582. </li>
  583. <?php } }?>
  584. <?php if(CHAT == "true" && qualifyUser(CHATAUTH)){?>
  585. <li class="dropdown some-btn">
  586. <a id="chat-open" class="chat-open">
  587. <i class="mdi mdi-forum animated"></i>
  588. <span class="label label-new-message"></span>
  589. </a>
  590. </li>
  591. <?php } ?>
  592. </ul>
  593. </li>
  594. </ul>
  595. <!--Content-->
  596. <div id="content" class="content" style="">
  597. <script>addToHomescreen();</script>
  598. <!--Load Framed Content-->
  599. <?php if($needSetup == "Yes" && $configReady == "Yes") : ?>
  600. <div class="table-wrapper" style="background:<?=$sidebar;?>;">
  601. <div class="table-row">
  602. <div class="table-cell text-center">
  603. <div class="login i-block">
  604. <div class="content-box">
  605. <div class="biggest-box" style="background:<?=$topbar;?>;">
  606. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("CREATE_ADMIN");?></h1>
  607. </div>
  608. <div class="big-box text-left registration-form">
  609. <h4 class="text-center"><?php echo $language->translate("CREATE_ACCOUNT");?></h4>
  610. <form class="controlbox" name="new user registration" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  611. <input type="hidden" name="op" value="register"/>
  612. <input type="hidden" name="sha1" value=""/>
  613. <input type="hidden" name="settings" value="false"/>
  614. <div class="form-group">
  615. <input type="text" class="form-control material" name="username" autofocus placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" minlength="3" maxlength="16" required>
  616. </div>
  617. <div class="form-group">
  618. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  619. </div>
  620. <div class="form-group">
  621. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>" data-smk-strongPass="weak" required>
  622. </div>
  623. <div class="form-group">
  624. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  625. </div>
  626. <button id="registerSubmit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block text-uppercase waves waves-effect waves-float" value="Register"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("REGISTER");?></text></button>
  627. </form>
  628. </div>
  629. </div>
  630. </div>
  631. </div>
  632. </div>
  633. </div>
  634. <?php endif; ?>
  635. <?php if($needSetup == "Yes" && $configReady == "No") : ?>
  636. <div class="table-wrapper" style="background:<?=$sidebar;?>;">
  637. <div class="table-row">
  638. <div class="table-cell text-center">
  639. <div class="login i-block">
  640. <div class="content-box">
  641. <div class="biggest-box" style="background:<?=$topbar;?>;">
  642. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("DATABASE_PATH");?></h1>
  643. </div>
  644. <div class="big-box text-left">
  645. <h3 class="text-center"><?php echo $language->translate("SPECIFY_LOCATION");?></h3>
  646. <h5 class="text-left"><strong><?php echo $language->translate("CURRENT_DIRECTORY");?>: <?php echo str_replace("\\","/",__DIR__); ?> <br><?php echo $language->translate("PARENT_DIRECTORY");?>: <?php echo str_replace("\\","/",dirname(__DIR__)); ?></strong></h5>
  647. <form class="controlbox" name="setupDatabase" id="setupDatabase" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  648. <input type="hidden" name="action" value="createLocation" />
  649. <div class="form-group">
  650. <input type="text" class="form-control material" name="database_Location" autofocus value="<?php echo str_replace("\\","/",dirname(__DIR__));?>" autocorrect="off" autocapitalize="off" required>
  651. <h5><?php echo $language->translate("SET_DATABASE_LOCATION");?></h5>
  652. <?php echo getTimezone();?>
  653. <h5><?php echo $language->translate("SET_TIMEZONE");?></h5>
  654. <?php
  655. if(file_exists(dirname(__DIR__) . '/users.db') || file_exists(__DIR__ . '/users.db') || file_exists(__DIR__ . '/config/users.db')) :
  656. echo '<h5 class="text-center red">';
  657. echo $language->translate("DONT_WORRY");
  658. echo '</h5>';
  659. endif;?>
  660. </div>
  661. <button style="background:<?=$topbar;?>;" id="databaseLocationSubmit" type="submit" class="btn btn-block btn-sm text-uppercase waves waves-effect waves-float" value="Save Location"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SAVE_LOCATION");?></text></button>
  662. </form>
  663. </div>
  664. </div>
  665. </div>
  666. </div>
  667. </div>
  668. </div>
  669. <?php endif; ?>
  670. <?php if($configReady == "Yes") : if(!$USER->authenticated && $tabSetup == "Yes" && $needSetup == "No") :?>
  671. <div class="table-wrapper">
  672. <div class="table-row">
  673. <div class="table-cell text-center">
  674. <div class="login i-block">
  675. <div class="content-box">
  676. <div class="blue-bg biggest-box">
  677. <h1 class="zero-m text-uppercase"><?php echo $language->translate("AWESOME");?></h1>
  678. </div>
  679. <div class="big-box text-left">
  680. <h4 class="text-center"><?php echo $language->translate("TIME_TO_LOGIN");?></h4>
  681. <button type="submit" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("LOGIN");?></button>
  682. </div>
  683. </div>
  684. </div>
  685. </div>
  686. </div>
  687. </div>
  688. <?php endif; endif; ?>
  689. <?php if($tabSetup == "No" && $needSetup == "No") :?>
  690. <div id="tabEmpty" class="table-wrapper" style="display: none; background:<?=$sidebar;?>;">
  691. <div class="table-row">
  692. <div class="table-cell text-center">
  693. <div class="login i-block">
  694. <div class="content-box">
  695. <div class="biggest-box" style="background:<?=$topbar;?>;">
  696. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("HOLD_UP");?></h1>
  697. </div>
  698. <div class="big-box text-left">
  699. <!--<center><img src="images/sowwy.png" style="height: 200px;"></center>
  700. <h2 class="text-center"><?php echo $language->translate("LOOKS_LIKE_YOU_DONT_HAVE_ACCESS");?></h2>-->
  701. <?php if(!$USER->authenticated) : ?>
  702. <button style="background:<?=$topbar;?>;" type="submit" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("LOGIN");?></text></button>
  703. <?php endif; ?>
  704. </div>
  705. </div>
  706. </div>
  707. </div>
  708. </div>
  709. </div>
  710. <?php endif;?>
  711. <!--End Load Framed Content-->
  712. </div>
  713. <div id="contentRight" class="content splitRight" style="">
  714. </div>
  715. <!--End Content-->
  716. </div>
  717. <?php if($configReady == "Yes") : if(!$USER->authenticated && $configReady == "Yes") : ?>
  718. <div id="loginModal" class="login-modal modal fade">
  719. <div style="background:<?=$sidebar;?>;" class="table-wrapper">
  720. <div class="table-row">
  721. <div class="table-cell text-center">
  722. <button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
  723. <span aria-hidden="true">&times;</span>
  724. </button>
  725. <div class="login i-block">
  726. <div class="content-box">
  727. <div style="background:<?=$topbar;?>;" class="biggest-box">
  728. <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("WELCOME");?></h1>
  729. </div>
  730. <div class="big-box text-left login-form">
  731. <?php if($USER->error!="") : ?>
  732. <p class="error">Error: <?php echo $USER->error; ?></p>
  733. <?php endif; ?>
  734. <form name="log in" id="login" action="" method="POST">
  735. <h4 class="text-center"><?php echo $language->translate("LOGIN");?></h4>
  736. <div class="form-group">
  737. <input type="hidden" name="op" value="login">
  738. <input type="hidden" name="sha1" value="">
  739. <input type="hidden" name="password" value="">
  740. <input type="hidden" name="rememberMe" value="false"/>
  741. <input type="text" class="form-control material" name="username" placeholder="<?php echo $language->translate("USERNAME");?>" autocomplete="off" autocorrect="off" autocapitalize="off" value="" autofocus required>
  742. </div>
  743. <div class="form-group">
  744. <input type="password" class="form-control material" name="password1" value="" autocomplete="off" placeholder="<?php echo $language->translate("PASSWORD");?>" required>
  745. </div>
  746. <div class="form-group">
  747. <div class="i-block"> <input id="rememberMe" name="rememberMe" class="switcher switcher-success switcher-medium pull-left" value="true" type="checkbox" checked="">
  748. <label for="rememberMe" class="pull-left"></label>
  749. <label class="pull-right"> &nbsp; <?php echo $language->translate("REMEMBER_ME");?></label>
  750. </div>
  751. </div>
  752. <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>
  753. </form>
  754. <?php if (ENABLEMAIL == "true") : ?>
  755. <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>
  756. <?php endif; ?>
  757. <?php if(REGISTERPASSWORD != "") : ?>
  758. <button id="switchCreateUser" style="background:<?=$hoverbg;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$hovertext;?>;"><?php echo $language->translate("CREATE_USER");?></text></button>
  759. <?php endif; ?>
  760. <form style="display: none;" name="forgotPassword" id="forgotPassword" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  761. <h4 class="text-center"><?php echo $language->translate("FORGOT_PASSWORD");?></h4>
  762. <div class="form-group">
  763. <input type="hidden" name="op" value="reset">
  764. <input type="text" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>" autocorrect="off" autocapitalize="off" value="" autofocus required>
  765. </div>
  766. <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>
  767. </form>
  768. <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>
  769. <?php if(REGISTERPASSWORD != "") : ?>
  770. <div id="userPassForm" style="display: none;">
  771. <form id="userCreateForm" action="register.php" method="POST">
  772. <h4 class="text-center"><?php echo $language->translate("ENTER_PASSWORD_TO_REGISTER");?></h4>
  773. <center><h5 id="userCreateErrors" style="color: red"></h5></center>
  774. <div class="form-group">
  775. <input type="text" class="form-control material" name="registerPasswordValue" placeholder="<?php echo $language->translate("PASSWORD");?>" autocorrect="off" autocapitalize="off" value="" autofocus required>
  776. </div>
  777. <button style="background:<?=$topbar;?>;" type="submit" id="checkRegisterPass" class="btn btn-block btn-info text-uppercase waves" value="reset password"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SUBMIT");?></text></button>
  778. </form>
  779. <button id="welcomeGoBack2" 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>
  780. </div>
  781. <form style="display: none;" name="createUser" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  782. <h4 class="text-center"><?php echo $language->translate("CREATE_USER");?></h4>
  783. <input type="hidden" name="op" value="register"/>
  784. <input type="hidden" name="sha1" value=""/>
  785. <input type="hidden" name="settings" value="false"/>
  786. <input type="hidden" name="validate" id="validate" value=""/>
  787. <div class="form-group">
  788. <input type="text" class="form-control material" name="username" autofocus placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" minlength="3" maxlength="16" required>
  789. </div>
  790. <div class="form-group">
  791. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  792. </div>
  793. <div class="form-group">
  794. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>" data-smk-strongPass="weak" required>
  795. </div>
  796. <div class="form-group">
  797. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  798. </div>
  799. <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>
  800. <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>
  801. </form>
  802. <?php endif; ?>
  803. </div>
  804. </div>
  805. </div>
  806. </div>
  807. </div>
  808. </div>
  809. </div>
  810. <?php endif; endif; ?>
  811. <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
  812. <div style="background:<?=$topbar;?>;" class="logout-modal modal fade">
  813. <div class="table-wrapper" style="background: <?=$sidebar;?>">
  814. <div class="table-row">
  815. <div class="table-cell text-center">
  816. <div class="login i-block">
  817. <div class="content-box">
  818. <div style="background:<?=$topbar;?>;" class="biggest-box">
  819. <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("LOGOUT");?></h1>
  820. </div>
  821. <div class="big-box login-form">
  822. <form name="log out" id="logout" action="" method="POST">
  823. <input type="hidden" name="op" value="logout">
  824. <input type="hidden" name="username"value="<?php echo $_SESSION["username"]; ?>" >
  825. <!--<center><img src="images/sowwy.png" style="height: 200px;"></center>-->
  826. <h3 style="color:<?=$topbar;?>;" class="zero-m text-uppercase"><?php echo $language->translate("DO_YOU_WANT_TO_LOGOUT");?></h3>
  827. <a style="color:<?=$topbar;?>;" id="logoutSubmit" class="i-block" data-dismiss="modal"><?php echo $language->translate("YES_WORD");?></a>
  828. <a style="color:<?=$topbar;?>;" class="i-block" data-dismiss="modal"><?php echo $language->translate("NO_WORD");?></a>
  829. </form>
  830. </div>
  831. </div>
  832. </div>
  833. </div>
  834. </div>
  835. </div>
  836. </div>
  837. <?php endif; endif;?>
  838. <?php if(isset($_GET['inviteCode'])){ ?>
  839. <div id="inviteSet" class="login-modal modal fade">
  840. <div style="background:<?=$sidebar;?>;" class="table-wrapper">
  841. <div class="table-row">
  842. <div class="table-cell text-center">
  843. <button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
  844. <span aria-hidden="true">&times;</span>
  845. </button>
  846. <div class="login i-block">
  847. <div class="content-box">
  848. <div style="background:<?=$topbar;?>;" class="biggest-box">
  849. <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("WELCOME");?></h1>
  850. </div>
  851. <div class="big-box text-left login-form">
  852. <?php if($USER->error!="") : ?>
  853. <p class="error">Error: <?php echo $USER->error; ?></p>
  854. <?php endif; ?>
  855. <form name="checkInviteForm" id="checkInviteForm" onsubmit="return false;" data-smk-icon="glyphicon-remove-sign">
  856. <h4 class="text-center"><?php echo $language->translate("CHECK_INVITE");?></h4>
  857. <div class="form-group">
  858. <input style="font-size: 400%; height: 100%" type="text" class="form-control yellow-bg text-center text-uppercase" name="inviteCode" placeholder="<?php echo $language->translate("CODE");?>" autocomplete="off" autocorrect="off" autocapitalize="off" value="<?=$inviteCode;?>" maxlength="6" spellcheck="false" autofocus required>
  859. </div>
  860. <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>
  861. </form>
  862. <div style="display: none" id="chooseMethod">
  863. <h4 class="text-center"><?php echo $language->translate("HAVE_ACCOUNT");?></h4>
  864. <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>
  865. <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>
  866. </div>
  867. <form style="display:none" name="useInviteForm" id="useInviteForm" onsubmit="return false;" data-smk-icon="glyphicon-remove-sign">
  868. <h4 class="text-center"><?php echo $language->translate("ENTER_PLEX_NAME");?></h4>
  869. <h4 id="accountMade" style="display: none" class="text-center">
  870. <span class="label label-primary"><?php echo $language->translate("ACCOUNT_MADE");?></span>
  871. </h4>
  872. <div id="accountSubmitted" style="display: none" class="panel panel-success">
  873. <div class="panel-heading">
  874. <h3 class="panel-title"><?php echo explosion($language->translate('ACCOUNT_SUBMITTED'), 0);?></h3>
  875. </div>
  876. <div class="panel-body">
  877. <?php echo explosion($language->translate('ACCOUNT_SUBMITTED'), 1);?><br/>
  878. <?php echo explosion($language->translate('ACCOUNT_SUBMITTED'), 2);?><br/>
  879. <?php echo explosion($language->translate('ACCOUNT_SUBMITTED'), 3);?>
  880. </div>
  881. </div>
  882. <div class="form-group">
  883. <input style="font-size: 400%; height: 100%" type="hidden" class="form-control yellow-bg text-center text-uppercase" name="inviteCode" placeholder="<?php echo $language->translate("CODE");?>" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" value="<?=$inviteCode;?>" maxlength="6" required>
  884. <input type="text" class="form-control material" name="inviteUser" placeholder="<?php echo $language->translate("USERNAME_EMAIL");?>" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" value="" autofocus required>
  885. </div>
  886. <button id="useInviteForm_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("JOIN");?></text></button>
  887. <button id="plexYesGoBack" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
  888. </form>
  889. <form style="display:none" name="joinPlexForm" id="joinPlexForm" onsubmit="return false;" data-smk-icon="glyphicon-remove-sign">
  890. <h4 class="text-center"><?php echo $language->translate("CREATE_PLEX");?></h4>
  891. <div class="form-group">
  892. <input type="text" class="form-control material" name="joinUser" placeholder="<?php echo $language->translate("USERNAME");?>" autocomplete="new-password" autocorrect="off" autocapitalize="off" spellcheck="false" value="" autofocus required>
  893. <input type="text" class="form-control material" name="joinEmail" placeholder="<?php echo $language->translate("EMAIL");?>" autocomplete="new-password" autocorrect="off" autocapitalize="off" spellcheck="false" value="" required>
  894. <input type="password" class="form-control material" name="joinPassword" placeholder="<?php echo $language->translate("PASSWORD");?>" autocomplete="new-password" autocorrect="off" autocapitalize="off" spellcheck="false" value="" required>
  895. </div>
  896. <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>
  897. <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>
  898. </form>
  899. </div>
  900. </div>
  901. </div>
  902. </div>
  903. </div>
  904. </div>
  905. </div>
  906. <?php } ?>
  907. <?php if (file_exists('config/config.php') && $configReady == "Yes" && $tabSetup == "No" && SPLASH == "true" && $splash && count($splash) > 1 && qualifyUser(SPLASHAUTH)) {?>
  908. <div id="splashScreen" class="splash-modal modal fade">
  909. <div style="background:<?=$sidebar;?>;" class="table-wrapper big-box">
  910. <button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
  911. <span aria-hidden="true">&times;</span>
  912. </button>
  913. <br/><br/>
  914. <div class="row">
  915. <div class="col-lg-12">
  916. <div class="row">
  917. <?php if($tabSetup == "No") : $tabCount = 1; foreach($splash as $row) :
  918. $name = str_replace(array(':', '\\', '/', '*'), 'x', $row['ping_url']);?>
  919. <div class="col-xs-6 col-md-2 col-lg-2 splashContainer" id="splash-<?php echo strtolower($row['name']);?>">
  920. <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']);?>">
  921. <div class="w-content">
  922. <div class="w-icon">
  923. <center>
  924. <?php if($row['iconurl']) : ?>
  925. <i style="">
  926. <img src="<?=$row['iconurl'];?>" style="height: 100px; margin-top: -10px;" class="">
  927. </i>
  928. <?php if($row['ping'] == "true" && $row['ping_url']){ $allPings["image".$name] = $row['ping_url']; ?>
  929. <ping style="display: block" class="ping-<?=$name;?>"></ping>
  930. <?php }?>
  931. <?php else : ?>
  932. <i style="padding-bottom: 8px" class="fa <?=$row['icon'];?> fa-sm"></i>
  933. <?php if($row['ping'] == "true" && $row['ping_url']){ $allPings["icon".$name] = $row['ping_url']; ?>
  934. <ping style="display: block" class="ping-<?=$name;?>"></ping>
  935. <?php }?>
  936. <?php endif; ?>
  937. </center>
  938. </div>
  939. <div class="text-center"><span class="text-uppercase w-name elip"><?=$row['name'];?></span></div>
  940. </div>
  941. </li>
  942. </div>
  943. <?php $tabCount++; endforeach; endif;?>
  944. <?php if( $USER->authenticated && $USER->role == "admin" ){ ?>
  945. <div class="col-xs-6 col-md-2 col-lg-2 splashContainer">
  946. <li style="list-style-type: none; cursor: pointer;" class="splash-item content-box small-box ultra-widget gray-bg" data-title="" name="settings">
  947. <div class="w-content">
  948. <div class="w-icon">
  949. <center>
  950. <i style="">
  951. <img src="images/<?=$settingsIcon;?>" style="height: 100px; margin-top: -10px;" class="">
  952. </i>
  953. </center>
  954. </div>
  955. <div class="text-center"><span class="text-uppercase w-name elip">Settings</span></div>
  956. </div>
  957. </li>
  958. </div>
  959. <?php } ?>
  960. </div>
  961. </div>
  962. </div>
  963. </div>
  964. </div>
  965. <?php } ?>
  966. <!-- CHAT BOX -->
  967. <?php if(CHAT == "true" && qualifyUser(CHATAUTH) && $dbcreated){?>
  968. <div id="main-chat" class="email-content chat-box white-bg" style="z-index:1000000">
  969. <div class="email-body">
  970. <div class="email-inner small-box" style="padding: 0">
  971. <div class="email-inner-section" style="margin-top: 0;">
  972. <div class="small-box fade in" style="padding: 0">
  973. <div class="main-wrapper" style="position: initial; left:0;">
  974. <div id="content">
  975. <div class="btn-group btn-group-justified grayish-blue-bg">
  976. <div class="btn-group" role="group">
  977. <button id="chat-switch-chat" type="button" class="btn waves waves-effect waves-float grayish-blue-bg"><i class="fa fa-comments-o"></i> Chat</button>
  978. </div>
  979. <div class="btn-group" role="group">
  980. <button id="chat-switch-online" type="button" class="btn waves waves-effect waves-float grayish-blue-bg"><i id="online-count" class="fa fa-users"></i> Online Users</button>
  981. </div>
  982. <div class="btn-group" role="group">
  983. <button id="chat-switch-close" type="button" class="btn waves waves-effect waves-float grayish-blue-bg"><i class="fa fa-close"></i> Close</button>
  984. </div>
  985. </div>
  986. <div id="chat-chat-div" class="">
  987. <div class="big-box chat gray-bg">
  988. <div class="box" style="overflow: hidden; width: auto; height: calc(100vh - <?php echo $chatSize; ?>)">
  989. <div id="intro">
  990. <center><img class="logo" alt="logo" src="images/organizr-logo-h.png" style="width: 100%;">
  991. <br><br>start chatting...</center>
  992. </div>
  993. <ul id="messages" class="chat-double chat-container"></ul>
  994. <ul class="chat-double chat-container" style="padding: 0px;"><li id="istyping"></li></ul>
  995. </div>
  996. <br/>
  997. <input id="message" autofocus onfocus="ensureVisible(this)" type="text" class="form-control gray-bg" placeholder="Enter your text" autocomplete="off"/>
  998. <audio id="tabalert" preload="auto">
  999. <source src="chat/audio/newmessage.mp3" type="audio/mpeg">
  1000. </audio>
  1001. </div>
  1002. </div>
  1003. <div id="chat-users-div" class="col-lg-12 gray-bg" style="display: none;">
  1004. <div class="gray-bg" style="overflow: hidden; width: auto; height: calc(100vh - 62px);">
  1005. <br>
  1006. <div class="content-box">
  1007. <div class="content-title big-box i-block gray-bg">
  1008. <h4 class="zero-m">Online</h4>
  1009. </div>
  1010. <div class="clearfix"></div>
  1011. <div id="onlineusers" class="big-box" style="color:black;"></div>
  1012. </div>
  1013. </div>
  1014. </div>
  1015. </div>
  1016. </div>
  1017. </div>
  1018. </div>
  1019. </div>
  1020. </div>
  1021. </div>
  1022. <?php } ?>
  1023. <?php if($configReady == "Yes"){ ?>
  1024. <!-- New User Menu BOX -->
  1025. <div id="main-user" class="email-content user-box white-bg" style="z-index:1000000">
  1026. <div class="email-body">
  1027. <div class="email-inner small-box" style="padding: 0">
  1028. <div class="email-inner-section" style="margin-top: 0;">
  1029. <div class="small-box fade in" style="padding: 0">
  1030. <div class="main-wrapper" style="position: initial; left:0;">
  1031. <div id="content">
  1032. <div class="btn-group btn-group-justified grayish-blue-bg">
  1033. <div class="btn-group" role="group">
  1034. <button id="reload" type="button" data-toggle="tooltip" data-placement="bottom" data-original-title="Refresh Tab" class="user-switch btn waves waves-effect waves-float grayish-blue-bg" style="border-radius:0"><i class="fa fa-refresh"></i></button>
  1035. </div>
  1036. <div class="btn-group" role="group">
  1037. <button id="splitView" type="button" data-toggle="tooltip" data-placement="bottom" data-original-title="Close Tab" class="user-switch btn waves waves-effect waves-float grayish-blue-bg"><i class="fa fa-window-close"></i></button>
  1038. </div>
  1039. <div class="btn-group" role="group">
  1040. <button id="popout" type="button" data-toggle="tooltip" data-placement="bottom" data-original-title="Open Tab In New Window" class="user-switch btn waves waves-effect waves-float grayish-blue-bg"><i class="fa fa-external-link"></i></button>
  1041. </div>
  1042. <div class="btn-group" role="group">
  1043. <button id="fullscreen" type="button" data-toggle="tooltip" data-placement="bottom" data-original-title="Fullscreen" class="fullscreen user-switch btn waves waves-effect waves-float grayish-blue-bg"><i class="fa fa-arrows-alt"></i></button>
  1044. </div>
  1045. <?php if($USER->authenticated){?>
  1046. <div class="btn-group" role="group">
  1047. <button id="editInfo" type="button" data-toggle="tooltip" data-placement="bottom" data-original-title="User Information" class="user-switch btn waves waves-effect waves-float grayish-blue-bg"><i class="fa fa-user-circle"></i></button>
  1048. </div>
  1049. <div class="btn-group" role="group">
  1050. <button id="logout" type="button" data-toggle="tooltip" data-placement="bottom" data-original-title="Signout" class="logout user-switch btn waves waves-effect waves-float grayish-blue-bg"><i class="fa fa-sign-out"></i></button>
  1051. </div>
  1052. <?php } ?>
  1053. <div class="btn-group" role="group">
  1054. <button id="user-switch-close" type="button" data-toggle="tooltip" data-placement="bottom" data-original-title="Close" class="user-switch btn waves waves-effect waves-float grayish-blue-bg" style="border-radius:0"><i class="fa fa-close"></i></button>
  1055. </div>
  1056. </div>
  1057. <!--EDIT USER -->
  1058. <div id="user-menu-div" class="col-lg-12 gray-bg" style="display: block;">
  1059. <div class="gray-bg" style="overflow: hidden; width: auto; height: calc(100vh - 62px)">
  1060. <br>
  1061. <div class="content-box" style="left: 0;right: 0;">
  1062. <span style="display: block" class="current-time gray text-center"></span>
  1063. </div>
  1064. <div class="content-box">
  1065. <div class="profile-usertitle">
  1066. <?php if(GRAVATAR == "true") : ?>
  1067. <img src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=100&d=mm" class="img-responsive img-circle center-block" alt="user">
  1068. <?php endif; ?>
  1069. <div class="profile-usertitle-name">
  1070. <?php echo strtoupper($USER->username); ?>
  1071. </div>
  1072. <div class="profile-usertitle-job">
  1073. <?php echo strtoupper($USER->role); ?>
  1074. </div>
  1075. </div>
  1076. <div class="clearfix"></div>
  1077. </div>
  1078. <?php if($USER->authenticated){?>
  1079. <div id="editInfoDiv" class="content-box" style="display: none">
  1080. <div class="profile-usertitle">
  1081. <form class="content-form form-horizontal small-box" name="update" id="update" action="" method="POST">
  1082. <input type="hidden" name="op" value="update"/>
  1083. <input type="hidden" name="sha1" value=""/>
  1084. <input type="hidden" name="password" value="">
  1085. <input type="hidden" name="username" value="<?php echo $USER->username; ?>"/>
  1086. <input type="hidden" name="role" value="<?php echo $USER->role; ?>"/>
  1087. <div class="form-group">
  1088. <label for="user-email" class="col-sm-4 control-label gray"><?php echo $language->translate("EMAIL_ADDRESS");?></label>
  1089. <div class="col-sm-8">
  1090. <input type="email" autocomplete="off" value="<?php echo $USER->email; ?>" class="form-control material gray" name="email" id="user-email" placeholder="<?php echo $language->translate("EMAIL_ADDRESS");?>">
  1091. </div>
  1092. </div>
  1093. <div class="form-group">
  1094. <label for="password1" class="col-sm-4 control-label gray"><?php echo $language->translate("PASSWORD");?></label>
  1095. <div class="col-sm-8">
  1096. <input type="password" autocomplete="off" class="form-control material gray" name="password1" id="user-email" placeholder="<?php echo $language->translate("PASSWORD");?>">
  1097. </div>
  1098. </div>
  1099. <div class="form-group">
  1100. <label for="password2" class="col-sm-4 control-label gray"><?php echo $language->translate("PASSWORD_AGAIN");?></label>
  1101. <div class="col-sm-8">
  1102. <input type="password" autocomplete="off" class="form-control material gray" name="password2" id="user-email" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  1103. </div>
  1104. </div>
  1105. <br><br>
  1106. <div class="form-group">
  1107. <input type="button" class="btn btn-success text-uppercase waves-effect waves-float" value="<?php echo $language->translate("UPDATE");?>" onclick="User.processUpdate()"/>
  1108. <button id="goBackButtons" type="button" class="btn btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("GO_BACK");?></button>
  1109. </div>
  1110. </form>
  1111. </div>
  1112. </div>
  1113. <?php } ?>
  1114. <div id="weather" class="gray"></div>
  1115. </div>
  1116. </div>
  1117. <!-- END EDIT USER -->
  1118. <!--EDIT USER -->
  1119. <div id="user-users-div" class="col-lg-12 gray-bg" style="display: none;">
  1120. <div class="gray-bg" style="overflow: hidden; width: auto; height: calc(100vh - 62px);">
  1121. <br>
  1122. <div class="content-box">
  1123. <div class="content-title big-box i-block gray-bg">
  1124. <h4 class="zero-m">Online</h4>
  1125. </div>
  1126. <div class="clearfix"></div>
  1127. </div>
  1128. </div>
  1129. </div>
  1130. <!-- END EDIT USER -->
  1131. </div>
  1132. </div>
  1133. </div>
  1134. </div>
  1135. </div>
  1136. </div>
  1137. </div>
  1138. <?php } ?>
  1139. <!--Scripts-->
  1140. <script src="<?=$baseURL;?>bower_components/jquery/dist/jquery.min.js"></script>
  1141. <script src="<?=$baseURL;?>bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  1142. <script src="<?=$baseURL;?>bower_components/metisMenu/dist/metisMenu.min.js"></script>
  1143. <script src="<?=$baseURL;?>bower_components/Waves/dist/waves.min.js"></script>
  1144. <script src="<?=$baseURL;?>bower_components/moment/min/moment.min.js"></script>
  1145. <script src="<?=$baseURL;?>bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  1146. <script src="<?=$baseURL;?>bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  1147. <script src="<?=$baseURL;?>bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  1148. <script src="<?=$baseURL;?>bower_components/cta/dist/cta.min.js"></script>
  1149. <!--Menu-->
  1150. <script src="<?=$baseURL;?>js/menu/classie.js"></script>
  1151. <script src="<?=$baseURL;?>js/menu/gnmenu.js"></script>
  1152. <!--Selects-->
  1153. <script src="<?=$baseURL;?>js/selects/selectFx.js"></script>
  1154. <script src="<?=$baseURL;?>bower_components/sweetalert/dist/sweetalert.min.js"></script>
  1155. <script src="<?=$baseURL;?>bower_components/smoke/dist/js/smoke.min.js"></script>
  1156. <!--Notification-->
  1157. <script src="<?=$baseURL;?>js/notifications/notificationFx.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  1158. <!--Custom Scripts-->
  1159. <script src="<?=$baseURL;?>js/common.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  1160. <script src="<?=$baseURL;?>js/mousetrap.min.js"></script>
  1161. <script src="<?=$baseURL;?>js/jquery.simpleWeather.js"></script>
  1162. <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
  1163. <script>
  1164. function getCookie(cname) {
  1165. var name = cname + "=";
  1166. var decodedCookie = decodeURIComponent(document.cookie);
  1167. var ca = decodedCookie.split(';');
  1168. for(var i = 0; i <ca.length; i++) {
  1169. var c = ca[i];
  1170. while (c.charAt(0) == ' ') {
  1171. c = c.substring(1);
  1172. }
  1173. if (c.indexOf(name) == 0) {
  1174. return c.substring(name.length, c.length);
  1175. }
  1176. }
  1177. return "";
  1178. }
  1179. <?php if($configReady == "Yes") {
  1180. if($USER->authenticated){ ?>
  1181. if (localStorageSupport) {
  1182. <?php if(isset($_COOKIE['mpt'])){
  1183. echo 'localStorage.setItem("myPlexAccessToken","'.$_COOKIE['mpt'].'");';
  1184. }
  1185. if(isset($_COOKIE['Auth'])){
  1186. echo 'localStorage.setItem("id_token","'.$_COOKIE['Auth'].'");';
  1187. }?>
  1188. }
  1189. <?php }else{?>
  1190. if (localStorageSupport) {
  1191. localStorage.removeItem("myPlexAccessToken");
  1192. localStorage.removeItem("id_token");
  1193. }
  1194. <?php } } ?>
  1195. </script>
  1196. <?php if(CHAT == "true" && qualifyUser(CHATAUTH)){?>
  1197. <script src="chatjs.php" defer="true"></script>
  1198. <script type="text/javascript">
  1199. var scrolling = function(e, c) {
  1200. e.scrollIntoView();
  1201. if (c < 5) setTimeout(scrolling, 300, e, c + 1);
  1202. };
  1203. var ensureVisible = function(e) {
  1204. setTimeout(scrolling, 300, e, 0);
  1205. };
  1206. var mainchatdiv = document.getElementById('main-chat');
  1207. mainchatdiv.addEventListener('touchmove', function(e) {
  1208. e.preventDefault();
  1209. }, false);
  1210. </script>
  1211. <?php }?>
  1212. <?php if(WEATHER == "true" && qualifyUser(WEATHERAUTH)){?>
  1213. <script>
  1214. /* Does your browser support geolocation? */
  1215. if ("geolocation" in navigator) {
  1216. $('#weather').show();
  1217. } else {
  1218. $('#weathern').hide();
  1219. }
  1220. function setWeatherIcon(condid) {
  1221. var icon = '';
  1222. switch(condid) {
  1223. case '0': icon = 'wi-tornado';
  1224. break;
  1225. case '1': icon = 'wi-storm-showers';
  1226. break;
  1227. case '2': icon = 'wi-tornado';
  1228. break;
  1229. case '3': icon = 'wi-thunderstorm';
  1230. break;
  1231. case '4': icon = 'wi-thunderstorm';
  1232. break;
  1233. case '5': icon = 'wi-snow';
  1234. break;
  1235. case '6': icon = 'wi-rain-mix';
  1236. break;
  1237. case '7': icon = 'wi-rain-mix';
  1238. break;
  1239. case '8': icon = 'wi-sprinkle';
  1240. break;
  1241. case '9': icon = 'wi-sprinkle';
  1242. break;
  1243. case '10': icon = 'wi-hail';
  1244. break;
  1245. case '11': icon = 'wi-showers';
  1246. break;
  1247. case '12': icon = 'wi-showers';
  1248. break;
  1249. case '13': icon = 'wi-snow';
  1250. break;
  1251. case '14': icon = 'wi-storm-showers';
  1252. break;
  1253. case '15': icon = 'wi-snow';
  1254. break;
  1255. case '16': icon = 'wi-snow';
  1256. break;
  1257. case '17': icon = 'wi-hail';
  1258. break;
  1259. case '18': icon = 'wi-hail';
  1260. break;
  1261. case '19': icon = 'wi-cloudy-gusts';
  1262. break;
  1263. case '20': icon = 'wi-fog';
  1264. break;
  1265. case '21': icon = 'wi-fog';
  1266. break;
  1267. case '22': icon = 'wi-fog';
  1268. break;
  1269. case '23': icon = 'wi-cloudy-gusts';
  1270. break;
  1271. case '24': icon = 'wi-cloudy-windy';
  1272. break;
  1273. case '25': icon = 'wi-thermometer';
  1274. break;
  1275. case '26': icon = 'wi-cloudy';
  1276. break;
  1277. case '27': icon = 'wi-night-cloudy';
  1278. break;
  1279. case '28': icon = 'wi-day-cloudy';
  1280. break;
  1281. case '29': icon = 'wi-night-cloudy';
  1282. break;
  1283. case '30': icon = 'wi-day-cloudy';
  1284. break;
  1285. case '31': icon = 'wi-night-clear';
  1286. break;
  1287. case '32': icon = 'wi-day-sunny';
  1288. break;
  1289. case '33': icon = 'wi-night-clear';
  1290. break;
  1291. case '34': icon = 'wi-day-sunny-overcast';
  1292. break;
  1293. case '35': icon = 'wi-hail';
  1294. break;
  1295. case '36': icon = 'wi-day-sunny';
  1296. break;
  1297. case '37': icon = 'wi-thunderstorm';
  1298. break;
  1299. case '38': icon = 'wi-thunderstorm';
  1300. break;
  1301. case '39': icon = 'wi-thunderstorm';
  1302. break;
  1303. case '40': icon = 'wi-storm-showers';
  1304. break;
  1305. case '41': icon = 'wi-snow';
  1306. break;
  1307. case '42': icon = 'wi-snow';
  1308. break;
  1309. case '43': icon = 'wi-snow';
  1310. break;
  1311. case '44': icon = 'wi-cloudy';
  1312. break;
  1313. case '45': icon = 'wi-lightning';
  1314. break;
  1315. case '46': icon = 'wi-snow';
  1316. break;
  1317. case '47': icon = 'wi-thunderstorm';
  1318. break;
  1319. case '3200': icon = 'wi-cloud';
  1320. break;
  1321. default: icon = 'wi-cloud';
  1322. break;
  1323. }
  1324. return '<i class="wi '+icon+' wi-fw"></i>';
  1325. }
  1326. $(document).ready(function() {
  1327. getWeather();
  1328. setInterval(getWeather, 600000);
  1329. });
  1330. function getWeather(){
  1331. navigator.geolocation.getCurrentPosition(function(position) {
  1332. loadWeather(position.coords.latitude+','+position.coords.longitude);
  1333. });
  1334. console.log('grabbing weather');
  1335. }
  1336. function loadWeather(location, woeid) {
  1337. $.simpleWeather({
  1338. location: location,
  1339. woeid: woeid,
  1340. unit: 'f',
  1341. success: function(weather) {
  1342. //html = '<h5 class="text-uppercase text-center">Weather For '+weather.city+', '+weather.region+'</h5>';
  1343. html = '<h5 class="text-center yellow">Current Weather</h5>';
  1344. html += '<div class="content-box ultra-widget yellow-bg">';
  1345. html += '<div class="w-icon right pull-right">'+setWeatherIcon(weather.code)+'</div>';
  1346. html += '<div class="w-descr left pull-left text-center">';
  1347. html += '<span class="w-name">'+weather.temp+'&deg;'+weather.units.temp+' / '+weather.alt.temp+'&deg;C</span><br>';
  1348. html += '<span class="w-name">'+weather.currently+'</span>';
  1349. html += '</div></div>';
  1350. //Forecast
  1351. 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">';
  1352. //html += '<caption>'+weather.city+', '+weather.region+'</caption>';
  1353. html += '<thead><tr><th>Day</th><th>High</th><th>Low</th><th>Weather</th><th>Visual</th></tr></thead><tbody>';
  1354. //Days
  1355. 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>';
  1356. 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>';
  1357. 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>';
  1358. 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>';
  1359. 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>';
  1360. 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>';
  1361. 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>';
  1362. 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>';
  1363. 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>';
  1364. 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>';
  1365. //Days End
  1366. html += '</tbody></table></div></div>';
  1367. $("#weather").html(html);
  1368. },
  1369. error: function(error) {
  1370. $("#weather").html('<p>'+error+'</p>');
  1371. }
  1372. });
  1373. }
  1374. </script>
  1375. <?php } ?>
  1376. <script>
  1377. var datetime = null,
  1378. date = null;
  1379. var update = function () {
  1380. date = moment(new Date()).format('llll');
  1381. datetime.html(date);
  1382. };
  1383. //Current Time
  1384. datetime = $('.current-time')
  1385. update();
  1386. setInterval(update, 60000);
  1387. console.log(date);
  1388. <?php if($userDevice !== "phone"){?>
  1389. //Tooltips
  1390. $('[data-toggle="tooltip"]').tooltip();
  1391. <?php } ?>
  1392. $(".box").niceScroll({
  1393. railpadding: {top:0,right:0,left:0,bottom:0},
  1394. scrollspeed: 30,
  1395. mousescrollstep: 60
  1396. });
  1397. $("#onlineusers").niceScroll({
  1398. railpadding: {top:0,right:0,left:0,bottom:0},
  1399. scrollspeed: 30,
  1400. mousescrollstep: 60
  1401. });
  1402. <?php if (file_exists('config/config.php') && $configReady == "Yes" && $tabSetup == "No" && SPLASH == "true") {?>
  1403. $('.splash-modal').modal("show");
  1404. <?php } ?>
  1405. var fixed = document.getElementById('gn-scroller');
  1406. fixed.addEventListener('touchmove', function(e) {
  1407. e.preventDefault();
  1408. }, false);
  1409. function setHeight() {
  1410. windowHeight = $(window).innerHeight();
  1411. $("div").find(".iframe").css('height', windowHeight - <?=$slimBar;?> + "px");
  1412. $('#content').css('height', windowHeight - <?=$slimBar;?> + "px");
  1413. };
  1414. function notify(notifyString, notifyIcon, notifyType, notifyLength, notifyLayout, notifyEffect) {
  1415. var notifyString = notifyString;
  1416. var notifyIcon = notifyIcon;
  1417. var notifyType = notifyType;
  1418. var notifyLength = notifyLength;
  1419. var notifyLayout = notifyLayout;
  1420. var notifyEffect = notifyEffect;
  1421. if (notifyEffect === "slidetop"){
  1422. var addMeesage = '<span class="fa fa-' + notifyIcon + ' fa-2x"></span>' + '<p>' + notifyString + '</p>';
  1423. }else if (notifyEffect === "exploader"){
  1424. var addMeesage = '<span class="fa fa-' + notifyIcon + ' fa-2x pull-left"></span>' + '<p>' + notifyString + '</p>';
  1425. }else if (notifyEffect === "thumbslider"){
  1426. var addMeesage = '<div class="ns-thumb"><img src="images/alert.png"/></div><div class="ns-content"><p>' + notifyString + '</p></div>';
  1427. }else{
  1428. var addMeesage = '<p>' + notifyString + '</p>';
  1429. }
  1430. setTimeout(function () {
  1431. var notification = new NotificationFx({
  1432. message: addMeesage,
  1433. layout: notifyLayout,
  1434. effect: notifyEffect,
  1435. ttl: notifyLength,
  1436. type: notifyType,
  1437. onClose: function () {
  1438. $(".ns-box").fadeOut(400);
  1439. }
  1440. });
  1441. notification.show();
  1442. }, 500);
  1443. }
  1444. $('#registerSubmit').click(function() {
  1445. if ($('#registration').smkValidate()) {
  1446. console.log("validated");
  1447. }
  1448. User.processRegistration();
  1449. });
  1450. $("#editInfo").click(function(){
  1451. $( "div[id^='editInfoDiv']" ).toggle();
  1452. $( "div[id^='buttonsDiv']" ).toggle();
  1453. });
  1454. $("#goBackButtons").click(function(){
  1455. $( "div[id^='editInfoDiv']" ).toggle();
  1456. $( "div[id^='buttonsDiv']" ).toggle();
  1457. });
  1458. $("#welcomeGoBack").click(function(){
  1459. $( "form[id^='login']" ).toggle();
  1460. $( "form[id^='forgotPassword']" ).toggle();
  1461. $("#switchForgot").toggle();
  1462. $("#switchCreateUser").toggle();
  1463. $("#welcomeGoBack").toggle();
  1464. });
  1465. $("#plexNoGoBack").click(function(){
  1466. $("#joinPlexForm").toggle();
  1467. $("#chooseMethod").toggle();
  1468. });
  1469. $("#plexYesGoBack").click(function(){
  1470. $("#useInviteForm").toggle();
  1471. $("#chooseMethod").toggle();
  1472. });
  1473. $("#welcomeGoBack2").click(function(){
  1474. $( "form[id^='login']" ).toggle();
  1475. $("#userPassForm").toggle();
  1476. $("#switchForgot").toggle();
  1477. $("#switchCreateUser").toggle();
  1478. $("#welcomeGoBack2").toggle();
  1479. });
  1480. $("#welcomeGoBack3").click(function(){
  1481. $("#registration").toggle();
  1482. $("#welcomeGoBack3").toggle();
  1483. $( "form[id^='login']" ).toggle();
  1484. $("#switchForgot").toggle();
  1485. $("#switchCreateUser").toggle();
  1486. });
  1487. $("#switchForgot").click(function(){
  1488. $( "form[id^='login']" ).toggle();
  1489. $( "form[id^='forgotPassword']" ).toggle();
  1490. $("#switchForgot").toggle();
  1491. $("#switchCreateUser").toggle();
  1492. $("#welcomeGoBack").toggle();
  1493. });
  1494. $("#switchCreateUser").click(function(){
  1495. $( "form[id^='login']" ).toggle();
  1496. $("#userPassForm").toggle();
  1497. $("#switchForgot").toggle();
  1498. $("#switchCreateUser").toggle();
  1499. $("#welcomeGoBack2").toggle();
  1500. });
  1501. //Sign in
  1502. $(".log-in").click(function(e){
  1503. var e1 = document.querySelector(".log-in"),
  1504. e2 = document.querySelector(".login-modal");
  1505. cta(e1, e2, {relativeToWindow: true}, function () {
  1506. $('.login-modal').modal("show");
  1507. });
  1508. e.preventDefault();
  1509. });
  1510. //InviteCode
  1511. <?php if(isset($_GET['inviteCode'])){ ?>
  1512. $('#inviteSet').modal("show");
  1513. <?php } ?>
  1514. //Logout
  1515. $(".logout").click(function(e){
  1516. $('#main-user').removeClass('email-active');
  1517. var el1 = document.querySelector(".logout"),
  1518. el2 = document.querySelector(".logout-modal");
  1519. cta(el1, el2, {relativeToWindow: true}, function () {
  1520. $('.logout-modal').modal("show");
  1521. });
  1522. e.preventDefault();
  1523. });
  1524. //Members Sidebar
  1525. $(".show-members").click(function(e){
  1526. $('#main-user').toggleClass('email-active');
  1527. if($('#main-chat').hasClass('email-active')){
  1528. $('#main-chat').toggleClass('email-active');
  1529. }
  1530. e.preventDefault();
  1531. });
  1532. $('.close-members-sidebar').click(function(){
  1533. $('#members-sidebar').removeClass('members-sidebar-open');
  1534. });
  1535. $(document).ready(function(){
  1536. <?php
  1537. if($configReady == "Yes"){
  1538. $pingCount = 1; if($USER->authenticated && $USER->role == "admin"){ $pingTimer = "60000"; }else{ $pingTimer = "600000"; }
  1539. foreach($allPings as $type => $ping){
  1540. $name = str_replace(array(':', '\\', '/', '*'), 'x', $ping);
  1541. if(strpos($type, 'image') !== false){ $style = "margin-top:28px"; }else{ $style = ""; }?>
  1542. var pingTab<?php echo $pingCount;?> = function() {
  1543. //$("ping[class^='ping-<?php echo $name;?>']").load("ajax.php?a=get-ping&url=<?php echo $ping;?>&style=<?php echo $style;?>");
  1544. $.ajax({
  1545. url: 'ajax.php?a=get-ping&url=<?php echo $ping;?>&style=<?php echo $style;?>',
  1546. timeout: 10000,
  1547. type: 'GET',
  1548. success: function(response) {
  1549. var getDiv = response;
  1550. if (typeof getDiv !== 'undefined') {
  1551. $("ping[class^='ping-<?php echo $name;?>']").html($(getDiv).prop('outerHTML'));
  1552. }else{
  1553. console.log('ping-<?php echo $name;?> data was not sufficent or is offline');
  1554. }
  1555. },
  1556. error: function(jqXHR, textStatus, errorThrown) {
  1557. console.error('ping-<?php echo $name;?> could not be updated');
  1558. }
  1559. });
  1560. };
  1561. // Initial Loads
  1562. pingTab<?php echo $pingCount;?>();
  1563. // Interval Loads
  1564. setInterval(function() {
  1565. pingTab<?php echo $pingCount;?>();
  1566. }, <?php echo $pingTimer; ?>);
  1567. <?php $pingCount++; }
  1568. }?>
  1569. //PLEX INVITE SHIT
  1570. $('#checkInviteForm').on('submit', function () {
  1571. ajax_request('POST', 'validate-invite', {
  1572. invitecode: $('#checkInviteForm [name=inviteCode]').val(),
  1573. }).done(function(data){
  1574. var InviteCode = $('#checkInviteForm [name=inviteCode]').val();
  1575. var result = JSON.stringify(data).includes("success");
  1576. if(result === true){
  1577. $('#checkInviteForm').hide();
  1578. $('#chooseMethod').show();//DZ60N2
  1579. $('#useInviteForm [name=inviteCode]').val(InviteCode);
  1580. console.log(result);
  1581. console.log(InviteCode);
  1582. }
  1583. });
  1584. });
  1585. $('#useInviteForm').on('submit', function () {
  1586. ajax_request('POST', 'use-invite', {
  1587. invitecode: $('#useInviteForm [name=inviteCode]').val(),
  1588. inviteuser: $('#useInviteForm [name=inviteUser]').val(),
  1589. }).done(function(data){
  1590. var result = JSON.stringify(data).includes("success");
  1591. console.log(result);
  1592. if(result === true){
  1593. //$('#checkInviteForm').hide();
  1594. //$('#chooseMethod').show();
  1595. $('#accountSubmitted').show();
  1596. $('#useInviteForm_submit').hide();
  1597. $('#plexYesGoBack').hide();
  1598. $('#useInviteForm [name=inviteUser]').hide();
  1599. console.log(result);
  1600. }
  1601. });
  1602. });
  1603. $('#joinPlexForm').on('submit', function () {
  1604. ajax_request('POST', 'join-plex', {
  1605. joinuser: $('#joinPlexForm [name=joinUser]').val(),
  1606. joinemail: $('#joinPlexForm [name=joinEmail]').val(),
  1607. joinpassword: $('#joinPlexForm [name=joinPassword]').val(),
  1608. }).done(function(data){
  1609. var result = JSON.stringify(data).includes("success");
  1610. if(result === true){
  1611. $('#joinPlexForm').hide();
  1612. $('#useInviteForm').show();
  1613. $('#accountMade').show();
  1614. $('input[name=inviteUser]').val($('input[name=joinUser]').val());
  1615. console.log(result);
  1616. }
  1617. });
  1618. });
  1619. $("#yesPlexButton").click(function(){
  1620. $('#chooseMethod').hide();
  1621. $('#useInviteForm').show();
  1622. });
  1623. $("#noPlexButton").click(function(){
  1624. $('#chooseMethod').hide();
  1625. $('#joinPlexForm').show();
  1626. });
  1627. $('#userCreateForm').submit(function(event) {
  1628. var formData = {
  1629. 'registerPasswordValue' : $('input[name=registerPasswordValue]').val()
  1630. };
  1631. $.ajax({
  1632. type : 'POST',
  1633. url : 'register.php',
  1634. data : formData,
  1635. dataType : 'json',
  1636. encode : true
  1637. })
  1638. .done(function(data) {
  1639. console.log(data);
  1640. if ( ! data.success) {
  1641. $('#userCreateErrors').html('Wrong Password!'); // add the actual error message under our input
  1642. } else {
  1643. $("#userPassForm").toggle();
  1644. $("#registration").toggle();
  1645. $("#welcomeGoBack3").toggle();
  1646. $("#validate").val($('input[name=registerPasswordValue]').val());
  1647. }
  1648. });
  1649. event.preventDefault();
  1650. });
  1651. defaultTab = $("li[class^='tab-item active']").attr("id");
  1652. $("li[class^='tab-item active']").first().find("img").addClass("TabOpened");
  1653. if (defaultTab){
  1654. defaultTab = defaultTab.substr(0, defaultTab.length-1);
  1655. }else{
  1656. defaultTabNone = $("li[class^='tab-item']").attr("id");
  1657. if (defaultTabNone){
  1658. $("li[class^='tab-item']").first().attr("class", "tab-item active");
  1659. $("li[class^='tab-item']").first().find("img").addClass("TabOpened");
  1660. defaultTab = defaultTabNone.substr(0, defaultTabNone.length-1);
  1661. }
  1662. }
  1663. if (defaultTab){
  1664. defaultTabName = $("li[class^='tab-item active']").attr("name");
  1665. startPingTimer = $("li[class^='tab-item active']").find('.startPingTimer');
  1666. console.log('loading default tab: '+defaultTabName);
  1667. if((startPingTimer).length){ //has ping attr
  1668. setTimeout(function(){ //allow it 1.25 secs to check
  1669. defaultPingID = $("li[class^='tab-item active']").find('.pingcheck'); //grab the DOM Element
  1670. if((defaultPingID).length){ //check if element is true
  1671. if(defaultPingID.hasClass('ping-success')){ //check if element has success status
  1672. console.log(defaultTabName+' has responded, proceeding with load');
  1673. $("#content").html('<div class="iframe active" data-content-name="'+defaultTabName+'" data-content-url="'+defaultTab+'"><iframe id="frame-'+defaultTabName+'" scrolling="auto" sandbox="allow-presentation allow-forms allow-same-origin allow-pointer-lock allow-scripts allow-popups allow-modals allow-top-navigation" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" frameborder="0" style="width:100%; height:100%; position: absolute;" src="'+defaultTab+'"></iframe></div>');
  1674. document.getElementById('main-wrapper').focus();
  1675. }else{
  1676. console.log(defaultTabName+' did not respond, cancelling load');
  1677. }
  1678. }else{
  1679. console.log(defaultTabName+' did not have ping value');
  1680. }
  1681. }, 1250);
  1682. }else{
  1683. console.log(defaultTabName+' isn\'t setup with ping, cancelling check on load');
  1684. $("#content").html('<div class="iframe active" data-content-name="'+defaultTabName+'" data-content-url="'+defaultTab+'"><iframe id="frame-'+defaultTabName+'" scrolling="auto" sandbox="allow-presentation allow-forms allow-same-origin allow-pointer-lock allow-scripts allow-popups allow-modals allow-top-navigation" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" frameborder="0" style="width:100%; height:100%; position: absolute;" src="'+defaultTab+'"></iframe></div>');
  1685. document.getElementById('main-wrapper').focus();
  1686. }
  1687. }
  1688. if (defaultTab == null){
  1689. $("div[id^='tabEmpty']").show();
  1690. <?php
  1691. echo "console.log('Need Setup = $needSetup | Config Ready = $configReady');";
  1692. if($needSetup == "No" && $configReady == "Yes"){
  1693. if(!$USER->authenticated){
  1694. echo "$('#loginModal').modal('show');";
  1695. }
  1696. }
  1697. ?>
  1698. }
  1699. if ($(location).attr('hash')){
  1700. var getHash = $(location).attr('hash').substr(1).replace("%20", " ").replace("_", " ");
  1701. var gotHash = getHash.toLowerCase();
  1702. var getLiTab = $("li[name^='" + gotHash + "']");
  1703. if(gotHash === "upgrade"){ getLiTab.toggle(); console.log("got it"); }
  1704. getLiTab.trigger("click");
  1705. }
  1706. setHeight();
  1707. });
  1708. <?php if(!empty($USER->info_log)) : ?>
  1709. notify("<?php echo printArray($USER->info_log); ?>","info-circle","notice","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1710. <?php endif; ?>
  1711. <?php if(!empty($USER->error_log)) : ?>
  1712. notify("<?php echo printArray($USER->error_log); ?>","exclamation-circle ","error","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1713. <?php endif; ?>
  1714. $("li[class^='tab-item']").dblclick(function(){
  1715. var thisidfull = $(this).attr("id");
  1716. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1717. var thisframe = $("#content div[data-content-url='"+thisid+"']").children('iframe');
  1718. $(thisframe).attr('src', $(thisframe).attr('src'));
  1719. var refreshBox = $('#content').find('.active');
  1720. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1721. setTimeout(function(){
  1722. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1723. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1724. refreshPreloader.remove();
  1725. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1726. });
  1727. },800);
  1728. });
  1729. $('#reload').on('click tap', function(){
  1730. $("i[class^='mdi mdi-refresh']").attr("class", "mdi mdi-refresh fa-spin");
  1731. $("#main-user").removeClass("email-active");
  1732. var activeFrame = $('#content').find('.active').children('iframe');
  1733. activeFrame.attr('src', activeFrame.attr('src'));
  1734. var refreshBox = $('#content').find('.active');
  1735. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1736. setTimeout(function(){
  1737. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1738. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1739. refreshPreloader.remove();
  1740. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1741. });
  1742. },500);
  1743. });
  1744. $('#popout').on('click tap', function(){
  1745. $("#main-user").removeClass("email-active");
  1746. var activeFrame = $('#content').find('.active').children('iframe');
  1747. console.log(activeFrame.attr('src'));
  1748. window.open(activeFrame.attr('src'), '_blank');"reload"
  1749. });
  1750. $('#chat-open').on('click tap', function(){
  1751. $('.chat-box').toggleClass('email-active');
  1752. $(".mdi-forum").removeClass("tada loop-animation new-message");//SET MESSAGE TO ZERO
  1753. if($('.chat-box').hasClass('email-active')){
  1754. $("#message").focus();
  1755. }
  1756. if($('#main-user').hasClass('email-active')){
  1757. $('#main-user').toggleClass('email-active');
  1758. }
  1759. });
  1760. $('#chat-switch-chat').on('click tap', function(){
  1761. $('#chat-chat-div').show();
  1762. $('#chat-users-div').hide();
  1763. $("#message").focus();
  1764. });
  1765. $('#chat-switch-online').on('click tap', function(){
  1766. $('#chat-users-div').show();
  1767. $('#chat-chat-div').hide();
  1768. });
  1769. $('#chat-switch-close').on('click tap', function(){
  1770. $('.chat-box').toggleClass('email-active');
  1771. });
  1772. $('#user-switch-close').on('click tap', function(){
  1773. $('#main-user').toggleClass('email-active');
  1774. });
  1775. $('#reload').on('contextmenu', function(e){
  1776. $("i[class^='mdi mdi-refresh']").attr("class", "mdi mdi-refresh fa-spin");
  1777. $('#main-user').removeClass('email-active');
  1778. var activeFrame = $('#contentRight').find('.active').children('iframe');
  1779. activeFrame.attr('src', activeFrame.attr('src'));
  1780. var refreshBox = $('#contentRight').find('.active');
  1781. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1782. setTimeout(function(){
  1783. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1784. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1785. refreshPreloader.remove();
  1786. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1787. });
  1788. },500);
  1789. return false;
  1790. });
  1791. $('#splitView').on('contextmenu', function(e){
  1792. $('#main-user').removeClass('email-active');
  1793. e.stopPropagation();
  1794. //$('#splitView').hide();
  1795. $("#content").attr("class", "content");
  1796. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1797. $("#contentRight").html('');
  1798. return false;
  1799. });
  1800. $('#splitView').on('click tap', function(){
  1801. $('#main-user').removeClass('email-active');
  1802. var activeFrame = $('#content').find('.active');
  1803. var getCurrentTab = $("li[class^='tab-item active']");
  1804. getCurrentTab.removeClass('active');
  1805. getCurrentTab.find('img').removeClass('TabOpened');
  1806. $("img[class^='TabOpened']").parents("li").trigger("click");
  1807. activeFrame.remove();
  1808. });
  1809. <?php if($iconRotate == "true") : ?>
  1810. $("li[id^='settings.phpx']").on('click tap', function(){
  1811. $("img[id^='settings-icon']").addClass("fa-spin");
  1812. $("i[id^='settings-icon']").addClass("fa-spin");
  1813. setTimeout(function(){
  1814. $("img[id^='settings-icon']").removeClass("fa-spin");
  1815. $("i[id^='settings-icon']").removeClass("fa-spin");
  1816. },1000);
  1817. });
  1818. <?php endif; ?>
  1819. $('#logoutSubmit').on('click tap', function(){
  1820. $( "#logout" ).submit();
  1821. });
  1822. $(window).resize(function(){
  1823. setHeight();
  1824. });
  1825. $("li[class^='splash-item']").on('click vclick', function(){
  1826. var thisname = $(this).attr("name");
  1827. var splashTab = $("#tabList li[name='" + thisname + "']");
  1828. splashTab.trigger("click");
  1829. $('.splash-modal').modal("hide");
  1830. });
  1831. $("li[class^='tab-item']").on('click vclick', function(){
  1832. var thisidfull = $(this).attr("id");
  1833. var thistitle = $(this).attr("data-title");
  1834. var thisname = $(this).attr("name");
  1835. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1836. var currentframe = $("#content div[data-content-url='"+thisid+"']");
  1837. if (currentframe.attr("class") == "iframe active") {
  1838. console.log(thisid + " is active already");
  1839. setHeight();
  1840. }else if (currentframe.attr("class") == "iframe hidden") {
  1841. console.log(thisid + " - reactivating iFrame");
  1842. $("#content div[class^='iframe active']").attr("class", "iframe hidden");
  1843. currentframe.attr("class", "iframe active");
  1844. document.title = thistitle;
  1845. //window.location.href = '#' + thisname;
  1846. setHeight();
  1847. $("li[class^='tab-item active']").attr("class", "tab-item");
  1848. $(this).attr("class", "tab-item active");
  1849. }else {
  1850. if ($(this).attr("window") == "true") {
  1851. window.open(thisid,'_blank');
  1852. }else {
  1853. console.log(thisid + " - loading new iFrame");
  1854. $("#content div[class^='iframe active']").attr("class", "iframe hidden");
  1855. $( '<div class="iframe active" data-content-name="'+thisname+'" data-content-url="'+thisid+'"><iframe id="frame-'+thisname+'" scrolling="auto" sandbox="allow-presentation allow-forms allow-same-origin allow-pointer-lock allow-scripts allow-popups allow-modals allow-top-navigation" allowfullscreen="true" webkitallowfullscreen="true" frameborder="0" style="width:100%; height:100%; position: absolute;" src="'+thisid+'"></iframe></div>' ).appendTo( "#content" );
  1856. document.title = thistitle;
  1857. // window.location.href = '#' + thisname;
  1858. setHeight();
  1859. $("li[class^='tab-item active']").attr("class", "tab-item");
  1860. $(this).attr("class", "tab-item active");
  1861. jQuery(this).find("img").addClass("TabOpened");
  1862. }
  1863. }
  1864. $('#main-user').removeClass('email-active');
  1865. $('.chat-box').removeClass('email-active');
  1866. });
  1867. $("li[class^='tab-item']").on('contextmenu', function(e){
  1868. e.stopPropagation();
  1869. $('#splitView').show();
  1870. $("#content").attr("class", "content split");
  1871. var thisidfull = $(this).attr("id");
  1872. var thistitle = $(this).attr("data-title");
  1873. var thisname = $(this).attr("name");
  1874. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1875. var currentframe = $("#contentRight div[data-content-url='"+thisid+"']");
  1876. if (currentframe.attr("class") == "iframe active") {
  1877. console.log(thisid + " is active already");
  1878. }else if (currentframe.attr("class") == "iframe hidden") {
  1879. console.log(thisid + " - reactivating iFrame");
  1880. $("#contentRight div[class^='iframe active']").attr("class", "iframe hidden");
  1881. currentframe.attr("class", "iframe active");
  1882. document.title = thistitle;
  1883. window.location.href = '#' + thisname;
  1884. setHeight();
  1885. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1886. $(this).attr("class", "tab-item rightActive");
  1887. }else {
  1888. if ($(this).attr("window") == "true") {
  1889. window.open(thisid,'_blank');
  1890. }else {
  1891. console.log(thisid + " - loading new iFrame");
  1892. $("#contentRight div[class^='iframe active']").attr("class", "iframe hidden");
  1893. $( '<div class="iframe active" data-content-name="'+thisname+'" data-content-url="'+thisid+'"><iframe id="frameRight-'+thisname+'" scrolling="auto" sandbox="allow-presentation allow-forms allow-same-origin allow-pointer-lock allow-scripts allow-popups allow-modals allow-top-navigation" allowfullscreen="true" webkitallowfullscreen="true" frameborder="0" style="width:100%; height:100%; position: absolute;" src="'+thisid+'"></iframe></div>' ).appendTo( "#contentRight" );
  1894. document.title = thistitle;
  1895. window.location.href = '#' + thisname;
  1896. setHeight();
  1897. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1898. $(this).attr("class", "tab-item rightActive");
  1899. jQuery(this).find("img").addClass("TabOpened");
  1900. }
  1901. }
  1902. $('#main-user').removeClass('email-active');
  1903. $('.chat-box').removeClass('email-active');
  1904. return false;
  1905. });
  1906. Mousetrap.bind('ctrl+shift+up', function(e) {
  1907. var getCurrentTab = $("li[class^='tab-item active']");
  1908. var previousTab = getCurrentTab.prev().attr( "class", "tab-item" );
  1909. previousTab.trigger("click");
  1910. return false;
  1911. });
  1912. Mousetrap.bind('ctrl+shift+down', function(e) {
  1913. var getCurrentTab = $("li[class^='tab-item active']");
  1914. var nextTab = getCurrentTab.next().attr( "class", "tab-item" );
  1915. nextTab.trigger("click");
  1916. return false;
  1917. });
  1918. Mousetrap.bind('s s', function() { $("li[id^='settings.phpx']").trigger("click"); });
  1919. Mousetrap.bind('p p', function() { $("a[class^='fix-nav']").trigger("click"); });
  1920. Mousetrap.bind('m m', function() { $("div[class^='hamburger']").trigger("click"); });
  1921. Mousetrap.bind('r r', function() { $("button[id^='reload']").trigger("click"); });
  1922. Mousetrap.bind('f f', function() { $("button[class^='fullscreen']").trigger("click"); });
  1923. <?php if($tabSetup == "No") : foreach(range(1,$tabCount) as $index) : if ($index == 10) : break; endif;?>
  1924. Mousetrap.bind('ctrl+shift+<?php echo $index; ?>', function() { $("ul[id^='tabList'] li:nth-child(<?php echo $index; ?>)").trigger("click"); });
  1925. <?php endforeach; endif; ?>
  1926. Mousetrap.bind('esc esc', function() {
  1927. $("#content").attr("class", "content");
  1928. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1929. $("#contentRight").html('');
  1930. });
  1931. var ref = document.referrer;
  1932. if(ref.indexOf("updated")>=0){
  1933. notify("<?php echo $language->translate('UPDATE_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1934. }
  1935. if(ref.indexOf("submit")>=0){
  1936. notify("<?php echo $language->translate('CUSTOM_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1937. }
  1938. </script>
  1939. </body>
  1940. </html>