home.php 44 KB

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