home.php 45 KB

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