home.php 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. <?php
  2. /**
  3. * Copyright 2021, 2024 5 Mode
  4. *
  5. * This file is part of Puzzleu.
  6. *
  7. * Puzzleu is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * Puzzleu is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with Puzzleu. If not, see <https://www.gnu.org/licenses/>.
  19. *
  20. * home.php
  21. *
  22. * Home of Puzzleu.
  23. *
  24. * @author Daniele Bonini <my25mb@aol.com>
  25. * @copyrights (c) 2016, 2024, 5 Mode
  26. */
  27. // use QRcode;
  28. // CONSTANTS AND VARIABLE DECLARATION
  29. $CURRENT_VIEW = PUBLIC_VIEW;
  30. $CUDOZ = 1;
  31. $AVATAR_PATH = APP_DATA_PATH . DIRECTORY_SEPARATOR . AVATAR_NAME;
  32. $CV_PATH = $AVATAR_PATH . DIRECTORY_SEPARATOR . "cv";
  33. $FRIENDS_PATH = $AVATAR_PATH . DIRECTORY_SEPARATOR . "friends";
  34. $BLOG_PATH = $AVATAR_PATH . DIRECTORY_SEPARATOR . "blog";
  35. $GALLERY_PATH = $AVATAR_PATH . DIRECTORY_SEPARATOR . "gallery";
  36. $MAGICJAR1_PATH = $AVATAR_PATH . DIRECTORY_SEPARATOR . "magicjar1";
  37. $MAGICJAR2_PATH = $AVATAR_PATH . DIRECTORY_SEPARATOR . "magicjar2";
  38. $MAGICJAR3_PATH = $AVATAR_PATH . DIRECTORY_SEPARATOR . "magicjar3";
  39. $profilePic = APP_DEF_PROFILE_PIC;
  40. // PAGE PARAMETERS
  41. $lang = APP_DEF_LANG;
  42. $lang1 = substr(strip_tags(filter_input(INPUT_GET, "hl")??""), 0, 5);
  43. if ($lang1 !== PHP_STR) {
  44. $lang = $lang1;
  45. }
  46. $shortLang = getShortLang($lang);
  47. $blogSP = (int)substr(strip_tags(filter_input(INPUT_GET, "blogSP")??""), 0, 5);
  48. $password = filter_input(INPUT_POST, "Password")??"";
  49. $password = strip_tags($password);
  50. if ($password !== PHP_STR) {
  51. $hash = hash("sha256", $password . APP_SALT, false);
  52. if (defined("APP_" . strtoupper(AVATAR_NAME) . "_HASH")) {
  53. if ($hash !== constant("APP_" . strtoupper(AVATAR_NAME) . "_HASH")) {
  54. $password=PHP_STR;
  55. }
  56. } else {
  57. if ($hash !== APP_HASH) {
  58. $password=PHP_STR;
  59. }
  60. }
  61. // if ($hash !== APP_HASH) {
  62. // $password=PHP_STR;
  63. // }
  64. }
  65. if ($password !== PHP_STR) {
  66. $CURRENT_VIEW = ADMIN_VIEW;
  67. } else {
  68. $CURRENT_VIEW = PUBLIC_VIEW;
  69. }
  70. $magicJar1 = (int)substr(strip_tags(filter_input(INPUT_POST, "txtMagicJar1")??""), 0, 1);
  71. $magicJar2 = (int)substr(strip_tags(filter_input(INPUT_POST, "txtMagicJar2")??""), 0, 1);
  72. $magicJar3 = (int)substr(strip_tags(filter_input(INPUT_POST, "txtMagicJar3")??""), 0, 1);
  73. if ($CURRENT_VIEW === PUBLIC_VIEW ) {
  74. $MAXP = (int)substr(strip_tags(filter_input(INPUT_GET, "maxp")??""), 0, 2);
  75. if ($MAXP === 0) {
  76. $MAXP = APP_BLOG_WIDE_MAX_POSTS;
  77. }
  78. }
  79. function uploadNewRes() {
  80. global $AVATAR_PATH;
  81. global $CV_PATH;
  82. global $FRIENDS_PATH;
  83. global $BLOG_PATH;
  84. global $GALLERY_PATH;
  85. global $MAGICJAR1_PATH;
  86. global $MAGICJAR2_PATH;
  87. global $MAGICJAR3_PATH;
  88. global $magicJar1;
  89. global $magicJar2;
  90. global $magicJar3;
  91. //echo_ifdebug(true, "AVATAR_PATH#1=");
  92. //echo_ifdebug(true, $AVATAR_PATH);
  93. if (!empty($_FILES['files']['tmp_name'][0]) || !empty($_FILES['filesdd']['tmp_name'][0])) {
  94. $uploads = (array)fixMultipleFileUpload($_FILES['files']);
  95. if ($uploads[0]['error'] === PHP_UPLOAD_ERR_NO_FILE) {
  96. $uploads = (array)fixMultipleFileUpload($_FILES['filesdd']);
  97. }
  98. //if ($uploads[0]['error'] === PHP_UPLOAD_ERR_NO_FILE) {
  99. // echo("WARNING: No file uploaded.");
  100. // return;
  101. //}
  102. $google = "abcdefghijklmnopqrstuvwxyz";
  103. if (count($uploads)>strlen($google)) {
  104. echo("WARNING: Too many uploaded files.");
  105. return;
  106. }
  107. $i=1;
  108. foreach($uploads as &$upload) {
  109. switch ($upload['error']) {
  110. case PHP_UPLOAD_ERR_OK:
  111. break;
  112. case PHP_UPLOAD_ERR_NO_FILE:
  113. echo("WARNING: One or more uploaded files are missing.");
  114. return;
  115. case PHP_UPLOAD_ERR_INI_SIZE:
  116. echo("WARNING: File exceeded INI size limit.");
  117. return;
  118. case PHP_UPLOAD_ERR_FORM_SIZE:
  119. echo("WARNING: File exceeded form size limit.");
  120. return;
  121. case PHP_UPLOAD_ERR_PARTIAL:
  122. echo("WARNING: File only partially uploaded.");
  123. return;
  124. case PHP_UPLOAD_ERR_NO_TMP_DIR:
  125. echo("WARNING: TMP dir doesn't exist.");
  126. return;
  127. case PHP_UPLOAD_ERR_CANT_WRITE:
  128. echo("WARNING: Failed to write to the disk.");
  129. return;
  130. case PHP_UPLOAD_ERR_EXTENSION:
  131. echo("WARNING: A PHP extension stopped the file upload.");
  132. return;
  133. default:
  134. echo("WARNING: Unexpected error happened.");
  135. return;
  136. }
  137. if (!is_uploaded_file($upload['tmp_name'])) {
  138. echo("WARNING: One or more file have not been uploaded.");
  139. return;
  140. }
  141. // name
  142. $name = (string)substr((string)filter_var($upload['name']), 0, 255);
  143. if ($name == PHP_STR) {
  144. echo("WARNING: Invalid file name: " . $name);
  145. return;
  146. }
  147. $upload['name'] = $name;
  148. // fileType
  149. $fileType = substr((string)filter_var($upload['type']), 0, 30);
  150. $upload['type'] = $fileType;
  151. // tmp_name
  152. $tmp_name = substr((string)filter_var($upload['tmp_name']), 0, 300);
  153. if ($tmp_name == PHP_STR || !file_exists($tmp_name)) {
  154. echo("WARNING: Invalid file temp path: " . $tmp_name);
  155. return;
  156. }
  157. $upload['tmp_name'] = $tmp_name;
  158. //size
  159. $size = substr((string)filter_var($upload['size'], FILTER_SANITIZE_NUMBER_INT), 0, 12);
  160. if ($size == "") {
  161. echo("WARNING: Invalid file size.");
  162. return;
  163. }
  164. $upload["size"] = $size;
  165. $tmpFullPath = $upload["tmp_name"];
  166. $originalFilename = pathinfo($name, PATHINFO_FILENAME);
  167. $originalFileExt = pathinfo($name, PATHINFO_EXTENSION);
  168. $fileExt = strtolower(pathinfo($name, PATHINFO_EXTENSION));
  169. $date = date("Ymd-His");
  170. $rnd = mt_rand(1000000000, 9999999999);
  171. if ($originalFileExt!==PHP_STR) {
  172. $destFileName = $date . "-" . $rnd . substr($google, $i-1, 1) . "|" . str_replace(" ", "_", $originalFilename) . ".$fileExt";
  173. } else {
  174. return;
  175. }
  176. //$CV_PATH = APP_DATA_PATH . DIRECTORY_SEPARATOR . "cv";
  177. //$FRIENDS_PATH = APP_DATA_PATH . DIRECTORY_SEPARATOR . "friends";
  178. //$BLOG_PATH = APP_DATA_PATH . DIRECTORY_SEPARATOR . "blog";
  179. //$GALLERY_PATH = APP_DATA_PATH . DIRECTORY_SEPARATOR . "gallery";
  180. $destPaths = [];
  181. $destFullPaths = [];
  182. if ($magicJar1 != 0) {
  183. $destPaths[] = $MAGICJAR1_PATH;
  184. $destFullPaths[] = $destPaths[count($destPaths)-1] . DIRECTORY_SEPARATOR . $destFileName;
  185. }
  186. if ($magicJar2 != 0) {
  187. $destPaths[] = $MAGICJAR2_PATH;
  188. $destFullPaths[] = $destPaths[count($destPaths)-1] . DIRECTORY_SEPARATOR . $destFileName;
  189. }
  190. if ($magicJar3 != 0) {
  191. $destPaths[] = $MAGICJAR3_PATH;
  192. $destFullPaths[] = $destPaths[count($destPaths)-1] . DIRECTORY_SEPARATOR . $destFileName;
  193. }
  194. if (empty($destPaths)) {
  195. switch ($fileExt) {
  196. case "doc":
  197. case "docx":
  198. case "pdf":
  199. $destPaths[] = $CV_PATH;
  200. break;
  201. //case "txt":
  202. // $destPaths[] = $BLOG_PATH;
  203. // break;
  204. case "png":
  205. case "jpg":
  206. case "jpeg":
  207. case "gif":
  208. case "webp":
  209. $destPaths[] = $BLOG_PATH;
  210. break;
  211. default:
  212. $destPaths[] = $MAGICJAR1_PATH;
  213. break;
  214. }
  215. $destFullPaths[] = $destPaths[0] . DIRECTORY_SEPARATOR . $destFileName;
  216. }
  217. $iPath = 0;
  218. foreach($destFullPaths as $destFullPath) {
  219. if (file_exists($destFullPath)) {
  220. echo("WARNING: destination already exists");
  221. exit(1);
  222. }
  223. if (filesize($tmpFullPath) > APP_FILE_MAX_SIZE) {
  224. echo("ERROR: file size(" . filesize($tmpFullPath) . ") exceeds app limit:" . APP_FILE_MAX_SIZE);
  225. exit(1);
  226. }
  227. if (!is_readable($AVATAR_PATH)) {
  228. mkdir($AVATAR_PATH, 0777);
  229. }
  230. if (!is_readable($destPaths[$iPath])) {
  231. mkdir($destPaths[$iPath], 0777);
  232. }
  233. $pattern = $destPaths[$iPath] . DIRECTORY_SEPARATOR . "*" . "|" . str_replace(" ", "_", $originalFilename) . ".$fileExt";
  234. $aExistingPaths = glob($pattern);
  235. if (!empty($aExistingPaths)) {
  236. continue;
  237. }
  238. copy($tmpFullPath, $destFullPath);
  239. $iPath++;
  240. }
  241. // Cleaning up..
  242. // Delete the tmp file..
  243. unlink($tmpFullPath);
  244. $i++;
  245. }
  246. } else {
  247. //echo("WARNING: No file uploaded (err-pip-po).");
  248. }
  249. }
  250. function writeFriends() {
  251. global $FRIENDS_PATH;
  252. $destPath = $FRIENDS_PATH;
  253. $s = filter_input(INPUT_POST, "f")??"";
  254. $s = strip_tags($s);
  255. if ($s != PHP_STR) {
  256. //echo($s);
  257. //exit(0);
  258. $friends=explode("|", $s);
  259. if (!is_readable($destPath)) {
  260. mkdir($destPath, 0777);
  261. }
  262. foreach($friends as $friend) {
  263. $a = explode("://",$friend);
  264. $s = $a[1];
  265. $a = explode("/", $s);
  266. $friendName = $a[0] . ".txt";
  267. file_put_contents($destPath . DIRECTORY_SEPARATOR . $friendName, $friend);
  268. }
  269. }
  270. }
  271. function grabProfileImage() {
  272. global $BLOG_PATH;
  273. $pattern = $BLOG_PATH . DIRECTORY_SEPARATOR . "*";
  274. $aImagePaths = glob($pattern);
  275. if (isset($aImagePaths[0])) {
  276. $retval = basename($aImagePaths[0]);
  277. } else {
  278. $retval = null;
  279. }
  280. return $retval;
  281. }
  282. function startApp() {
  283. global $CURRENT_VIEW;
  284. global $profilePic;
  285. if ($CURRENT_VIEW == ADMIN_VIEW) {
  286. uploadNewRes();
  287. writeFriends();
  288. }
  289. $profilePic = grabProfileImage() ?? APP_DEF_PROFILE_PIC;
  290. //echo("profile pic=" . $profilePic);
  291. }
  292. startApp();
  293. ?>
  294. <!DOCTYPE html>
  295. <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
  296. <head>
  297. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  298. <!--<?PHP echo(APP_LICENSE);?>-->
  299. <title><?PHP echo(APP_TITLE);?></title>
  300. <link rel="shortcut icon" href="/favicon.ico" />
  301. <?PHP if ($CURRENT_VIEW == PUBLIC_VIEW): ?>
  302. <script>
  303. function renderCorrectPag () {
  304. if (window.innerWidth <= 500) {
  305. if (<?PHP echo($MAXP) ?>!=<?PHP echo(APP_BLOG_ULTRATHIN_MAX_POSTS) ?>) {
  306. window.open("/<?PHP echo(AVATAR_NAME); ?>/?blogSP=<?php echo($blogSP); ?>&maxp=<?PHP echo(APP_BLOG_ULTRATHIN_MAX_POSTS) ?>","_self");
  307. }
  308. } else if (window.innerWidth <= 1050) {
  309. if (<?PHP echo($MAXP) ?>!=<?PHP echo(APP_BLOG_THIN_MAX_POSTS) ?>) {
  310. window.open("/<?PHP echo(AVATAR_NAME); ?>/?blogSP=<?php echo($blogSP); ?>&maxp=<?PHP echo(APP_BLOG_THIN_MAX_POSTS) ?>","_self");
  311. }
  312. } else {
  313. if (<?PHP echo($MAXP) ?>!=<?PHP echo(APP_BLOG_WIDE_MAX_POSTS) ?>) {
  314. window.open("/<?PHP echo(AVATAR_NAME); ?>/?blogSP=<?php echo($blogSP); ?>&maxp=<?PHP echo(APP_BLOG_WIDE_MAX_POSTS) ?>","_self");
  315. }
  316. }
  317. }
  318. window.addEventListener("load", function() {
  319. renderCorrectPag();
  320. }, false);
  321. window.addEventListener("resize", function() {
  322. renderCorrectPag();
  323. }, false);
  324. </script>
  325. <?PHP endif; ?>
  326. <meta name="description" content="Welcome to Puzzleu! Let everyone have its puzzle."/>
  327. <meta name="keywords" content="puzzleu,photo,puzzle,on,premise,solution"/>
  328. <meta name="robots" content="index,follow"/>
  329. <meta name="author" content="5 Mode"/>
  330. <script src="/js/jquery-3.6.0.min.js" type="text/javascript"></script>
  331. <script src="/js/sha.js" type="text/javascript"></script>
  332. <script src="/js/common.js" type="text/javascript"></script>
  333. <script src="/js/bootstrap.min.js" type="text/javascript"></script>
  334. <link href="/css/style.css?r=<?PHP echo(time());?>" type="text/css" rel="stylesheet">
  335. <link href="/css/bootstrap.min.css" type="text/css" rel="stylesheet">
  336. </head>
  337. <?PHP if ($CURRENT_VIEW == ADMIN_VIEW): ?>
  338. <body style="background:url('/res/bg1.jpg') no-repeat; background-size: cover; background-attachment: fixed; background-position: center;">
  339. <div id="AFHint" style="z-index:0;">
  340. <button type="button" class="close" aria-label="Close" onclick="closeMe(this);" style="position:relative; top:5px; left:-7px;">
  341. <span aria-hidden="true" style="color:black; font-weight:900;">&times;</span>
  342. </button>
  343. <br>
  344. <span onclick="showHowTo();"><?PHP echo(getResource0("How-to: Manage your avatars in Puzzleu", $lang));?></span>
  345. <br><br>
  346. </div>
  347. <form id="frmUpload" role="form" method="post" action="/<?PHP echo(AVATAR_NAME);?>?hl=<?PHP echo($lang);?>" target="_self" enctype="multipart/form-data">
  348. <div class="dragover" dropzone="copy">
  349. <div id="fireupload" onclick="$('#files').click()">
  350. <img id="picavatar" src="/img?av=<?PHP echo(AVATAR_NAME);?>&pic=<?PHP echo($profilePic);?>" align="middle">
  351. </div>
  352. <input id="files" name="files[]" type="file" accept=".*" style="visibility: hidden;" multiple>
  353. <input type="hidden" id="a" name="a">
  354. <input type="hidden" id="f" name="f">
  355. </div>
  356. <div class="tools">
  357. <div class="settingson" onclick="settingsOn();"></div>
  358. <?PHP if ($magicJar1 == 0): ?>
  359. <div class="magicjar1" style="background:url(/res/magicjar1dis.png);" onclick="setJar1On()"></div>
  360. <?PHP else: ?>
  361. <div class="magicjar1" style="background:url(/res/magicjar1.png);" onclick="setJar1Off()"></div>
  362. <?PHP endif; ?>
  363. <?PHP if ($magicJar2 == 0): ?>
  364. <div class="magicjar2" style="background:url(/res/magicjar2dis.png);" onclick="setJar2On()"></div>
  365. <?PHP else: ?>
  366. <div class="magicjar2" style="background:url(/res/magicjar2.png);" onclick="setJar2Off()"></div>
  367. <?PHP endif; ?>
  368. <?PHP if ($magicJar3 == 0): ?>
  369. <div class="magicjar3" style="background:url(/res/magicjar3dis.png);" onclick="setJar3On()"></div>
  370. <?PHP else: ?>
  371. <div class="magicjar3" style="background:url(/res/magicjar3.png);" onclick="setJar3Off()"></div>
  372. <?PHP endif; ?>
  373. <div class="settingsoff" onclick="settingsOff();"></div>
  374. </div>
  375. <input type="hidden" id="txtMagicJar1" name="txtMagicJar1" value="<?PHP echo($magicJar1);?>">
  376. <input type="hidden" id="txtMagicJar2" name="txtMagicJar2" value="<?PHP echo($magicJar2);?>">
  377. <input type="hidden" id="txtMagicJar3" name="txtMagicJar3" value="<?PHP echo($magicJar3);?>">
  378. <input type="hidden" id="Password" name="Password" value="<?PHP echo($password);?>">
  379. </form>
  380. <div id="footerCont">&nbsp;</div>
  381. <div id="footer"><span style="background:#FFFFFF; opacity:0.7;">&nbsp;&nbsp;<a class="aaa" href="dd.html">Disclaimer</a>.&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></div>
  382. <?PHP else: ?>
  383. <body style="background:#dadada no-repeat; background-size: cover; background-attachment: fixed; background-position: center;">
  384. <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "jscheck.html")): ?>
  385. <?php include(APP_PATH . DIRECTORY_SEPARATOR . "jscheck.html"); ?>
  386. <?php endif; ?>
  387. <!--<div id="AFHint">
  388. <button type="button" class="close" aria-label="Close" onclick="closeMe(this);" style="position:relative; top:5px; left:-7px;">
  389. <span aria-hidden="true" style="color:black; font-weight:900;">&times;</span>
  390. </button>
  391. <br>
  392. <span onclick="showHowTo();"><?PHP echo(getResource0("How-to: Manage your avatars in Puzzleu", $lang));?></span>
  393. <br><br>
  394. </div> -->
  395. <br>
  396. <div id="header" class="header" style="margin-top:18px;margin-bottom:18px;">
  397. <div style="float:left">
  398. <a href="http://puzzleu.5mode-foss.eu" target="_self" style="color:#000000; text-decoration: none;">&nbsp;<img src="/res/AFlogo.png" align="middle" style="position:relative;top:-5px;width:22px;">&nbsp;Puzzleu</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://github.com/par7133/Puzzleu" 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-331-4029415" 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>
  399. </div>
  400. <div style="float:right; position:relative; top:-10px;margin-right:300px;">
  401. <a href="#" onclick="slideShow();"><img src="/res/playicon.png" style="width:45px;"></a>
  402. </div>
  403. </div>
  404. <div id="headerMob" class="header" style="margin-top:18px;margin-bottom:18px;display:none">
  405. <div style="float:left">
  406. <a href="http://puzzleu.5mode-foss.eu" target="_self" style="color:#000000; text-decoration: none;">&nbsp;<img src="/res/AFlogo.png" align="middle" style="position:relative;top:-5px;width:22px;">&nbsp;Puzzleu</a>
  407. </div>
  408. </div>
  409. <br>
  410. <form id="frmUpload" role="form" method="post" action="/<?PHP echo(AVATAR_NAME);?>?hl=<?PHP echo($lang);?>" target="_self" enctype="multipart/form-data">
  411. <div id="blog">
  412. <?PHP
  413. $iEntry = 2;
  414. $totLinks = 0;
  415. $aLinks=[];
  416. $pattern = $BLOG_PATH . DIRECTORY_SEPARATOR . "*";
  417. $aFilePaths = glob($pattern);
  418. if (empty($aFilePaths)): ?>
  419. <div class="blog-content">
  420. <div class="blog-entry" style="background:url('/res/img.png');background-size:100% 100%;">
  421. &nbsp;
  422. </div>
  423. </div>
  424. <?PHP else: ?>
  425. <?PHP
  426. $CUDOZ++;
  427. $iEntry = 1;
  428. $iCurEntry = 1;
  429. arsort($aFilePaths, SORT_STRING);
  430. $totPost = count($aFilePaths);
  431. // PAGINATION
  432. $totPages = (int)(count($aFilePaths)/$MAXP);
  433. if ($totPages < (count($aFilePaths)/$MAXP)) {
  434. $totPages++;
  435. }
  436. $firstPost = 0;
  437. $prevPost = $blogSP - $MAXP;
  438. if ($prevPost < 0) {
  439. $prevPost = 0;
  440. }
  441. $nextPost = $blogSP + $MAXP;
  442. if ($nextPost > (($totPages - 1) * $MAXP)) {
  443. $nextPost = (($totPages - 1) * $MAXP);
  444. }
  445. if ($nextPost < 0) {
  446. $nextPost = 0;
  447. }
  448. $lastPost = (($totPages - 1) * $MAXP);
  449. if ($lastPost < 0) {
  450. $lastPost = 0;
  451. }
  452. // ---
  453. //echo("blogSP=".$blogSP);
  454. foreach ($aFilePaths as $filePath) {
  455. //echo("iCurEntry=".$iCurEntry);
  456. if ($iCurEntry<($blogSP+1)) {
  457. $iCurEntry++;
  458. continue;
  459. }
  460. if (($iEntry>$MAXP) || (!APP_PAGINATION && $iCurEntry>APP_BLOG_MAX_POSTS)) {
  461. break;
  462. }
  463. $orifilename = basename($filePath);
  464. $orifileExt = strtolower(pathinfo($orifilename, PATHINFO_EXTENSION));
  465. $date = explode("-",$orifilename)[0];
  466. $time = explode("-",$orifilename)[1];
  467. $time = left($time,2) . ":" . substr($time,2,2);
  468. if ($iEntry === count($aFilePaths) || $iEntry==$MAXP) {
  469. $marginbottom = "0px";
  470. } else {
  471. $marginbottom = "5px";
  472. }
  473. ?>
  474. <?PHP if (in_array($orifileExt, ["png", "jpg", "jpeg", "gif", "webp"])):?>
  475. <div class="blog-content">
  476. <div class="blog-entry" onclick="selectVideo(<?php echo($iEntry-1);?>);" style="background:url('/img?av=<?PHP echo(AVATAR_NAME);?>&pic=<?PHP echo($orifilename);?>');background-size:100% 100%;">
  477. <?PHP if (APP_PAGINATION || (APP_BLOG_MAX_POSTS===0 || APP_BLOG_MAX_POSTS>$iCurEntry)): ?>
  478. <?php if ($iCurEntry===1 && $iEntry===1): ?>
  479. <!--<img class="blog-img" src="/res/arrow-leftd.png" style="float:left;">-->
  480. <?php elseif ($iEntry===1 && $iCurEntry>1): ?>
  481. <a href="/<?PHP echo(AVATAR_NAME); ?>/?blogSP=<?PHP echo($prevPost);?>&maxp=<?PHP echo($MAXP)?>" onclick="event.stopPropagation();"><img class="blog-img" src="/res/arrow-left.png" style="float:left;"></a>
  482. <?php endif; ?>
  483. <?php if ($iEntry===$MAXP && $iCurEntry===$totPost): ?>
  484. <!--<img class="blog-img" src="/res/arrow-rightd.png" style="float:right;">-->
  485. <?php elseif ($iEntry===$MAXP): ?>
  486. <?PHP if ($MAXP===APP_BLOG_ULTRATHIN_MAX_POSTS): ?>
  487. <div style="float:right;position: absolute;left:+85%; opacity:0.85;"><a href="/<?PHP echo(AVATAR_NAME); ?>/?blogSP=<?PHP echo($nextPost);?>&maxp=<?PHP echo($MAXP)?>" onclick="event.stopPropagation();"><img class="blog-img" src="/res/arrow-right.png" style="float:right;"></a></div>
  488. <?PHP elseif ($MAXP===APP_BLOG_THIN_MAX_POSTS): ?>
  489. <div style="float:right;position: absolute;left:+82%; opacity:0.85;"><a href="/<?PHP echo(AVATAR_NAME); ?>/?blogSP=<?PHP echo($nextPost);?>&maxp=<?PHP echo($MAXP)?>" onclick="event.stopPropagation();"><img class="blog-img" src="/res/arrow-right.png" style="float:right;"></a></div>
  490. <?PHP else: ?>
  491. <div style="float:right;position: absolute;left:+92%; opacity:0.85;"><a href="/<?PHP echo(AVATAR_NAME); ?>/?blogSP=<?PHP echo($nextPost);?>&maxp=<?PHP echo($MAXP)?>" onclick="event.stopPropagation();"><img class="blog-img" src="/res/arrow-right.png" style="float:right;"></a></div>
  492. <?php endif; ?>
  493. <?php endif; ?>
  494. <?PHP else: ?>
  495. &nbsp;
  496. <?PHP endif; ?>
  497. </div>
  498. </div>
  499. <?PHP $aLinks[] = "/img?av=" . AVATAR_NAME . "&pic=" . $orifilename; ?>
  500. <?PHP EndIf; ?>
  501. <?PHP
  502. $totLinks = $iEntry;
  503. $iEntry++;
  504. $iCurEntry++;
  505. }?>
  506. <?PHP endif; ?>
  507. <?PHP for($i=$iEntry;$i<=$MAXP;$i++):?>
  508. <div class="blog-content">
  509. <div class="blog-entry" style="border:0px;background:darkgray;">
  510. &nbsp;
  511. </div>
  512. </div>
  513. <?PHP endfor; ?>
  514. <?PHP if (($MAXP / 3) > (int)($MAXP / 3)): ?>
  515. <div class="blog-content">
  516. <div class="blog-entry" style="border:0px;background:darkgray;">
  517. &nbsp;
  518. </div>
  519. </div>
  520. <?PHP if ((($MAXP+1) / 3) > (int)(($MAXP+1) / 3)): ?>
  521. <div class="blog-content">
  522. <div class="blog-entry" style="border:0px;background:darkgray;">
  523. &nbsp;
  524. </div>
  525. </div>
  526. <?PHP endif; ?>
  527. <?PHP endif; ?>
  528. <br><br>
  529. </div>
  530. <?php
  531. $iLink = 0;
  532. foreach($aLinks as $aLink) { ?>
  533. <button id="modalButton<?php echo($iLink);?>" type="button" class="btn btn-primary" style="display:none;" data-toggle="modal" data-target="#modal<?php echo($iLink);?>">Button #<?php echo($iLink);?></button>
  534. <div class="modal" tabindex="-1" role="dialog" id="modal<?php echo($iLink);?>" style="z-index:99997;margin-top:10px;">
  535. <div class="modal-dialog modal-lg" role="document" style="width:95%;margin-top:0;background-color:#FFFFFF;z-index:99998">
  536. <div class="modal-content" style="float:left;width: content-box;max-width:60%;z-index:99999;">
  537. <img id="imageh<?PHP echo($iLink);?>" class="imageh" src="<?php echo($aLink); ?>" style="display:none">
  538. <img id="image<?PHP echo($iLink);?>" class="image" src="" marti-src="<?php echo($aLink); ?>" style="width:100%;vertical-align:middle;">
  539. </div>
  540. <!--
  541. <div class="modal-toolbox" style="float:right;">
  542. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  543. </div> -->
  544. </div>
  545. </div>
  546. <?php $iLink++; ?>
  547. <?php } ?>
  548. <?PHP
  549. // GALLERY GHOST
  550. $CUDOZ++;
  551. ?>
  552. <div id="halSys" class="col-xs-12 col-sm-10 col-md-10 col-lg-7 col-xl-5 col-haligned input-group" style="display: none; position:relative; top:-85px; left:-95px;">
  553. <div class="input-group-btn" style="border: 0px solid red;">
  554. <span id="halTerm" style="float: left; position:relative; left:+4%; top: +2px; cursor:pointer;"><img id="hal" src="/res/hal2_closed.png" style="width: 52px; position:relative; left:+5px;"></span>
  555. <div id="halBoard" style="float: left; position:relative; left:+5%; top: +2px; display: none;">
  556. <?PHP
  557. $pattern = $CV_PATH . DIRECTORY_SEPARATOR . "*";
  558. $aFilePaths = glob($pattern);
  559. if (!empty($aFilePaths)): ?>
  560. <?PHP $CUDOZ++; ?>
  561. <h3 class="board-entry" style="font-size: 1.45vw; float:left; color:#000000; background-color:lightgray; opacity:0.7; margin-right:4px; padding:4px; margin-left:3px; margin-right:3px;height: 24px;">
  562. <nobr>
  563. <div class="input-group">
  564. <div class="input-group-btn btn-white dropup">
  565. <a id="halCVOptions" class="btn dropdown-toggle btn-link btn-white" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="font-size: 0.95vw; font-weight:700; top:-9px; cursor:pointer; color: #000000;"><?php echo("CV");?></a>
  566. <table class="dropdown-menu cv-options-table bubble" style="background-color: white; left:-6px; margin-bottom: 10px; z-index:99999;">
  567. <tr>
  568. <td class="cv-options-td">
  569. <br>
  570. <?PHP
  571. $pattern = $CV_PATH . DIRECTORY_SEPARATOR . "*.doc";
  572. $aFilePaths = glob($pattern);
  573. if (!empty($aFilePaths)): ?>
  574. <a id="halCVDoc" href="/doc?av=<?PHP echo(AVATAR_NAME);?>&re=cv&doc=<?PHP echo(basename($aFilePaths[0]));?>" style="cursor:pointer; color: #000000; font-weight:700;"><?php echo("doc");?></a><br><br>
  575. <?PHP endif; ?>
  576. <?PHP
  577. $pattern = $CV_PATH . DIRECTORY_SEPARATOR . "*.pdf";
  578. $aFilePaths = glob($pattern);
  579. if (!empty($aFilePaths)): ?>
  580. <a id="halCVPdf" href="/doc?av=<?PHP echo(AVATAR_NAME);?>&re=cv&doc=<?PHP echo(basename($aFilePaths[0]));?>" style="cursor:pointer; color: #000000; font-weight:700;"><?php echo("pdf");?></a><br> <br>
  581. <?PHP endif; ?>
  582. </td>
  583. </tr>
  584. </table>
  585. </div>
  586. </div>
  587. </nobr>
  588. &nbsp;&nbsp; &nbsp;</h3>
  589. <?PHP endif; ?>
  590. <?PHP
  591. $pattern = $MAGICJAR1_PATH . DIRECTORY_SEPARATOR . "*";
  592. $aFilePaths = glob($pattern);
  593. if (!empty($aFilePaths)): ?>
  594. <h3 class="board-entry" style="font-size: 1.45vw; float:left; color:#000000; background-color:lightgray; opacity:0.7; margin-right:4px; padding:4px; margin-left:3px; margin-right:3px;height: 24px;">
  595. <nobr>
  596. <div class="input-group">
  597. <div class="input-group-btn btn-white dropup">
  598. <a id="halMP1Options" class="btn dropdown-toggle btn-link btn-white" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="font-size: 0.95vw; font-weight:700; top:-9px; cursor:pointer; color: #000000;">MagicPot1</a>
  599. <table class="dropdown-menu cv-options-table bubble" style="background-color: white; left:-6px; margin-bottom: 10px; z-index:99999;">
  600. <tr>
  601. <td class="cv-options-td">
  602. <br>
  603. <?PHP
  604. $iEntry = 1;
  605. foreach ($aFilePaths as $filePath) {
  606. $orifilename = basename($filePath);
  607. $orifileExt = strtolower(pathinfo($orifilename, PATHINFO_EXTENSION));
  608. $filename = explode("|",basename($filePath))[1];
  609. if ($iEntry === count($aFilePaths)) {
  610. $marginbottom = "0px";
  611. } else {
  612. $marginbottom = "5px";
  613. }
  614. ?>
  615. <?PHP if (in_array($orifileExt, ["png", "jpg", "jpeg", "gif", "webp"])):?>
  616. <a id="halMP1Doc<?PHP echo($iEntry);?>" href="/imgj?av=<?PHP echo(AVATAR_NAME);?>&jar=1&fn=<?PHP echo($orifilename);?>" style="cursor:pointer; color: #000000; font-weight:700;margin-right:10px;">
  617. <?PHP else: ?>
  618. <a id="halMP1Doc<?PHP echo($iEntry);?>" href="/file?av=<?PHP echo(AVATAR_NAME);?>&jar=1&fn=<?PHP echo($orifilename);?>" style="cursor:pointer; color: #000000; font-weight:700;margin-right:10px;">
  619. <?PHP endif; ?>
  620. <?PHP echo($filename);?>
  621. </a>
  622. <?PHP if ($iEntry !== count($aFilePaths)): ?>
  623. <br><br>
  624. <?PHP else: ?>
  625. <br>
  626. <?PHP endif; ?>
  627. <?PHP
  628. $iEntry++;
  629. }?>
  630. <br>
  631. </td>
  632. </tr>
  633. </table>
  634. </div>
  635. </div>
  636. </nobr>
  637. &nbsp;&nbsp;&nbsp;</h3>
  638. <?PHP endif; ?>
  639. <?PHP
  640. $pattern = $MAGICJAR2_PATH . DIRECTORY_SEPARATOR . "*";
  641. $aFilePaths = glob($pattern);
  642. if (!empty($aFilePaths)): ?>
  643. <!--<h3 class="board-entry" style="border-radius:3px;font-size: 1.45vw; font-weight:700; float:left; background-color:lightgray; opacity:0.7; margin-right:4px; padding:4px;">
  644. &nbsp;&nbsp;<a id="halMagicpot1" onclick="#" style="cursor:pointer; color: #000000;">Magicpot1</a>&nbsp;&nbsp;
  645. </h3>-->
  646. <h3 class="board-entry" style="font-size: 1.45vw; float:left; color:#000000; background-color:lightgray; opacity:0.7; margin-right:4px; padding:4px; margin-left:3px; margin-right:3px;height: 24px;">
  647. <nobr>
  648. <div class="input-group">
  649. <div class="input-group-btn btn-white dropup">
  650. <a id="halMP1Options" class="btn dropdown-toggle btn-link btn-white" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="font-size: 0.95vw; font-weight:700; top:-9px; cursor:pointer; color: #000000;">MagicPot2</a>
  651. <table class="dropdown-menu cv-options-table bubble" style="background-color: white; left:-6px; margin-bottom: 10px; z-index:99999;">
  652. <tr>
  653. <td class="cv-options-td">
  654. <br>
  655. <?PHP
  656. $iEntry = 1;
  657. foreach ($aFilePaths as $filePath) {
  658. $orifilename = basename($filePath);
  659. $orifileExt = strtolower(pathinfo($orifilename, PATHINFO_EXTENSION));
  660. $filename = explode("|",basename($filePath))[1];
  661. if ($iEntry === count($aFilePaths)) {
  662. $marginbottom = "0px";
  663. } else {
  664. $marginbottom = "5px";
  665. }
  666. ?>
  667. <?PHP if (in_array($orifileExt, ["png", "jpg", "jpeg", "gif", "webp"])):?>
  668. <a id="halMP1Doc<?PHP echo($iEntry);?>" href="/imgj?av=<?PHP echo(AVATAR_NAME);?>&jar=2&fn=<?PHP echo($orifilename);?>" style="cursor:pointer; color: #000000; font-weight:700;margin-right:10px;">
  669. <?PHP else: ?>
  670. <a id="halMP1Doc<?PHP echo($iEntry);?>" href="/file?av=<?PHP echo(AVATAR_NAME);?>&jar=2&fn=<?PHP echo($orifilename);?>" style="cursor:pointer; color: #000000; font-weight:700;margin-right:10px;">
  671. <?PHP endif; ?>
  672. <?PHP echo($filename);?>
  673. </a>
  674. <?PHP if ($iEntry !== count($aFilePaths)): ?>
  675. <br><br>
  676. <?PHP else: ?>
  677. <br>
  678. <?PHP endif; ?>
  679. <?PHP
  680. $iEntry++;
  681. }?>
  682. <br>
  683. </td>
  684. </tr>
  685. </table>
  686. </div>
  687. </div>
  688. </nobr>
  689. &nbsp;&nbsp;&nbsp;</h3>
  690. <?PHP endif; ?>
  691. <?PHP
  692. $pattern = $MAGICJAR3_PATH . DIRECTORY_SEPARATOR . "*";
  693. $aFilePaths = glob($pattern);
  694. if (!empty($aFilePaths)): ?>
  695. <!--<h3 class="board-entry" style="border-radius:3px;font-size: 1.45vw; font-weight:700; float:left; background-color:lightgray; opacity:0.7; margin-right:4px; padding:4px;">
  696. &nbsp;&nbsp;<a id="halMagicpot1" onclick="#" style="cursor:pointer; color: #000000;">Magicpot1</a>&nbsp;&nbsp;
  697. </h3>-->
  698. <h3 class="board-entry" style="font-size: 1.45vw; float:left; color:#000000; background-color:lightgray; opacity:0.7; margin-right:4px; padding:4px; margin-left:3px; margin-right:3px;height: 24px;">
  699. <nobr>
  700. <div class="input-group">
  701. <div class="input-group-btn btn-white dropup">
  702. <a id="halMP1Options" class="btn dropdown-toggle btn-link btn-white" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="font-size: 0.95vw; font-weight:700; top:-9px; cursor:pointer; color: #000000;">MagicPot3</a>
  703. <table class="dropdown-menu cv-options-table bubble" style="background-color: white; left:-6px; margin-bottom: 10px; z-index:99999;">
  704. <tr>
  705. <td class="cv-options-td">
  706. <br>
  707. <?PHP
  708. $iEntry = 1;
  709. foreach ($aFilePaths as $filePath) {
  710. $orifilename = basename($filePath);
  711. $orifileExt = strtolower(pathinfo($orifilename, PATHINFO_EXTENSION));
  712. $filename = explode("|",basename($filePath))[1];
  713. if ($iEntry === count($aFilePaths)) {
  714. $marginbottom = "0px";
  715. } else {
  716. $marginbottom = "5px";
  717. }
  718. ?>
  719. <?PHP if (in_array($orifileExt, ["png", "jpg", "jpeg", "gif", "webp"])):?>
  720. <a id="halMP1Doc<?PHP echo($iEntry);?>" href="/imgj?av=<?PHP echo(AVATAR_NAME);?>&jar=3&fn=<?PHP echo($orifilename);?>" style="cursor:pointer; color: #000000; font-weight:700;margin-right:10px;">
  721. <?PHP else: ?>
  722. <a id="halMP1Doc<?PHP echo($iEntry);?>" href="/file?av=<?PHP echo(AVATAR_NAME);?>&jar=3&fn=<?PHP echo($orifilename);?>" style="cursor:pointer; color: #000000; font-weight:700;margin-right:10px;">
  723. <?PHP endif; ?>
  724. <?PHP echo($filename);?>
  725. </a>
  726. <?PHP if ($iEntry !== count($aFilePaths)): ?>
  727. <br><br>
  728. <?PHP else: ?>
  729. <br>
  730. <?PHP endif; ?>
  731. <?PHP
  732. $iEntry++;
  733. }?>
  734. <br>
  735. </td>
  736. </tr>
  737. </table>
  738. </div>
  739. </div>
  740. </nobr>
  741. &nbsp;&nbsp;&nbsp;</h3>
  742. <?PHP endif; ?>
  743. <?PHP
  744. $pattern = $FRIENDS_PATH . DIRECTORY_SEPARATOR . "*.txt";
  745. $aFilePaths = glob($pattern);
  746. if (!empty($aFilePaths)): ?>
  747. <?PHP
  748. $CUDOZ++;
  749. $iEntry = 1;
  750. foreach ($aFilePaths as $filePath) {
  751. $orifilename = basename($filePath);
  752. $link=file_get_contents($filePath);
  753. $filename = pathinfo($filePath, PATHINFO_FILENAME);
  754. if ($iEntry === count($aFilePaths)) {
  755. $marginbottom = "0px";
  756. } else {
  757. $marginbottom = "5px";
  758. }
  759. ?>
  760. <h3 class="board-entry" style="border-radius:3px;font-size: 1.45vw; font-weight:700; float:left; background-color:lightgray; margin-right:4px; padding:4px;">
  761. &nbsp;&nbsp;<a id="halFriend1" href="<?PHP echo($link);?>" style="cursor:pointer; color: #000000;"><?PHP echo($filename);?></a>&nbsp;&nbsp;
  762. </h3>
  763. <?PHP
  764. $iEntry++;
  765. }?>
  766. <?PHP endif; ?>
  767. <?PHP if (defined("APP_EMAIL_CONTACT") && APP_EMAIL_CONTACT!==PHP_STR): ?>
  768. <h3 class="board-entry" style="border-radius:3px;font-size: 1.45vw; font-weight:700; float:left; background-color:lightgray; margin-right:4px; padding:4px;">
  769. &nbsp;&nbsp;<a id="halContact" href="mailto:<?PHP echo(APP_EMAIL_CONTACT);?>" style="cursor:pointer; color: #000000;"><?PHP echo(APP_EMAIL_CONTACT);?></a>&nbsp;&nbsp;
  770. </h3>
  771. <?PHP Endif; ?>
  772. </div>
  773. </div>
  774. </div>
  775. <div id="passworddisplay">
  776. <br>
  777. &nbsp;&nbsp;<input type="password" id="Password" name="Password" placeholder="password" value="<?php echo($password);?>" autocomplete="off">&nbsp;<input type="submit" value="<?PHP echo(getResource0("Go", $lang));?>" style="text-align:left;width:25%;color:#000000;"><br>
  778. &nbsp;&nbsp;<input type="text" id="Salt" placeholder="salt" autocomplete="off"><br>
  779. <div style="text-align:center;">
  780. <a id="hashMe" href="#" onclick="showEncodedPassword();"><?PHP echo(getResource0("Hash Me", $lang));?>!</a>
  781. </div>
  782. </div>
  783. </form>
  784. <div id="footerCont">&nbsp;</div>
  785. <div id="footer1" style="float:left; width:80px;">
  786. <select id="cbLang" onchange="changeLang(this);">
  787. <option value="en-US" <?PHP echo($lang==PHP_EN?"selected":"");?>>en</option>
  788. <option value="it-IT" <?PHP echo($lang==PHP_IT?"selected":"");?>>it</option>
  789. <option value="zh-CN" <?PHP echo($lang==PHP_CN?"selected":"");?>>cn</option>
  790. </select>
  791. </div>
  792. <div id="footer2" style="float:right; width:450px;">
  793. <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>
  794. </div>
  795. <?PHP endif; ?>
  796. <script src="/js/home-js.php?hl=<?PHP echo($lang);?>&av=<?PHP echo(AVATAR_NAME);?>&cv=<?PHP echo($CURRENT_VIEW);?>&cu=<?PHP echo($CUDOZ);?>" type="text/javascript"></script>
  797. <?PHP if ($CURRENT_VIEW == PUBLIC_VIEW): ?>
  798. <script>
  799. function selectVideo(i) {
  800. y=0;
  801. $(".image").each(function(){
  802. if (y==i) {
  803. if ($("#imageh" + y).height() >= $("#imageh" + y).width()) {
  804. $(this).css("height", parseInt(window.innerHeight));
  805. } else {
  806. $(this).css("height", "");
  807. }
  808. $(this).attr("src", $(this).attr("marti-src"));
  809. if (window.innerWidth <= 900) {
  810. $(this).css("margin-top", "0px");
  811. $(this).css("width", (parseInt(window.innerWidth)/100*75)+"px");
  812. $(this).css("height", (parseInt(window.innerHeight)/100*60)+"px");
  813. } else {
  814. $(this).css("width", (parseInt(window.innerWidth)/100*60)+"px");
  815. }
  816. } else {
  817. $(this).attr("src", "");
  818. }
  819. y++;
  820. });
  821. $("#modalButton" + i).click();
  822. }
  823. </script>
  824. <script>
  825. var bHal = false;
  826. $("span#halTerm").on("click",function(e) {
  827. bHal=!bHal;
  828. if (bHal) {
  829. document.getElementById("hal").src = '/res/hal2_open.png';
  830. $("div#halBoard").show("fast");
  831. } else {
  832. document.getElementById("hal").src = '/res/hal2_closed.png';
  833. $("div#halBoard").hide("slow");
  834. }
  835. });
  836. function setHalPos() {
  837. bodyRect = document.body.getBoundingClientRect();
  838. //document.getElementById('q').write = bodyRect.width;
  839. bHal=false;
  840. document.getElementById("hal").src = '/res/hal2_closed.png';
  841. $("div#halBoard").hide();
  842. if (parseInt(bodyRect.width) < 690) {
  843. $("div#predSys").hide();
  844. $("div#halSys").hide();
  845. } else {
  846. $("div#predSys").show();
  847. $("div#halSys").show();
  848. }
  849. if (parseInt(bodyRect.width) > 1200) {
  850. $("h3.board-entry").css("font-size", "1.0vw");
  851. $("a#halCVOptions").css("font-size", "1.0vw");
  852. $("span#halTerm").css("left", "+11%");
  853. $("div#halBoard").css("left", "+12%");
  854. } else if (parseInt(bodyRect.width) < 800) {
  855. $("h3.board-entry").css("font-size", "14px");
  856. $("a#halCVOptions").css("font-size", "14px");
  857. $("span#halTerm").css("left", "+0%");
  858. $("div#halBoard").css("left", "+0%");
  859. } else {
  860. $("span#halTerm").css("left", "+8%");
  861. $("div#halBoard").css("left", "+9%");
  862. $("h3.board-entry").css("font-size", "1.45vw");
  863. $("a#halCVOptions").css("font-size", "1.45vw");
  864. }
  865. }
  866. window.addEventListener("load", function() {
  867. setTimeout("setHalPos()", 100);
  868. }, true);
  869. window.addEventListener("resize", function() {
  870. setTimeout("setHalPos()", 100);
  871. }, true);
  872. </script>
  873. <script>
  874. function setContentPos() {
  875. h = window.innerHeight;
  876. w = window.innerWidth;
  877. pich = parseInt((h - $(".header").height() - 80) / 3);
  878. // picw = parseInt(w / 5); ori
  879. iimg = parseInt(<?PHP echo($MAXP / 3); ?>);
  880. if ((<?PHP echo($MAXP / 3); ?>) > parseInt(<?PHP echo($MAXP / 3); ?>)) {
  881. iimg++;
  882. }
  883. picw = parseInt(w / iimg);
  884. $(".blog-content").css("height", pich + "px");
  885. $(".blog-content").css("width", picw + "px");
  886. $(".blog-entry").css("height", (pich-2) + "px");
  887. $(".blog-entry").css("width", (picw-2) + "px");
  888. if (window.innerWidth < 650) {
  889. $(".blog-img").css("height", ((pich-4)-80) + "px");
  890. $(".blog-img").css("width", (((picw-4)/3)-80) + "px");
  891. } else {
  892. $(".blog-img").css("height", (pich-4) + "px");
  893. $(".blog-img").css("width", ((picw-4)/3) + "px");
  894. }
  895. // ---
  896. $("#passworddisplay").css("top", parseInt(h-$("#passworddisplay").height()-100)+"px");
  897. }
  898. window.addEventListener("load", function() {
  899. setTimeout("setContentPos()", 1000);
  900. });
  901. window.addEventListener("resize", function() {
  902. setTimeout("setContentPos()", 1000);
  903. });
  904. </script>
  905. <script>
  906. var iSlide;
  907. var ii;
  908. function showSlide() {
  909. $(".modal").click();
  910. selectVideo(iSlide);
  911. if (iSlide<<?PHP echo($totLinks);?>) {
  912. iSlide++;
  913. } else {
  914. clearInterval(ii);
  915. $(".modal").click();
  916. }
  917. }
  918. function slideShow() {
  919. iSlide = 0;
  920. ii = setInterval(showSlide,3700);
  921. }
  922. </script>
  923. <!-- DEPICT -->
  924. <?php if (is_readable($AVATAR_PATH . DIRECTORY_SEPARATOR . "depict.html")): ?>
  925. <?php include($AVATAR_PATH . DIRECTORY_SEPARATOR . "depict.html"); ?>
  926. <?php else: ?>
  927. <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "depict.html")): ?>
  928. <?php include(APP_PATH . DIRECTORY_SEPARATOR . "depict.html"); ?>
  929. <?php endif; ?>
  930. <?php endif; ?>
  931. <!-- SKINNER CODE -->
  932. <?php if (is_readable($AVATAR_PATH . DIRECTORY_SEPARATOR . "skinner.html")): ?>
  933. <?php include($AVATAR_PATH . DIRECTORY_SEPARATOR . "skinner.html"); ?>
  934. <?php else: ?>
  935. <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "skinner.html")): ?>
  936. <?php include(APP_PATH . DIRECTORY_SEPARATOR . "skinner.html"); ?>
  937. <?php endif; ?>
  938. <?php endif; ?>
  939. <!-- METRICS CODE -->
  940. <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "metrics.html")): ?>
  941. <?php include(APP_PATH . DIRECTORY_SEPARATOR . "metrics.html"); ?>
  942. <?php endif; ?>
  943. <?php endif; ?>
  944. </body>
  945. </html>