home.php 48 KB

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