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