home.php 44 KB

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