home.php 41 KB

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