home.php 46 KB

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