home.php 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  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 <= 850) {
  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="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. <!--<div id="AFHint">
  384. <button type="button" class="close" aria-label="Close" onclick="closeMe(this);" style="position:relative; top:5px; left:-7px;">
  385. <span aria-hidden="true" style="color:black; font-weight:900;">&times;</span>
  386. </button>
  387. <br>
  388. <span onclick="showHowTo();"><?PHP echo(getResource0("How-to: Manage your avatars in Puzzleu", $lang));?></span>
  389. <br><br>
  390. </div> -->
  391. <div id="header" class="header" style="margin-top:18px;margin-bottom:18px;">
  392. <div style="float:left">
  393. <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>
  394. </div>
  395. <div style="float:right; position:relative; top:-10px;margin-right:300px;">
  396. <a href="#" onclick="slideShow();"><img src="/res/playicon.png" style="width:45px;"></a>
  397. </div>
  398. </div>
  399. <div id="headerMob" class="header" style="margin-top:18px;margin-bottom:18px;display:none">
  400. <div style="float:left">
  401. <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>
  402. </div>
  403. </div>
  404. <form id="frmUpload" role="form" method="post" action="/<?PHP echo(AVATAR_NAME);?>?hl=<?PHP echo($lang);?>" target="_self" enctype="multipart/form-data">
  405. <div id="blog">
  406. <?PHP
  407. $iEntry = 2;
  408. $totLinks = 0;
  409. $aLinks=[];
  410. $pattern = $BLOG_PATH . DIRECTORY_SEPARATOR . "*";
  411. $aFilePaths = glob($pattern);
  412. if (empty($aFilePaths)): ?>
  413. <div class="blog-content">
  414. <div class="blog-entry" style="background:url('/res/img.png');background-size:100% 100%;">
  415. &nbsp;
  416. </div>
  417. </div>
  418. <?PHP else: ?>
  419. <?PHP
  420. $CUDOZ++;
  421. $iEntry = 1;
  422. $iCurEntry = 1;
  423. arsort($aFilePaths, SORT_STRING);
  424. $totPost = count($aFilePaths);
  425. // PAGINATION
  426. $totPages = (int)(count($aFilePaths)/$MAXP);
  427. if ($totPages < (count($aFilePaths)/$MAXP)) {
  428. $totPages++;
  429. }
  430. $firstPost = 0;
  431. $prevPost = $blogSP - $MAXP;
  432. if ($prevPost < 0) {
  433. $prevPost = 0;
  434. }
  435. $nextPost = $blogSP + $MAXP;
  436. if ($nextPost > (($totPages - 1) * $MAXP)) {
  437. $nextPost = (($totPages - 1) * $MAXP);
  438. }
  439. if ($nextPost < 0) {
  440. $nextPost = 0;
  441. }
  442. $lastPost = (($totPages - 1) * $MAXP);
  443. if ($lastPost < 0) {
  444. $lastPost = 0;
  445. }
  446. // ---
  447. //echo("blogSP=".$blogSP);
  448. foreach ($aFilePaths as $filePath) {
  449. //echo("iCurEntry=".$iCurEntry);
  450. if ($iCurEntry<($blogSP+1)) {
  451. $iCurEntry++;
  452. continue;
  453. }
  454. if (($iEntry>$MAXP) || (!APP_PAGINATION && $iCurEntry>APP_BLOG_MAX_POSTS)) {
  455. break;
  456. }
  457. $orifilename = basename($filePath);
  458. $orifileExt = strtolower(pathinfo($orifilename, PATHINFO_EXTENSION));
  459. $date = explode("-",$orifilename)[0];
  460. $time = explode("-",$orifilename)[1];
  461. $time = left($time,2) . ":" . substr($time,2,2);
  462. if ($iEntry === count($aFilePaths) || $iEntry==$MAXP) {
  463. $marginbottom = "0px";
  464. } else {
  465. $marginbottom = "5px";
  466. }
  467. ?>
  468. <?PHP if (in_array($orifileExt, ["png", "jpg", "jpeg", "gif", "webp"])):?>
  469. <div class="blog-content">
  470. <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%;">
  471. <?PHP if (APP_PAGINATION || (APP_BLOG_MAX_POSTS===0 || APP_BLOG_MAX_POSTS>$iCurEntry)): ?>
  472. <?php if ($iCurEntry===1 && $iEntry===1): ?>
  473. <!--<img class="blog-img" src="/res/arrow-leftd.png" style="float:left;">-->
  474. <?php elseif ($iEntry===1 && $iCurEntry>1): ?>
  475. <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>
  476. <?php endif; ?>
  477. <?php if ($iEntry===$MAXP && $iCurEntry===$totPost): ?>
  478. <!--<img class="blog-img" src="/res/arrow-rightd.png" style="float:right;">-->
  479. <?php elseif ($iEntry===$MAXP): ?>
  480. <?PHP if ($MAXP===APP_BLOG_ULTRATHIN_MAX_POSTS): ?>
  481. <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>
  482. <?PHP elseif ($MAXP===APP_BLOG_THIN_MAX_POSTS): ?>
  483. <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>
  484. <?PHP else: ?>
  485. <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>
  486. <?php endif; ?>
  487. <?php endif; ?>
  488. <?PHP else: ?>
  489. &nbsp;
  490. <?PHP endif; ?>
  491. </div>
  492. </div>
  493. <?PHP $aLinks[] = "/img?av=" . AVATAR_NAME . "&pic=" . $orifilename; ?>
  494. <?PHP EndIf; ?>
  495. <?PHP
  496. $totLinks = $iEntry;
  497. $iEntry++;
  498. $iCurEntry++;
  499. }?>
  500. <?PHP endif; ?>
  501. <?PHP for($i=$iEntry;$i<=$MAXP;$i++):?>
  502. <div class="blog-content">
  503. <div class="blog-entry" style="border:0px;background:darkgray;">
  504. &nbsp;
  505. </div>
  506. </div>
  507. <?PHP endfor; ?>
  508. <?PHP if (($MAXP / 3) > (int)($MAXP / 3)): ?>
  509. <div class="blog-content">
  510. <div class="blog-entry" style="border:0px;background:darkgray;">
  511. &nbsp;
  512. </div>
  513. </div>
  514. <?PHP if ((($MAXP+1) / 3) > (int)(($MAXP+1) / 3)): ?>
  515. <div class="blog-content">
  516. <div class="blog-entry" style="border:0px;background:darkgray;">
  517. &nbsp;
  518. </div>
  519. </div>
  520. <?PHP endif; ?>
  521. <?PHP endif; ?>
  522. <br><br>
  523. </div>
  524. <?php
  525. $iLink = 0;
  526. foreach($aLinks as $aLink) { ?>
  527. <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>
  528. <div class="modal" tabindex="-1" role="dialog" id="modal<?php echo($iLink);?>" style="z-index:99997">
  529. <div class="modal-dialog modal-lg" role="document" style="width:95%;margin-top:0;background-color:#FFFFFF;z-index:99998">
  530. <div class="modal-content" style="float:left;width: content-box;max-width:60%;z-index:99999;">
  531. <img id="imageh<?PHP echo($iLink);?>" class="imageh" src="<?php echo($aLink); ?>" style="display:none">
  532. <img id="image<?PHP echo($iLink);?>" class="image" src="" marti-src="<?php echo($aLink); ?>" style="width:100%;vertical-align:middle;">
  533. </div>
  534. <!--
  535. <div class="modal-toolbox" style="float:right;">
  536. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  537. </div> -->
  538. </div>
  539. </div>
  540. <?php $iLink++; ?>
  541. <?php } ?>
  542. <?PHP
  543. // GALLERY GHOST
  544. $CUDOZ++;
  545. ?>
  546. <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;">
  547. <div class="input-group-btn" style="border: 0px solid red;">
  548. <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>
  549. <div id="halBoard" style="float: left; position:relative; left:+5%; top: +2px; display: none;">
  550. <?PHP
  551. $pattern = $CV_PATH . DIRECTORY_SEPARATOR . "*";
  552. $aFilePaths = glob($pattern);
  553. if (!empty($aFilePaths)): ?>
  554. <?PHP $CUDOZ++; ?>
  555. <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;">
  556. <nobr>
  557. <div class="input-group">
  558. <div class="input-group-btn btn-white dropup">
  559. <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>
  560. <table class="dropdown-menu cv-options-table bubble" style="background-color: white; left:-6px; margin-bottom: 10px; z-index:99999;">
  561. <tr>
  562. <td class="cv-options-td">
  563. <br>
  564. <?PHP
  565. $pattern = $CV_PATH . DIRECTORY_SEPARATOR . "*.doc";
  566. $aFilePaths = glob($pattern);
  567. if (!empty($aFilePaths)): ?>
  568. <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>
  569. <?PHP endif; ?>
  570. <?PHP
  571. $pattern = $CV_PATH . DIRECTORY_SEPARATOR . "*.pdf";
  572. $aFilePaths = glob($pattern);
  573. if (!empty($aFilePaths)): ?>
  574. <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>
  575. <?PHP endif; ?>
  576. </td>
  577. </tr>
  578. </table>
  579. </div>
  580. </div>
  581. </nobr>
  582. &nbsp;&nbsp; &nbsp;</h3>
  583. <?PHP endif; ?>
  584. <?PHP
  585. $pattern = $MAGICJAR1_PATH . DIRECTORY_SEPARATOR . "*";
  586. $aFilePaths = glob($pattern);
  587. if (!empty($aFilePaths)): ?>
  588. <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;">
  589. <nobr>
  590. <div class="input-group">
  591. <div class="input-group-btn btn-white dropup">
  592. <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>
  593. <table class="dropdown-menu cv-options-table bubble" style="background-color: white; left:-6px; margin-bottom: 10px; z-index:99999;">
  594. <tr>
  595. <td class="cv-options-td">
  596. <br>
  597. <?PHP
  598. $iEntry = 1;
  599. foreach ($aFilePaths as $filePath) {
  600. $orifilename = basename($filePath);
  601. $orifileExt = strtolower(pathinfo($orifilename, PATHINFO_EXTENSION));
  602. $filename = explode("|",basename($filePath))[1];
  603. if ($iEntry === count($aFilePaths)) {
  604. $marginbottom = "0px";
  605. } else {
  606. $marginbottom = "5px";
  607. }
  608. ?>
  609. <?PHP if (in_array($orifileExt, ["png", "jpg", "jpeg", "gif", "webp"])):?>
  610. <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;">
  611. <?PHP else: ?>
  612. <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;">
  613. <?PHP endif; ?>
  614. <?PHP echo($filename);?>
  615. </a>
  616. <?PHP if ($iEntry !== count($aFilePaths)): ?>
  617. <br><br>
  618. <?PHP else: ?>
  619. <br>
  620. <?PHP endif; ?>
  621. <?PHP
  622. $iEntry++;
  623. }?>
  624. <br>
  625. </td>
  626. </tr>
  627. </table>
  628. </div>
  629. </div>
  630. </nobr>
  631. &nbsp;&nbsp;&nbsp;</h3>
  632. <?PHP endif; ?>
  633. <?PHP
  634. $pattern = $MAGICJAR2_PATH . DIRECTORY_SEPARATOR . "*";
  635. $aFilePaths = glob($pattern);
  636. if (!empty($aFilePaths)): ?>
  637. <!--<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;">
  638. &nbsp;&nbsp;<a id="halMagicpot1" onclick="#" style="cursor:pointer; color: #000000;">Magicpot1</a>&nbsp;&nbsp;
  639. </h3>-->
  640. <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;">
  641. <nobr>
  642. <div class="input-group">
  643. <div class="input-group-btn btn-white dropup">
  644. <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>
  645. <table class="dropdown-menu cv-options-table bubble" style="background-color: white; left:-6px; margin-bottom: 10px; z-index:99999;">
  646. <tr>
  647. <td class="cv-options-td">
  648. <br>
  649. <?PHP
  650. $iEntry = 1;
  651. foreach ($aFilePaths as $filePath) {
  652. $orifilename = basename($filePath);
  653. $orifileExt = strtolower(pathinfo($orifilename, PATHINFO_EXTENSION));
  654. $filename = explode("|",basename($filePath))[1];
  655. if ($iEntry === count($aFilePaths)) {
  656. $marginbottom = "0px";
  657. } else {
  658. $marginbottom = "5px";
  659. }
  660. ?>
  661. <?PHP if (in_array($orifileExt, ["png", "jpg", "jpeg", "gif", "webp"])):?>
  662. <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;">
  663. <?PHP else: ?>
  664. <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;">
  665. <?PHP endif; ?>
  666. <?PHP echo($filename);?>
  667. </a>
  668. <?PHP if ($iEntry !== count($aFilePaths)): ?>
  669. <br><br>
  670. <?PHP else: ?>
  671. <br>
  672. <?PHP endif; ?>
  673. <?PHP
  674. $iEntry++;
  675. }?>
  676. <br>
  677. </td>
  678. </tr>
  679. </table>
  680. </div>
  681. </div>
  682. </nobr>
  683. &nbsp;&nbsp;&nbsp;</h3>
  684. <?PHP endif; ?>
  685. <?PHP
  686. $pattern = $MAGICJAR3_PATH . DIRECTORY_SEPARATOR . "*";
  687. $aFilePaths = glob($pattern);
  688. if (!empty($aFilePaths)): ?>
  689. <!--<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;">
  690. &nbsp;&nbsp;<a id="halMagicpot1" onclick="#" style="cursor:pointer; color: #000000;">Magicpot1</a>&nbsp;&nbsp;
  691. </h3>-->
  692. <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;">
  693. <nobr>
  694. <div class="input-group">
  695. <div class="input-group-btn btn-white dropup">
  696. <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>
  697. <table class="dropdown-menu cv-options-table bubble" style="background-color: white; left:-6px; margin-bottom: 10px; z-index:99999;">
  698. <tr>
  699. <td class="cv-options-td">
  700. <br>
  701. <?PHP
  702. $iEntry = 1;
  703. foreach ($aFilePaths as $filePath) {
  704. $orifilename = basename($filePath);
  705. $orifileExt = strtolower(pathinfo($orifilename, PATHINFO_EXTENSION));
  706. $filename = explode("|",basename($filePath))[1];
  707. if ($iEntry === count($aFilePaths)) {
  708. $marginbottom = "0px";
  709. } else {
  710. $marginbottom = "5px";
  711. }
  712. ?>
  713. <?PHP if (in_array($orifileExt, ["png", "jpg", "jpeg", "gif", "webp"])):?>
  714. <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;">
  715. <?PHP else: ?>
  716. <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;">
  717. <?PHP endif; ?>
  718. <?PHP echo($filename);?>
  719. </a>
  720. <?PHP if ($iEntry !== count($aFilePaths)): ?>
  721. <br><br>
  722. <?PHP else: ?>
  723. <br>
  724. <?PHP endif; ?>
  725. <?PHP
  726. $iEntry++;
  727. }?>
  728. <br>
  729. </td>
  730. </tr>
  731. </table>
  732. </div>
  733. </div>
  734. </nobr>
  735. &nbsp;&nbsp;&nbsp;</h3>
  736. <?PHP endif; ?>
  737. <?PHP
  738. $pattern = $FRIENDS_PATH . DIRECTORY_SEPARATOR . "*.txt";
  739. $aFilePaths = glob($pattern);
  740. if (!empty($aFilePaths)): ?>
  741. <?PHP
  742. $CUDOZ++;
  743. $iEntry = 1;
  744. foreach ($aFilePaths as $filePath) {
  745. $orifilename = basename($filePath);
  746. $link=file_get_contents($filePath);
  747. $filename = pathinfo($filePath, PATHINFO_FILENAME);
  748. if ($iEntry === count($aFilePaths)) {
  749. $marginbottom = "0px";
  750. } else {
  751. $marginbottom = "5px";
  752. }
  753. ?>
  754. <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;">
  755. &nbsp;&nbsp;<a id="halFriend1" href="<?PHP echo($link);?>" style="cursor:pointer; color: #000000;"><?PHP echo($filename);?></a>&nbsp;&nbsp;
  756. </h3>
  757. <?PHP
  758. $iEntry++;
  759. }?>
  760. <?PHP endif; ?>
  761. <?PHP if (defined("APP_EMAIL_CONTACT") && APP_EMAIL_CONTACT!==PHP_STR): ?>
  762. <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;">
  763. &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;
  764. </h3>
  765. <?PHP Endif; ?>
  766. </div>
  767. </div>
  768. </div>
  769. <div id="passworddisplay">
  770. <br>
  771. &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>
  772. &nbsp;&nbsp;<input type="text" id="Salt" placeholder="salt" autocomplete="off"><br>
  773. <div style="text-align:center;">
  774. <a id="hashMe" href="#" onclick="showEncodedPassword();"><?PHP echo(getResource0("Hash Me", $lang));?>!</a>
  775. </div>
  776. </div>
  777. </form>
  778. <div id="footerCont">&nbsp;</div>
  779. <div id="footer1" style="float:left; width:80px;">
  780. <select id="cbLang" onchange="changeLang(this);">
  781. <option value="en-US" <?PHP echo($lang==PHP_EN?"selected":"");?>>en</option>
  782. <option value="it-IT" <?PHP echo($lang==PHP_IT?"selected":"");?>>it</option>
  783. <option value="zh-CN" <?PHP echo($lang==PHP_CN?"selected":"");?>>cn</option>
  784. </select>
  785. </div>
  786. <div id="footer2" style="float:right; width:450px;">
  787. <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>
  788. </div>
  789. <?PHP endif; ?>
  790. <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>
  791. <?PHP if ($CURRENT_VIEW == PUBLIC_VIEW): ?>
  792. <script>
  793. function selectVideo(i) {
  794. //alert(3);
  795. y=0;
  796. $(".image").each(function(){
  797. if (y==i) {
  798. if ($("#imageh" + y).height() >= $("#imageh" + y).width()) {
  799. $(this).css("height", parseInt(window.innerHeight));
  800. } else {
  801. $(this).css("height", "");
  802. }
  803. $(this).attr("src", $(this).attr("marti-src"));
  804. } else {
  805. $(this).attr("src", "");
  806. }
  807. y++;
  808. });
  809. //alert(i);
  810. //alert($('#iframe' + i).attr("id"));
  811. //$("#iframe"+i).attr("src", $("#iframe"+i).attr("marti-src") );
  812. $("#modalButton" + i).click();
  813. }
  814. </script>
  815. <script>
  816. var bHal = false;
  817. $("span#halTerm").on("click",function(e) {
  818. bHal=!bHal;
  819. if (bHal) {
  820. document.getElementById("hal").src = '/res/hal2_open.png';
  821. $("div#halBoard").show("fast");
  822. } else {
  823. document.getElementById("hal").src = '/res/hal2_closed.png';
  824. $("div#halBoard").hide("slow");
  825. }
  826. });
  827. function setHalPos() {
  828. bodyRect = document.body.getBoundingClientRect();
  829. //document.getElementById('q').write = bodyRect.width;
  830. bHal=false;
  831. document.getElementById("hal").src = '/res/hal2_closed.png';
  832. $("div#halBoard").hide();
  833. if (parseInt(bodyRect.width) < 690) {
  834. $("div#predSys").hide();
  835. $("div#halSys").hide();
  836. } else {
  837. $("div#predSys").show();
  838. $("div#halSys").show();
  839. }
  840. if (parseInt(bodyRect.width) > 1200) {
  841. $("h3.board-entry").css("font-size", "1.0vw");
  842. $("a#halCVOptions").css("font-size", "1.0vw");
  843. $("span#halTerm").css("left", "+11%");
  844. $("div#halBoard").css("left", "+12%");
  845. } else if (parseInt(bodyRect.width) < 800) {
  846. $("h3.board-entry").css("font-size", "14px");
  847. $("a#halCVOptions").css("font-size", "14px");
  848. $("span#halTerm").css("left", "+0%");
  849. $("div#halBoard").css("left", "+0%");
  850. } else {
  851. $("span#halTerm").css("left", "+8%");
  852. $("div#halBoard").css("left", "+9%");
  853. $("h3.board-entry").css("font-size", "1.45vw");
  854. $("a#halCVOptions").css("font-size", "1.45vw");
  855. }
  856. }
  857. window.addEventListener("load", function() {
  858. setTimeout("setHalPos()", 100);
  859. }, true);
  860. window.addEventListener("resize", function() {
  861. setTimeout("setHalPos()", 100);
  862. }, true);
  863. </script>
  864. <script>
  865. function setContentPos() {
  866. h = window.innerHeight;
  867. w = window.innerWidth;
  868. pich = parseInt((h - $(".header").height() - 80) / 3);
  869. // picw = parseInt(w / 5); ori
  870. iimg = parseInt(<?PHP echo($MAXP / 3); ?>);
  871. if ((<?PHP echo($MAXP / 3); ?>) > parseInt(<?PHP echo($MAXP / 3); ?>)) {
  872. iimg++;
  873. }
  874. picw = parseInt(w / iimg);
  875. $(".blog-content").css("height", pich + "px");
  876. $(".blog-content").css("width", picw + "px");
  877. $(".blog-entry").css("height", (pich-2) + "px");
  878. $(".blog-entry").css("width", (picw-2) + "px");
  879. $(".blog-img").css("height", (pich-4) + "px");
  880. $(".blog-img").css("width", ((picw-4)/3) + "px");
  881. // ---
  882. $("#passworddisplay").css("top", parseInt(h-$("#passworddisplay").height()-100)+"px");
  883. }
  884. window.addEventListener("load", function() {
  885. setTimeout("setContentPos()", 1000);
  886. });
  887. window.addEventListener("resize", function() {
  888. setTimeout("setContentPos()", 1000);
  889. });
  890. </script>
  891. <script>
  892. var iSlide;
  893. var ii;
  894. function showSlide() {
  895. $(".modal").click();
  896. selectVideo(iSlide);
  897. if (iSlide<<?PHP echo($totLinks);?>) {
  898. iSlide++;
  899. } else {
  900. clearInterval(ii);
  901. $(".modal").click();
  902. }
  903. }
  904. function slideShow() {
  905. iSlide = 0;
  906. ii = setInterval(showSlide,3700);
  907. }
  908. </script>
  909. <!-- SKINNER CODE -->
  910. <?php if (is_readable($AVATAR_PATH . DIRECTORY_SEPARATOR . "skinner.html")): ?>
  911. <?php include($AVATAR_PATH . DIRECTORY_SEPARATOR . "skinner.html"); ?>
  912. <?php else: ?>
  913. <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "skinner.html")): ?>
  914. <?php include(APP_PATH . DIRECTORY_SEPARATOR . "skinner.html"); ?>
  915. <?php endif; ?>
  916. <?php endif; ?>
  917. <!-- METRICS CODE -->
  918. <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "metrics.html")): ?>
  919. <?php include(APP_PATH . DIRECTORY_SEPARATOR . "metrics.html"); ?>
  920. <?php endif; ?>
  921. <?php endif; ?>
  922. </body>
  923. </html>