home.php 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. <?PHP
  2. /**
  3. * Copyright 2021, 2024 5 Mode
  4. * All Rights Reserved.
  5. *
  6. * This file is part of TheMultiversed.org.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions are met:
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * * Neither 5 Mode nor the names of its contributors
  16. * may be used to endorse or promote products derived from this software
  17. * without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  20. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  21. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  22. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY
  23. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  24. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  25. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  26. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. * home.php
  31. *
  32. * TheMultiversedorg home.
  33. *
  34. * @author Daniele Bonini <my25mb@aol.com>
  35. * @copyrights (c) 2021, 2024, 5 Mode
  36. */
  37. // PAGE PARAMETERS
  38. $groupName = PHP_STR;
  39. $userName = PHP_STR;
  40. $defLocation = PHP_STR;
  41. $defPhone = PHP_STR;
  42. $defStatus2 = PHP_STR;
  43. $defOnline = 0;
  44. $curgroup = filter_input(INPUT_POST, "_group")??"";
  45. $curgroup = strip_tags($curgroup);
  46. $aGroups = $FRIENDS;
  47. $checkin = filter_input(INPUT_POST, "_checkin")??"";
  48. $checkin = strip_tags($checkin);
  49. $checkinPassword = filter_input(INPUT_POST, "txtCheckinPassword")??"";
  50. $checkinPassword = strip_tags($checkinPassword);
  51. $newLocation = filter_input(INPUT_POST, "txtNewLocation")??"";
  52. $newLocation = strip_tags($newLocation);
  53. $newPhone = filter_input(INPUT_POST, "txtNewPhone")??"";
  54. $newPhone = strip_tags($newPhone);
  55. $newStatus = filter_input(INPUT_POST, "txtNewStatus")??"";
  56. $newStatus = strip_tags($newStatus);
  57. $newOnline = filter_input(INPUT_POST, "cbNewOnline")??"";
  58. $newOnline = strip_tags($newOnline);
  59. $lang = APP_DEF_LANG;
  60. $lang1 = substr(strip_tags(filter_input(INPUT_GET, "hl")??""), 0, 5);
  61. if ($lang1 !== PHP_STR) {
  62. $lang = $lang1;
  63. }
  64. $shortLang = getShortLang($lang);
  65. $password = filter_input(INPUT_POST, "Password")??"";
  66. $password = strip_tags($password);
  67. if ($password !== PHP_STR) {
  68. $hash = hash("sha256", $password . APP_SALT, false);
  69. foreach($aGroups as $keyg => $valg) {
  70. $aFriends = $valg;
  71. $ii = 0;
  72. foreach($aFriends as $keyf => $valf) {
  73. $ii++;
  74. $aFFields = $valf;
  75. $name = $keyf;
  76. if ($hash === $aFFields['HASH']) {
  77. $groupName = $keyg;
  78. $userName = $name;
  79. $defLocation = $aFFields['Location'];
  80. $defPhone = $aFFields['Phone'];
  81. $defStatus2 = $aFFields['defStatus'];
  82. $defOnline = $aFFields['online'];
  83. break;
  84. }
  85. }
  86. if ($userName !== PHP_STR) {
  87. break;
  88. }
  89. }
  90. if ($userName === PHP_STR) {
  91. $password=PHP_STR;
  92. $curgroup=PHP_STR;
  93. }
  94. }
  95. if ($password !== PHP_STR || DEMO) {
  96. $CURRENT_VIEW = PUBLIC_VIEW;
  97. } else {
  98. $CURRENT_VIEW = LOCKED_VIEW;
  99. }
  100. //echo("groupName=".$groupName."<br>");
  101. //echo("userName=".$userName."<br>");
  102. //echo("curgroup=".$curgroup."<br>");
  103. //exit(1);
  104. if ($curgroup===PHP_STR) {
  105. if ($groupName !== PHP_STR) {
  106. $curgroup=$groupName;
  107. }
  108. }
  109. function cleanPath($p) {
  110. $pattern = $p . DIRECTORY_SEPARATOR . "*";
  111. $paths = glob($pattern);
  112. foreach($paths as $path) {
  113. unlink($path);
  114. }
  115. }
  116. // CHECKIN
  117. if (($password!==PHP_STR) && ($checkin!==PHP_STR) && ($checkinPassword === $password)) {
  118. $groupPath = APP_DATA_PATH . DIRECTORY_SEPARATOR . $groupName;
  119. $userPath = $groupPath . DIRECTORY_SEPARATOR . $userName;
  120. if (!is_readable($groupPath)) {
  121. mkdir($groupPath);
  122. }
  123. if (!is_readable($userPath)) {
  124. mkdir($userPath);
  125. }
  126. $locationPath = $userPath . DIRECTORY_SEPARATOR . "location";
  127. if (!is_readable($locationPath)) {
  128. mkdir($locationPath);
  129. }
  130. cleanPath($locationPath);
  131. $s = preg_replace("/[^\w\-\, ]/iu", "", $newLocation);
  132. touch($locationPath . DIRECTORY_SEPARATOR . $s);
  133. $phonePath = $userPath . DIRECTORY_SEPARATOR . "phone";
  134. if (!is_readable($phonePath)) {
  135. mkdir($phonePath);
  136. }
  137. cleanPath($phonePath);
  138. $s = preg_replace("/[^0-9\-\.\+ ]/iu", "", $newPhone);
  139. touch($phonePath . DIRECTORY_SEPARATOR . $s);
  140. $statusPath = $userPath . DIRECTORY_SEPARATOR . "status";
  141. if (!is_readable($statusPath)) {
  142. mkdir($statusPath);
  143. }
  144. cleanPath($statusPath);
  145. $s = preg_replace("/[^\w\-\_\.\,\: ]/iu", "", $newStatus);
  146. touch($statusPath . DIRECTORY_SEPARATOR . $s);
  147. $onlinePath = $userPath . DIRECTORY_SEPARATOR . "online";
  148. if (!is_readable($onlinePath)) {
  149. mkdir($onlinePath);
  150. }
  151. cleanPath($onlinePath);
  152. $s = preg_replace("/[^0-1]/iu", "", $newOnline);
  153. if ($s === PHP_STR) {
  154. $s = "1";
  155. }
  156. touch($onlinePath . DIRECTORY_SEPARATOR . $s);
  157. }
  158. function readdata($p) {
  159. $pattern = $p . DIRECTORY_SEPARATOR . "*";
  160. $paths = glob($pattern);
  161. if (count($paths)>0) {
  162. return basename($paths[0]);
  163. } else {
  164. return null;
  165. }
  166. }
  167. // READING INFO FROM DATA PATH
  168. foreach($aGroups as $keyg => $valg) {
  169. //$aFriends = $valg;
  170. $gname = $keyg;
  171. //$ii = 0;
  172. foreach($valg as $keyf => $valf) {
  173. //$ii++;
  174. //$aFFields = $valf;
  175. $uname = $keyf;
  176. $groupPath = APP_DATA_PATH . DIRECTORY_SEPARATOR . $gname;
  177. $userPath = $groupPath . DIRECTORY_SEPARATOR . $uname;
  178. if (!is_readable($groupPath) || !is_readable($userPath)) {
  179. continue;
  180. }
  181. $locationPath = $userPath . DIRECTORY_SEPARATOR . "location";
  182. $valf["Location"] = readdata($locationPath)??$valf["Location"];
  183. $aGroups[$gname][$uname]["Location"] = $valf["Location"];
  184. //echo($valf["Location"]);
  185. $phonePath = $userPath . DIRECTORY_SEPARATOR . "phone";
  186. $valf["Phone"] = readdata($phonePath)??$valf["Phone"];
  187. $aGroups[$gname][$uname]["Phone"] = $valf["Phone"];
  188. //echo($valf["Phone"]);
  189. $statusPath = $userPath . DIRECTORY_SEPARATOR . "status";
  190. $valf["defStatus"] = readdata($statusPath)??$valf["defStatus"];
  191. $aGroups[$gname][$uname]["defStatus"] = $valf["defStatus"];
  192. //echo($valf["defStatus"]);
  193. $onlinePath = $userPath . DIRECTORY_SEPARATOR . "online";
  194. $valf["online"] = (int)readdata($onlinePath)??$valf["online"];
  195. $aGroups[$gname][$uname]["online"] = $valf["online"];
  196. //echo($valf["online"]);
  197. }
  198. }
  199. ?>
  200. <!DOCTYPE html>
  201. <html>
  202. <head>
  203. <title><?PHP echo(APP_TITLE);?></title>
  204. <meta charset="UTF-8">
  205. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  206. <link rel="shortcut icon" href="/favicon.ico" />
  207. <script src="/js/jquery-3.6.0.min.js" type="text/javascript"></script>
  208. <script src="/js/bootstrap.min.js" type="text/javascript"></script>
  209. <script src="/js/sha.js" type="text/javascript"></script>
  210. <script src="/js/common.js" type="text/javascript"></script>
  211. <link href="/css/bootstrap.min.css" type="text/css" rel="stylesheet">
  212. <link href="/css/style.css" type="text/css" rel="stylesheet">
  213. <script>
  214. const male = 1;
  215. const female = 2;
  216. const defaultmale = "homo210.png";
  217. const defaultfemale = "homa200.png";
  218. // angle: 45; start: 10;
  219. const zoneNE = 1; //['Europe', 'UK', 'Russia', 'China', 'Middle-East', 'Indonesia']
  220. // angle:135; start: 100;
  221. const zoneSE = 2; //['Africa', 'Australia'];
  222. // angle:-135; start: 210;
  223. const zoneSW = 3; //['South America', 'Center America'];
  224. // angle:-45; start: 300;
  225. const zoneNW = 4; //['North America'];
  226. zoneNEbuddies = 0;
  227. zoneSEbuddies = 0;
  228. zoneSWbuddies = 0;
  229. zoneNWbuddies = 0;
  230. var nextFreeBuddy = 1;
  231. function setBuddyPosition(zone) {
  232. planetW = 568;
  233. planetH = 576;
  234. switch(zone) {
  235. case zoneNE:
  236. zoneNEbuddies++;
  237. //zoneNEbuddies++;
  238. deltaAng = (zoneNEbuddies - 1) * 47;
  239. deltaTopPos = (zoneNEbuddies -1) * 155;
  240. deltaLeftPos = (zoneNEbuddies -1) * 155;
  241. angle = 22 + (deltaAng);
  242. $("#buddy" + nextFreeBuddy).css("transform","rotate(" + angle + "deg)");
  243. buddyTop = (window.innerHeight/2)-(((planetH / 8.5)*5.83) - deltaTopPos);
  244. buddyLeft = (window.innerWidth/2)+(((planetW / 5.0)*0.6) + deltaLeftPos);
  245. break;
  246. case zoneSE:
  247. zoneSEbuddies++;
  248. //zoneSEbuddies++;
  249. deltaAng = (zoneSEbuddies - 1) * 47;
  250. deltaTopPos = (zoneSEbuddies -1) * 155;
  251. deltaLeftPos = (zoneSEbuddies -1) * 155;
  252. angle = 102 + (deltaAng);
  253. $("#buddy" + nextFreeBuddy).css("transform","rotate(" + angle + "deg)");
  254. buddyTop = (window.innerHeight/2)-(((planetH / 8.5)*0.03) - deltaTopPos);
  255. buddyLeft = (window.innerWidth/2)+(((planetW / 5.0)*2.0) - deltaLeftPos);
  256. break;
  257. case zoneSW:
  258. zoneSWbuddies++;
  259. //zoneSWbuddies++;
  260. deltaAng = (zoneSWbuddies - 1) * 47;
  261. deltaTopPos = (zoneSWbuddies -1) * 155;
  262. deltaLeftPos = (zoneSWbuddies -1) * 155;
  263. angle = 102 + (deltaAng);
  264. $("#buddy" + nextFreeBuddy).css("transform","rotate(-" + angle + "deg)");
  265. buddyTop = (window.innerHeight/2)-(((planetH / 8.5)*0.03) - deltaTopPos);
  266. buddyLeft = (window.innerWidth/2)-(((planetW / 5.0)*3.6) - deltaLeftPos);
  267. break;
  268. case zoneNW:
  269. zoneNWbuddies++;
  270. //zoneNWbuddies++;
  271. deltaAng = (zoneNWbuddies - 1) * 47;
  272. deltaTopPos = (zoneNWbuddies -1) * 155;
  273. deltaLeftPos = (zoneNWbuddies -1) * 155;
  274. angle = 22 + (deltaAng);
  275. $("#buddy" + nextFreeBuddy).css("transform","rotate(-" + angle + "deg)");
  276. buddyTop = (window.innerHeight/2)-(((planetH / 8.5)*5.83) - deltaTopPos);
  277. buddyLeft = (window.innerWidth/2)-(((planetW / 5.0)*2.5) + deltaLeftPos);
  278. break;
  279. }
  280. $("#buddy" + nextFreeBuddy).css("position","absolute");
  281. $("#buddy" + nextFreeBuddy).css("top", buddyTop + "px");
  282. $("#buddy" + nextFreeBuddy).css("left", buddyLeft + "px");
  283. }
  284. function addMale(name, hairc, glasses, beard, zone) {
  285. //1=black hair
  286. //2=brown hair
  287. //3=blond hair
  288. if (hairc<0 || hairc>3) {
  289. alert("wrong param for male: hairc");
  290. }
  291. if (glasses<0 || glasses>1) {
  292. alert("wrong param for male: glasses");
  293. }
  294. if (beard<0 || beard>1) {
  295. alert("wrong param for male: beard");
  296. }
  297. t=""+hairc+glasses+beard;
  298. if (t!=="101" && t!=="210" && t!=="300") {
  299. t="210";
  300. }
  301. $("#buddy" + nextFreeBuddy).css("background-image", "url('/res/homo"+t+".png')");
  302. $("#buddy" + nextFreeBuddy).css("background-repeat", "no-repeat");
  303. $("#buddy" + nextFreeBuddy).css("background-size", "100% 100%");
  304. setBuddyPosition(zone);
  305. $("#buddy" + nextFreeBuddy + " .name").get(0).innerHTML=name;
  306. $("#buddy" + nextFreeBuddy).show();
  307. nextFreeBuddy++;
  308. }
  309. function addFamale(name, hairc, glasses, beard, zone) {
  310. //1=black hair
  311. //2=brown hair
  312. //3=blond hair
  313. if (hairc<0 || hairc>3) {
  314. alert("wrong param for male: hairc");
  315. }
  316. if (glasses<0 || glasses>1) {
  317. alert("wrong param for male: glasses");
  318. }
  319. if (beard<0 || beard>0) {
  320. alert("wrong param for male: beard");
  321. }
  322. t=""+hairc+glasses+beard;
  323. if (t!=="110" && t!=="200" && t!=="300") {
  324. t="200";
  325. }
  326. $("#buddy" + nextFreeBuddy).css("background-image", "url('/res/homa"+t+".png')");
  327. $("#buddy" + nextFreeBuddy).css("background-repeat", "no-repeat");
  328. $("#buddy" + nextFreeBuddy).css("background-size", "100% 100%");
  329. setBuddyPosition(zone);
  330. $("#buddy" + nextFreeBuddy + " .name").get(0).innerHTML=name;
  331. $("#buddy" + nextFreeBuddy).show();
  332. nextFreeBuddy++;
  333. }
  334. function addBuddy(name, gender, hairc, glasses, beard, zone) {
  335. if (gender === "male") {
  336. addMale(name, hairc, glasses, beard, zone);
  337. } else {
  338. addFamale(name, hairc, glasses, beard, zone);
  339. }
  340. }
  341. </script>
  342. <script>
  343. var burgerMenuVisible=false;
  344. function popupMenu(buddy, online) {
  345. if (!burgerMenuVisible) {
  346. menuRect = $("#buddy"+buddy+" .hal").get(0).getBoundingClientRect();
  347. $("#burgerMenu"+buddy).show();
  348. $("#burgerMenu"+buddy).css("z-index", "99999");
  349. $("#burgerMenu"+buddy).css("top", parseInt(menuRect.top-23));
  350. $("#burgerMenu"+buddy).css("left", parseInt(menuRect.left+40));
  351. if (online) {
  352. $("#muStatus"+buddy).css("color", "#55bb08");
  353. $("#muStatus"+buddy).css("font-weight", "900");
  354. } else {
  355. $("#muStatus"+buddy).css("color", "red");
  356. $("#muStatus"+buddy).css("font-weight", "900");
  357. }
  358. } else {
  359. $(".burger-menu").hide();
  360. $(".burger-menu").css("z-index", "99992");
  361. }
  362. burgerMenuVisible=!burgerMenuVisible;
  363. }
  364. function hideMenu() {
  365. $(".burger-menu").hide();
  366. burgerMenuVisible=false;
  367. }
  368. function refresh() {
  369. $(".burger-menu").hide();
  370. frmSim.submit();
  371. }
  372. </script>
  373. <script>
  374. function selGroup(group) {
  375. <?PHP if ($CURRENT_VIEW === PUBLIC_VIEW): ?>
  376. $("#_group").val(group);
  377. frmSim.submit();
  378. <?PHP Endif; ?>
  379. }
  380. var buddiesVis = [1,1,1,1,1,1,1,1];
  381. function toggleBuddie(buddie) {
  382. if (buddiesVis[buddie]===1) {
  383. $("#buddy"+buddie).hide();
  384. buddiesVis[buddie]=0;
  385. $("#buddysel"+buddie).css("background-color", "#FFFFFF");
  386. } else {
  387. $("#buddy"+buddie).show();
  388. buddiesVis[buddie]=1;
  389. $("#buddysel"+buddie).css("background-color", "lightblue");
  390. }
  391. }
  392. function checkin() {
  393. hideMenu();
  394. $('#modalButton1').click();
  395. }
  396. function saveCheckin() {
  397. $("#_checkin").val("1");
  398. frmSim.submit();
  399. }
  400. </script>
  401. </head>
  402. <body>
  403. <div class="header" style="margin-top:18px;margin-bottom:18px;">
  404. <a href="https://themultiversed.org" target="_self" style="color:#000000; text-decoration: none;">&nbsp;<img src="/res/planet.png" style="width:22px;">&nbsp;TheMultiversed.org</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://github.com/par7133/TheMultiversed-org" style="color:#000000;"><span style="color:#119fe2">on</span> github</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:posta@elettronica.lol" style="color:#000000;"><span style="color:#119fe2">for</span> feedback</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="tel:+39-378-0812391" style="font-size:13px;background-color:#15c60b;border:2px solid #15c60b;color:#000000;height:27px;text-decoration:none;">&nbsp;&nbsp;get support&nbsp;&nbsp;</a>
  405. </div>
  406. <form id="frmSim" action="." method="POST" target="_self">
  407. <div id="content">
  408. <?PHP if ($CURRENT_VIEW === PUBLIC_VIEW): ?>
  409. <?PHP if ($password !== PHP_STR || (DEMO && $curgroup!="")): ?>
  410. <div id="groups" >
  411. <?PHP
  412. foreach($aGroups as $keyg => $valg) {
  413. if ($keyg === $curgroup) {
  414. echo("<div class='group active-group'>".$keyg."</div>\n");
  415. $aFriends = $valg;
  416. $ii = 0;
  417. foreach($aFriends as $keyf => $valf) {
  418. $ii++;
  419. echo("<div id='buddysel".$ii."' class='buddysel' onclick=toggleBuddie(".$ii.")>".$keyf."</div>\n");
  420. }
  421. } else {
  422. echo("<div class='group' onclick=selGroup('".$keyg."')>".$keyg."</div>\n");
  423. }
  424. }
  425. ?>
  426. </div>
  427. <?PHP EndIf; ?>
  428. <?PHP EndIf; ?>
  429. <?PHP if ($CURRENT_VIEW === LOCKED_VIEW || ($curgroup==PHP_STR && DEMO)): ?>
  430. <?PHP echo("<div id='emptyPlanet'>Oh, a brand new planet !&nbsp;" . ((DEMO)?"<span class='demo' onclick=selGroup('DEV')>[ DEMO ]</span>":"") . "</div>"); ?>
  431. <?PHP Endif; ?>
  432. <div id="planet">&nbsp;</div>
  433. <?PHP
  434. foreach($aGroups as $keyg => $valg) {
  435. if ($keyg === $curgroup) {
  436. $aFriends = $valg;
  437. $gname = $keyg;
  438. $ii = 0;
  439. foreach($aFriends as $keyf => $valf) {
  440. $ii++;
  441. $aFFields = $valf;
  442. $name = $keyf;
  443. $gender = $aFFields['gender'];
  444. $location = $aFFields['Location'];
  445. $desc = $aFFields['Desc'];
  446. $online = $aFFields['online'];
  447. //echo("$name;online$ii=$online<br>");
  448. $defStatus = $aFFields['defStatus'];
  449. //echo("defStatus$ii=$defStatus<br>");
  450. $phone = $aFFields['Phone'];
  451. $homomm = $aFFields['Homomm'];
  452. $blog = $aFFields['Blog'];
  453. $www = $aFFields['www'];
  454. $zone = $aFFields['zone'];
  455. ?>
  456. <div id="buddy<?PHP echo($ii);?>" class="buddy"><div class="name">&nbsp;</div>&nbsp;<div class="hal" onclick="popupMenu(<?PHP echo($ii);?>,<?PHP echo($online);?>)"><img src="<?PHP echo(($online===1?"/res/hall.png":"/res/hal.png"));?>"></div></div>
  457. <div id="burgerMenu<?PHP echo($ii);?>" class="burger-menu" style="display: none; z-index:99997; border: 0px solid yellow;">
  458. <div id="muName<?PHP echo($ii);?>" class="vmuBurgerMenu"><?PHP echo($name); ?>&nbsp;[<?PHP echo($location); ?>]&nbsp;</div>
  459. <div id="muDesc<?PHP echo($ii);?>" class="vmuBurgerMenu"><?PHP echo($desc); ?>&nbsp;</div>
  460. <div id="muStatus<?PHP echo($ii);?>" class="vmuBurgerMenu"><?PHP echo($defStatus); ?>&nbsp;</div>
  461. <hr style="border:1px solid #003333;">
  462. <?PHP if (($gname===$groupName && $name===$userName) || DEMO):?>
  463. <div id="muCheckIn<?PHP echo($ii);?>" class="vmuBurgerMenu" onclick="checkin('<?PHP echo($gname);?>','<?PHP echo($name);?>')">Check-in&nbsp;</div>
  464. <hr style="border:1px solid #003333;">
  465. <?PHP EndIf; ?>
  466. <div id="muCall<?PHP echo($ii);?>" class="vmuBurgerMenu"><a href="call:<?PHP echo($phone); ?>">call: <?PHP echo($phone); ?>&nbsp;</div>
  467. <div id="muHomomm<?PHP echo($ii);?>" class="vmuBurgerMenu"><a href="<?PHP echo($homomm); ?>">Homomm</a></div>
  468. <div id="muBlog<?PHP echo($ii);?>" class="vmuBurgerMenu"><a href="<?PHP echo($blog); ?>">Blog</a>&nbsp;</div>
  469. <div id="muWWW<?PHP echo($ii);?>" class="vmuBurgerMenu"><a href="<?PHP echo($www); ?>">www</a>&nbsp;</div>
  470. <hr style="border:1px solid #003333;">
  471. <div id="muReset<?PHP echo($ii);?>" class="vmuBurgerMenu" onclick="refresh();">Refresh&nbsp;</div>
  472. </div>
  473. <?PHP
  474. }
  475. break;
  476. }
  477. }
  478. ?>
  479. <button id="modalButton1" type="button" class="btn btn-primary" style="display:none;" data-toggle="modal" data-target="#modal1">Button #1</button>
  480. <div class="modal" tabindex="-1" role="dialog" id="modal1">
  481. <div class="modal-dialog modal-sm my-modal-dialog" role="document">
  482. <div class="modal-content my-modal-content">
  483. <div style="position:absolute; top:10px; padding:50px;">
  484. <table style="width:100%">
  485. <tr>
  486. <td class="checkin-cell">Location:&nbsp;</td><td width="450px"><input class="checkin-field" id="txtNewLocation" name="txtNewLocation" type="text" value="<?PHP echo($defLocation);?>"></td>
  487. </tr>
  488. <tr>
  489. <td class="checkin-cell">Phone:&nbsp;</td><td width="450px"><input class="checkin-field" id="txtNewPhone" name="txtNewPhone" type="text" value="<?PHP echo($defPhone);?>"></td>
  490. </tr>
  491. <tr>
  492. <td class="checkin-cell">Status&nbsp;</td><td width="450px"><input class="checkin-field" id="txtNewStatus" name="txtNewStatus" type="text" value="<?PHP echo($defStatus2);?>"></td>
  493. </tr>
  494. <tr>
  495. <td class="checkin-cell">Online?&nbsp;</td><td width="450px">
  496. <select id="cbNewOnline" name="cbNewOnline">
  497. <option value="0">offline</option>
  498. <option value="1" selected>online</option>
  499. </select>
  500. </tr>
  501. <tr>
  502. <td class="checkin-cell">Password:&nbsp;</td><td width="450px"><input class="checkin-field" id="txtCheckinPassword" name="txtCheckinPassword" type="password" value=""></td>
  503. </tr>
  504. <tr>
  505. <td class="checkin-cell" colspan="2"><br><br></td>
  506. </tr>
  507. <tr>
  508. <td class="checkin-cell" colspan="2"><input id="butSave" name="butSave" type="button" onclick="saveCheckin()" value="Save">&nbsp;&nbsp;<input id="butReset" name="butReset" type="reset" value="Reset"></td>
  509. </tr>
  510. </table>
  511. </div>
  512. </div>
  513. <div class="modal-toolbox" style="float:left;">
  514. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  515. </div>
  516. </div>
  517. </div>
  518. </div>
  519. <input id="_group" name="_group" type="hidden" value="<?PHP echo($curgroup)?>">
  520. <input id="_checkin" name="_checkin" type="hidden" value="">
  521. <div id="passworddisplay">
  522. <br>
  523. &nbsp;&nbsp;<input type="password" id="Password" name="Password" placeholder="password" value="<?php echo($password);?>" autocomplete="off">&nbsp;<input id="goBut" type="button" onclick="passwordSubmit()" value="<?PHP echo(getResource0("Go", $lang));?>"><br>
  524. &nbsp;&nbsp;<input type="text" id="Salt" placeholder="salt" autocomplete="off"><br>
  525. <div style="text-align:center;">
  526. <a id="hashMe" href="#" onclick="showEncodedPassword();"><?PHP echo(getResource0("Hash Me", $lang));?>!</a>
  527. </div>
  528. </div>
  529. </form>
  530. <div id="footerCont">&nbsp;</div>
  531. <div id="footer" style="float:right; width:520px; white-space: nowrap;">
  532. <span style="background:#FFFFFF; opacity:0.7;">&nbsp;&nbsp;A <a href="http://5mode.com" class="aaa">5 Mode</a> project and <a href="http://demo.5mode.com" class="aaa">WYSIWYG</a> system. <?PHP echo(getResource0("Some rights reserved", $lang));?>.</span>
  533. </div>
  534. <script>
  535. var ito;
  536. window.addEventListener("load", function() {
  537. $("#planet").css("height", window.innerHeight);
  538. <?PHP
  539. foreach($aGroups as $keyg => $valg) {
  540. if ($keyg === $curgroup) {
  541. $aFriends = $valg;
  542. $ii = 0;
  543. foreach($aFriends as $keyf => $valf) {
  544. $aFFields = $valf;
  545. $name = $keyf;
  546. $gender = $aFFields['gender'];
  547. $hairc = $aFFields['hairc'];
  548. $glasses = $aFFields['glasses'];
  549. $beard = $aFFields['beard'];
  550. $zone = $aFFields['zone'];
  551. echo("addBuddy('".$name."', '".$gender."',".$hairc.",".$glasses.",".$beard.",".$zone.");");
  552. $ii++;
  553. }
  554. break;
  555. }
  556. }
  557. ?>
  558. });
  559. function reloadme() {
  560. frmSim.submit();
  561. }
  562. window.addEventListener("resize", function() {
  563. $("#content").hide();
  564. ito = setTimeout("reloadme()","1500");
  565. });
  566. </script>
  567. <script>
  568. function setFooterPos() {
  569. if (document.getElementById("footerCont")) {
  570. tollerance = 16;
  571. $("#footerCont").css("top", parseInt( window.innerHeight - $("#footerCont").height() - tollerance ) + "px");
  572. $("#footer").css("left", parseInt( window.innerWidth - $("#footer").width() - tollerance ) + "px");
  573. $("#footer").css("top", parseInt( window.innerHeight - $("#footer").height() - tollerance ) + "px");
  574. }
  575. }
  576. window.addEventListener("load", function() {
  577. setTimeout("setFooterPos()", 1000);
  578. });
  579. window.addEventListener("resize", function() {
  580. setTimeout("setFooterPos()", 1000);
  581. });
  582. </script>
  583. <script src="/js/home-js.php?hl=<?PHP echo($lang);?>&cv=<?PHP echo($CURRENT_VIEW);?>" type="text/javascript"></script>
  584. <!-- SKINNER CODE -->
  585. <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "skinner.html")): ?>
  586. <?php include(APP_PATH . DIRECTORY_SEPARATOR . "skinner.html"); ?>
  587. <?php endif; ?>
  588. <!-- METRICS CODE -->
  589. <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "metrics.html")): ?>
  590. <?php include(APP_PATH . DIRECTORY_SEPARATOR . "metrics.html"); ?>
  591. <?php endif; ?>
  592. </body>
  593. </html>