home.php 44 KB

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