home.php 42 KB

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