home.php 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. <?php
  2. /**
  3. * Copyright 2021, 2024 5 Mode
  4. *
  5. * This file is part of Avatar Free.
  6. *
  7. * Avatar Free 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. * Avatar Free 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 Avatar Free. If not, see <https://www.gnu.org/licenses/>.
  19. *
  20. * home.php
  21. *
  22. * Home of Avatar Free.
  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(filter_input(INPUT_GET, "hl", FILTER_SANITIZE_STRING), 0, 5);
  42. if ($lang1 !== PHP_STR) {
  43. $lang = $lang1;
  44. }
  45. $shortLang = getShortLang($lang);
  46. $password = filter_input(INPUT_POST, "Password");
  47. if ($password !== PHP_STR) {
  48. $hash = hash("sha256", $password . APP_SALT, false);
  49. if ($hash !== APP_HASH) {
  50. $password=PHP_STR;
  51. }
  52. }
  53. if ($password !== PHP_STR) {
  54. $CURRENT_VIEW = ADMIN_VIEW;
  55. } else {
  56. $CURRENT_VIEW = PUBLIC_VIEW;
  57. }
  58. $magicJar1 = (int)substr(filter_input(INPUT_POST, "txtMagicJar1"), 0, 1);
  59. $magicJar2 = (int)substr(filter_input(INPUT_POST, "txtMagicJar2"), 0, 1);
  60. $magicJar3 = (int)substr(filter_input(INPUT_POST, "txtMagicJar3"), 0, 1);
  61. function uploadNewRes() {
  62. global $AVATAR_PATH;
  63. global $CV_PATH;
  64. global $FRIENDS_PATH;
  65. global $BLOG_PATH;
  66. global $GALLERY_PATH;
  67. global $MAGICJAR1_PATH;
  68. global $MAGICJAR2_PATH;
  69. global $MAGICJAR3_PATH;
  70. global $magicJar1;
  71. global $magicJar2;
  72. global $magicJar3;
  73. //echo_ifdebug(true, "AVATAR_PATH#1=");
  74. //echo_ifdebug(true, $AVATAR_PATH);
  75. //if (!empty($_FILES['files'])) {
  76. if (!empty($_FILES['filesdd']['tmp_name'][0])) {
  77. //no file uploaded
  78. //$uploads = (array)fixMultipleFileUpload($_FILES['files']);
  79. //if ($uploads[0]['error'] === UPLOAD_ERR_NO_FILE) {
  80. $uploads = (array)fixMultipleFileUpload($_FILES['filesdd']);
  81. //}
  82. //if ($uploads[0]['error'] === PHP_UPLOAD_ERR_NO_FILE) {
  83. // echo("WARNING: No file uploaded.");
  84. // return;
  85. //}
  86. $google = "abcdefghijklmnopqrstuvwxyz";
  87. if (count($uploads)>strlen($google)) {
  88. echo("WARNING: Too many uploaded files.");
  89. return;
  90. }
  91. $i=1;
  92. foreach($uploads as &$upload) {
  93. switch ($upload['error']) {
  94. case PHP_UPLOAD_ERR_OK:
  95. break;
  96. case PHP_UPLOAD_ERR_NO_FILE:
  97. echo("WARNING: One or more uploaded files are missing.");
  98. return;
  99. case PHP_UPLOAD_ERR_INI_SIZE:
  100. echo("WARNING: File exceeded INI size limit.");
  101. return;
  102. case PHP_UPLOAD_ERR_FORM_SIZE:
  103. echo("WARNING: File exceeded form size limit.");
  104. return;
  105. case PHP_UPLOAD_ERR_PARTIAL:
  106. echo("WARNING: File only partially uploaded.");
  107. return;
  108. case PHP_UPLOAD_ERR_NO_TMP_DIR:
  109. echo("WARNING: TMP dir doesn't exist.");
  110. return;
  111. case PHP_UPLOAD_ERR_CANT_WRITE:
  112. echo("WARNING: Failed to write to the disk.");
  113. return;
  114. case PHP_UPLOAD_ERR_EXTENSION:
  115. echo("WARNING: A PHP extension stopped the file upload.");
  116. return;
  117. default:
  118. echo("WARNING: Unexpected error happened.");
  119. return;
  120. }
  121. if (!is_uploaded_file($upload['tmp_name'])) {
  122. echo("WARNING: One or more file have not been uploaded.");
  123. return;
  124. }
  125. // name
  126. $name = (string)substr((string)filter_var($upload['name']), 0, 255);
  127. if ($name == PHP_STR) {
  128. echo("WARNING: Invalid file name: " . $name);
  129. return;
  130. }
  131. $upload['name'] = $name;
  132. // fileType
  133. $fileType = substr((string)filter_var($upload['type']), 0, 30);
  134. $upload['type'] = $fileType;
  135. // tmp_name
  136. $tmp_name = substr((string)filter_var($upload['tmp_name']), 0, 300);
  137. if ($tmp_name == PHP_STR || !file_exists($tmp_name)) {
  138. echo("WARNING: Invalid file temp path: " . $tmp_name);
  139. return;
  140. }
  141. $upload['tmp_name'] = $tmp_name;
  142. //size
  143. $size = substr((string)filter_var($upload['size'], FILTER_SANITIZE_NUMBER_INT), 0, 12);
  144. if ($size == "") {
  145. echo("WARNING: Invalid file size.");
  146. return;
  147. }
  148. $upload["size"] = $size;
  149. $tmpFullPath = $upload["tmp_name"];
  150. $originalFilename = pathinfo($name, PATHINFO_FILENAME);
  151. $originalFileExt = pathinfo($name, PATHINFO_EXTENSION);
  152. $fileExt = strtolower(pathinfo($name, PATHINFO_EXTENSION));
  153. $date = date("Ymd-His");
  154. $rnd = mt_rand(1000000000, 9999999999);
  155. if ($originalFileExt!==PHP_STR) {
  156. $destFileName = $date . "-" . $rnd . substr($google, $i-1, 1) . "|" . str_replace(" ", "_", $originalFilename) . ".$fileExt";
  157. } else {
  158. return;
  159. }
  160. //$CV_PATH = APP_DATA_PATH . DIRECTORY_SEPARATOR . "cv";
  161. //$FRIENDS_PATH = APP_DATA_PATH . DIRECTORY_SEPARATOR . "friends";
  162. //$BLOG_PATH = APP_DATA_PATH . DIRECTORY_SEPARATOR . "blog";
  163. //$GALLERY_PATH = APP_DATA_PATH . DIRECTORY_SEPARATOR . "gallery";
  164. $destPaths = [];
  165. $destFullPaths = [];
  166. if ($magicJar1 != 0) {
  167. $destPaths[] = $MAGICJAR1_PATH;
  168. $destFullPaths[] = $destPaths[count($destPaths)-1] . DIRECTORY_SEPARATOR . $destFileName;
  169. }
  170. if ($magicJar2 != 0) {
  171. $destPaths[] = $MAGICJAR2_PATH;
  172. $destFullPaths[] = $destPaths[count($destPaths)-1] . DIRECTORY_SEPARATOR . $destFileName;
  173. }
  174. if ($magicJar3 != 0) {
  175. $destPaths[] = $MAGICJAR3_PATH;
  176. $destFullPaths[] = $destPaths[count($destPaths)-1] . DIRECTORY_SEPARATOR . $destFileName;
  177. }
  178. if (empty($destPaths)) {
  179. switch ($fileExt) {
  180. case "doc":
  181. case "docx":
  182. case "pdf":
  183. $destPaths[] = $CV_PATH;
  184. break;
  185. case "txt":
  186. $destPaths[] = $BLOG_PATH;
  187. break;
  188. case "png":
  189. case "jpg":
  190. case "jpeg":
  191. case "gif":
  192. case "webp":
  193. $destPaths[] = $GALLERY_PATH;
  194. break;
  195. default:
  196. $destPaths[] = $MAGICJAR1_PATH;
  197. break;
  198. }
  199. $destFullPaths[] = $destPaths[0] . DIRECTORY_SEPARATOR . $destFileName;
  200. }
  201. $iPath = 0;
  202. foreach($destFullPaths as $destFullPath) {
  203. if (file_exists($destFullPath)) {
  204. echo("WARNING: destination already exists");
  205. exit(1);
  206. }
  207. if (filesize($tmpFullPath) > APP_FILE_MAX_SIZE) {
  208. echo("ERROR: file size(" . filesize($tmpFullPath) . ") exceeds app limit:" . APP_FILE_MAX_SIZE);
  209. exit(1);
  210. }
  211. if (!is_readable($AVATAR_PATH)) {
  212. mkdir($AVATAR_PATH, 0777);
  213. }
  214. if (!is_readable($destPaths[$iPath])) {
  215. mkdir($destPaths[$iPath], 0777);
  216. }
  217. $pattern = $destPaths[$iPath] . DIRECTORY_SEPARATOR . "*" . "|" . str_replace(" ", "_", $originalFilename) . ".$fileExt";
  218. $aExistingPaths = glob($pattern);
  219. if (!empty($aExistingPaths)) {
  220. continue;
  221. }
  222. copy($tmpFullPath, $destFullPath);
  223. $iPath++;
  224. }
  225. // Cleaning up..
  226. // Delete the tmp file..
  227. unlink($tmpFullPath);
  228. $i++;
  229. }
  230. }
  231. }
  232. function writeFriends() {
  233. global $FRIENDS_PATH;
  234. $destPath = $FRIENDS_PATH;
  235. $s = filter_input(INPUT_POST, "f", FILTER_SANITIZE_STRING);
  236. if ($s != PHP_STR) {
  237. //echo($s);
  238. //exit(0);
  239. $friends=explode("|", $s);
  240. if (!is_readable($destPath)) {
  241. mkdir($destPath, 0777);
  242. }
  243. foreach($friends as $friend) {
  244. $a = explode("://",$friend);
  245. $s = $a[1];
  246. $a = explode("/", $s);
  247. $friendName = $a[0] . ".txt";
  248. file_put_contents($destPath . DIRECTORY_SEPARATOR . $friendName, $friend);
  249. }
  250. }
  251. }
  252. function grabProfileImage() {
  253. global $GALLERY_PATH;
  254. $pattern = $GALLERY_PATH . DIRECTORY_SEPARATOR . "*";
  255. $aImagePaths = glob($pattern);
  256. if (isset($aImagePaths[0])) {
  257. $retval = basename($aImagePaths[0]);
  258. } else {
  259. $retval = null;
  260. }
  261. return $retval;
  262. }
  263. function startApp() {
  264. global $CURRENT_VIEW;
  265. global $profilePic;
  266. if ($CURRENT_VIEW == ADMIN_VIEW) {
  267. uploadNewRes();
  268. writeFriends();
  269. }
  270. $profilePic = grabProfileImage() ?? APP_DEF_PROFILE_PIC;
  271. //echo("profile pic=" . $profilePic);
  272. }
  273. startApp();
  274. ?>
  275. <!DOCTYPE html>
  276. <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
  277. <head>
  278. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  279. <!--<?PHP echo(APP_LICENSE);?>-->
  280. <title>Avatar Free: everyone its social presence.</title>
  281. <link rel="shortcut icon" href="/favicon.ico" />
  282. <meta name="description" content="Welcome to Avatar Free! Let everyone have its social presence."/>
  283. <meta name="keywords" content="Avatar Free,social,presence,avatarfree.org,on,premise,solution"/>
  284. <meta name="robots" content="index,follow"/>
  285. <meta name="author" content="5 Mode"/>
  286. <script src="/js/jquery-3.6.0.min.js" type="text/javascript"></script>
  287. <script src="/js/sha.js" type="text/javascript"></script>
  288. <script src="/js/common.js" type="text/javascript"></script>
  289. <link href="/css/style.css?r=<?PHP echo(time());?>" type="text/css" rel="stylesheet">
  290. <link href="/css/bootstrap.min.css" type="text/css" rel="stylesheet">
  291. </head>
  292. <?PHP if ($CURRENT_VIEW == ADMIN_VIEW): ?>
  293. <body style="background:url('/res/bg1.jpg') no-repeat; background-size: cover; background-attachment: fixed; background-position: center;">
  294. <div style="width:100%;height:fit-content;position:fixed;background:yellow;color:darkorange;text-align:center;cursor:pointer;" onclick="showHowTo();"><br><?PHP echo(getResource0("How-to: Manage your avatars in Avatar Free", $lang));?><br><br></div>
  295. <form id="frmUpload" role="form" method="post" action="/<?PHP echo(AVATAR_NAME);?>?hl=<?PHP echo($lang);?>" target="_self" enctype="multipart/form-data">
  296. <div class="dragover" style="width:100%;height:100%;border:0px solid red;" dropzone="copy">
  297. <img id="picavatar" src="/img?av=<?PHP echo(AVATAR_NAME);?>&pic=<?PHP echo($profilePic);?>" align="middle" style="position:absolute;width:255px;height:255px;border-radius: 90%; display:none;">
  298. <input type="hidden" id="a" name="a">
  299. <input type="hidden" id="f" name="f">
  300. </div>
  301. <div class="tools" style="position:fixed;top:12px;width:120px;height:620px;display:none;">
  302. <div class="settingson" style="float:left;width:120px;height:150px;border:0px solid black;background:url(/res/settingsoff.png);background-size:cover;cursor:pointer;display:none;" onclick="settingsOn();"></div>
  303. <?PHP if ($magicJar1 == 0): ?>
  304. <div class="magicjar1" style="float:left;width:120px;height:120px;border:0px solid black;background:url(/res/magicjar1dis.png);background-size:120px 120px;cursor:pointer;" onclick="setJar1On()"></div>
  305. <?PHP else: ?>
  306. <div class="magicjar1" style="float:left;width:120px;height:120px;border:0px solid black;background:url(/res/magicjar1.png);background-size:120px 120px;cursor:pointer;" onclick="setJar1Off()"></div>
  307. <?PHP endif; ?>
  308. <?PHP if ($magicJar2 == 0): ?>
  309. <div class="magicjar2" style="float:left;width:120px;height:120px;border:0px solid black;background:url(/res/magicjar2dis.png);background-size:120px 120px;cursor:pointer;" onclick="setJar2On()"></div>
  310. <?PHP else: ?>
  311. <div class="magicjar2" style="float:left;width:120px;height:120px;border:0px solid black;background:url(/res/magicjar2.png);background-size:120px 120px;cursor:pointer;" onclick="setJar2Off()"></div>
  312. <?PHP endif; ?>
  313. <?PHP if ($magicJar3 == 0): ?>
  314. <div class="magicjar3" style="float:left;width:120px;height:120px;border:0px solid black;background:url(/res/magicjar3dis.png);background-size:120px 120px;cursor:pointer;" onclick="setJar3On()"></div>
  315. <?PHP else: ?>
  316. <div class="magicjar3" style="float:left;width:120px;height:120px;border:0px solid black;background:url(/res/magicjar3.png);background-size:120px 120px;cursor:pointer;" onclick="setJar3Off()"></div>
  317. <?PHP endif; ?>
  318. <div class="settingsoff" style="float:left;width:120px;height:150px;border:0px solid black;background:url(/res/settingson.png);background-size:cover;cursor:pointer;" onclick="settingsOff();"></div>
  319. </div>
  320. <input type="hidden" id="txtMagicJar1" name="txtMagicJar1" value="<?PHP echo($magicJar1);?>">
  321. <input type="hidden" id="txtMagicJar2" name="txtMagicJar2" value="<?PHP echo($magicJar2);?>">
  322. <input type="hidden" id="txtMagicJar3" name="txtMagicJar3" value="<?PHP echo($magicJar3);?>">
  323. <input type="hidden" id="Password" name="Password" value="<?PHP echo($password);?>">
  324. </form>
  325. <div id="footerCont">&nbsp;</div>
  326. <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>
  327. <?PHP else: ?>
  328. <body style="background:#dadada no-repeat; background-size: cover; background-attachment: fixed; background-position: center;">
  329. <div style="width:100%;height:fit-content;position:fixed;background:yellow;color:darkorange;text-align:center;cursor:pointer;z-index:99999;" onclick="showHowTo();"><br><?PHP echo(getResource0("How-to: Manage your avatars in Avatar Free", $lang));?><br><br></div>
  330. <form id="frmUpload" role="form" method="post" action="/<?PHP echo(AVATAR_NAME);?>?hl=<?PHP echo($lang);?>" target="_self" enctype="multipart/form-data">
  331. <div id="title" style="position:relative;top:80px;left:50px;width:100%;float:left;font-size:25px;font-family:'Press Start 2P';border:0px solid blue;">
  332. <div id="cudoz" style="width:255px;height:255px;float:left;border:0px solid yellow;">
  333. <img id="picavatar" src="/img?av=<?PHP echo(AVATAR_NAME);?>&pic=<?PHP echo($profilePic);?>" align="middle" style="width:255px;height:255px;border-radius: 90%;">
  334. </div>
  335. <div id="cudoz" style="width:250px;height:255px;padding-top:122px;float:left;border:0px solid yellow;vertical-align:middle;">
  336. &nbsp;<?PHP echo(strtoupper(AVATAR_NAME));?>&nbsp;&nbsp;&nbsp;
  337. </div>
  338. <div id="cudoz" style="width:250px;height:255px;padding-top:116px;float:left;border:0px solid green;vertical-align:middle;">
  339. <?PHP for ($i=1;$i<=$CUDOZ;$i++): ?>
  340. <img id="cudozentry<?PHP echo($i);?>" src="/res/chicca_<?PHP echo($shortLang);?>.png" style="float:left;width:46px">
  341. <?PHP endfor; ?>
  342. <?PHP for ($i=$CUDOZ+1;$i<=5;$i++): ?>
  343. <img id="cudozentry<?PHP echo($i);?>" src="/res/chiccadis.png" style="float:left;width:46px">
  344. <?PHP endfor; ?>
  345. </div>
  346. <div id="cvs" style="float:right;border:3px solid darkgray;border-radius:4px;padding:4px;background:#dadada;font-size:20px;font-family:'Press Start 2P';font-weight:900;">
  347. <div style="float:left;width:47px;margin-top:20px;margin-left:7px;"><?PHP echo(getResource0("CV", $lang));?></div>
  348. <?PHP
  349. $pattern = $CV_PATH . DIRECTORY_SEPARATOR . "*";
  350. $aFilePaths = glob($pattern);
  351. if (empty($aFilePaths)): ?>
  352. <img src="/res/wordicondis.png" style="float:left;width:64px">&nbsp;&nbsp;<img src="/res/pdficondis.png" style="float:left;width:64px">
  353. <?PHP else: ?>
  354. <?PHP
  355. $CUDOZ++;
  356. $pattern = $CV_PATH . DIRECTORY_SEPARATOR . "*.doc";
  357. $aFilePaths = glob($pattern);
  358. if (empty($aFilePaths)): ?>
  359. <img src="/res/wordicondis.png" style="float:left;width:64px">&nbsp;&nbsp;
  360. <?PHP else: ?>
  361. <a href="/doc?av=<?PHP echo(AVATAR_NAME);?>&re=cv&doc=<?PHP echo(basename($aFilePaths[0]));?>"><img src="/res/wordicon.png" style="float:left;width:64px"></a>&nbsp;&nbsp;
  362. <?PHP endif; ?>
  363. <?PHP
  364. $pattern = $CV_PATH . DIRECTORY_SEPARATOR . "*.pdf";
  365. $aFilePaths = glob($pattern);
  366. if (empty($aFilePaths)): ?>
  367. <img src="/res/pdficondis.png" style="float:left;width:64px">
  368. <?PHP else: ?>
  369. <a href="/doc?av=<?PHP echo(AVATAR_NAME);?>&re=cv&doc=<?PHP echo(basename($aFilePaths[0]));?>"><img src="/res/pdficon.png" style="float:left;width:64px"></a>
  370. <?PHP endif; ?>
  371. <?PHP endif; ?>
  372. </div>
  373. </div>
  374. <br>
  375. <div id="blog" style="height:fit-content;float:left;margin:6%;margin-top:130px;margin-bottom:5px;width:90%;font-size:15px;font-family:'Press Start 2P';color:#000000;">
  376. <?PHP
  377. $pattern = $BLOG_PATH . DIRECTORY_SEPARATOR . "*.txt";
  378. $aFilePaths = glob($pattern);
  379. if (empty($aFilePaths)): ?>
  380. <div class="blog-content" style="width:100%;float:left;border:3px solid darkgray;border-radius:4px;color:#000000;">
  381. <div class="blog-entry" style="width:100%;margin-bottom:0px;min-height:120px;background:#FFFFFF;border:1px solid black;padding:30px;">
  382. <?PHP echo(getResource0("Hello from 5 Mode", $lang));?>,<br>
  383. <?PHP echo(getResource0("This is just an example of blog entry", $lang));?>.
  384. </div>
  385. </div>
  386. <?PHP else: ?>
  387. <?PHP
  388. $CUDOZ++;
  389. $iEntry = 1;
  390. foreach ($aFilePaths as $filePath) {
  391. $s=file_get_contents($filePath);
  392. if ($iEntry === count($aFilePaths)) {
  393. $marginbottom = "0px";
  394. } else {
  395. $marginbottom = "5px";
  396. }
  397. ?>
  398. <div class="blog-content" style="margin-bottom:<?PHP echo($marginbottom);?>;width:100%;float:left;border:3px solid darkgray;border-radius:4px;color:#000000;">
  399. <div class="blog-entry" style="min-height:120px;background:#FFFFFF;border:1px solid black;padding:30px;">
  400. <?PHP echo(HTMLencode($s, true));?>
  401. </div>
  402. </div>
  403. <?PHP
  404. $iEntry++;
  405. }?>
  406. <?PHP endif; ?>
  407. </div>
  408. <div id="gallery" style="float:left;margin:6%;margin-top:0px;margin-bottom:5px;width:90%;font-size:15px;font-family:Arial,Sans,Verdana;color:#000000;background:#C2DBF2;">
  409. <div class="gallery-content" style="width:100%;float:left;border:3px solid darkgray;border-radius:4px;color:#000000;">
  410. <?PHP
  411. $pattern = $GALLERY_PATH . DIRECTORY_SEPARATOR . "*";
  412. $aFilePaths = glob($pattern);
  413. if (empty($aFilePaths)): ?>
  414. <div class="image-entry" style="height:fit-content;min-height:120px;float:left;width:fit-content;border:0px solid green;padding:10px;text-align:center;">
  415. <div style="width:100%;border:0px solid black;"><img src="/res/imgicon.png" align="center" style="width:64px;border:1px solid gray;"></div>
  416. <div style="margin-top:10px;"><?PHP echo(getResource0("Sample", $lang));?></div>
  417. </div>
  418. <?PHP else: ?>
  419. <?PHP
  420. $CUDOZ++;
  421. $iEntry = 1;
  422. foreach ($aFilePaths as $filePath) {
  423. $orifilename = basename($filePath);
  424. $filename = explode("|",basename($filePath))[1];
  425. if ($iEntry === count($aFilePaths)) {
  426. $marginbottom = "0px";
  427. } else {
  428. $marginbottom = "5px";
  429. }
  430. ?>
  431. <div class="image-entry" style="height:fit-content;min-height:120px;float:left;width:fit-content;border:0px solid green;padding:10px;text-align:center;">
  432. <a href="/img?av=<?PHP echo(AVATAR_NAME);?>&pic=<?PHP echo($orifilename);?>">
  433. <div style="width:100%;border:0px solid black;"><img src="/res/imgicon.png" align="center" style="width:64px;border:1px solid gray;"></div>
  434. <div style="margin-top:10px;"><?PHP echo($filename);?> </div>
  435. </a>
  436. </div>
  437. <?PHP
  438. $iEntry++;
  439. }?>
  440. <?PHP endif; ?>
  441. </div>
  442. </div>
  443. <?PHP
  444. $pattern = $MAGICJAR1_PATH . DIRECTORY_SEPARATOR . "*";
  445. $aFilePaths = glob($pattern);
  446. if (!empty($aFilePaths)): ?>
  447. <div id="magicjar1" style="float:left;margin:6%;margin-top:0px;margin-bottom:5px;width:90%;font-size:15px;font-family:Arial,Sans,Verdana;color:#000000;background:#f7ecb5;">
  448. <div class="magicjar1-content" style="width:100%;float:left;border:3px solid darkgray;border-radius:4px;color:#000000;">
  449. <div style="float:right;margin-right:2px;background:yellow;color:darkorange;">&nbsp;1&nbsp;</div>
  450. <?PHP
  451. $iEntry = 1;
  452. foreach ($aFilePaths as $filePath) {
  453. $orifilename = basename($filePath);
  454. $filename = explode("|",basename($filePath))[1];
  455. if ($iEntry === count($aFilePaths)) {
  456. $marginbottom = "0px";
  457. } else {
  458. $marginbottom = "5px";
  459. }
  460. ?>
  461. <div class="file-entry" style="height:fit-content;min-height:120px;float:left;width:fit-content;border:0px solid green;padding:10px;text-align:center;">
  462. <a href="/file?av=<?PHP echo(AVATAR_NAME);?>&jar=1&fn=<?PHP echo($orifilename);?>">
  463. <div style="width:100%;border:0px solid black;"><img src="/res/fileicon.png" align="center" style="width:64px;border:0px solid gray;"></div>
  464. <div style="margin-top:10px;"><?PHP echo($filename);?> </div>
  465. </a>
  466. </div>
  467. <?PHP
  468. $iEntry++;
  469. }?>
  470. </div>
  471. </div>
  472. <?PHP endif; ?>
  473. <?PHP
  474. $pattern = $MAGICJAR2_PATH . DIRECTORY_SEPARATOR . "*";
  475. $aFilePaths = glob($pattern);
  476. if (!empty($aFilePaths)): ?>
  477. <div id="magicjar2" style="float:left;margin:6%;margin-top:0px;margin-bottom:5px;width:90%;font-size:15px;font-family:Arial,Sans,Verdana;color:#000000;background:#f7ecb5;">
  478. <div class="magicjar2-content" style="width:100%;float:left;border:3px solid darkgray;border-radius:4px;color:#000000;">
  479. <div style="float:right;margin-right:2px;background:yellow;color:darkorange;">&nbsp;2&nbsp;</div>
  480. <?PHP
  481. $iEntry = 1;
  482. foreach ($aFilePaths as $filePath) {
  483. $orifilename = basename($filePath);
  484. $filename = explode("|",basename($filePath))[1];
  485. if ($iEntry === count($aFilePaths)) {
  486. $marginbottom = "0px";
  487. } else {
  488. $marginbottom = "5px";
  489. }
  490. ?>
  491. <div class="file-entry" style="height:fit-content;min-height:120px;float:left;width:fit-content;border:0px solid green;padding:10px;text-align:center;">
  492. <a href="/file?av=<?PHP echo(AVATAR_NAME);?>&jar=2&fn=<?PHP echo($orifilename);?>">
  493. <div style="width:100%;border:0px solid black;"><img src="/res/fileicon.png" align="center" style="width:64px;border:0px solid gray;"></div>
  494. <div style="margin-top:10px;"><?PHP echo($filename);?> </div>
  495. </a>
  496. </div>
  497. <?PHP
  498. $iEntry++;
  499. }?>
  500. </div>
  501. </div>
  502. <?PHP endif; ?>
  503. <?PHP
  504. $pattern = $MAGICJAR3_PATH . DIRECTORY_SEPARATOR . "*";
  505. $aFilePaths = glob($pattern);
  506. if (!empty($aFilePaths)): ?>
  507. <div id="magicjar3" style="float:left;margin:6%;margin-top:0px;margin-bottom:5px;width:90%;font-size:15px;font-family:Arial,Sans,Verdana;color:#000000;background:#f7ecb5;">
  508. <div class="magicjar3-content" style="width:100%;float:left;border:3px solid darkgray;border-radius:4px;color:#000000;">
  509. <div style="float:right;margin-right:2px;background:yellow;color:darkorange;">&nbsp;3&nbsp;</div>
  510. <?PHP
  511. $iEntry = 1;
  512. foreach ($aFilePaths as $filePath) {
  513. $orifilename = basename($filePath);
  514. $filename = explode("|",basename($filePath))[1];
  515. if ($iEntry === count($aFilePaths)) {
  516. $marginbottom = "0px";
  517. } else {
  518. $marginbottom = "5px";
  519. }
  520. ?>
  521. <div class="file-entry" style="height:fit-content;min-height:120px;float:left;width:fit-content;border:0px solid green;padding:10px;text-align:center;">
  522. <a href="/file?av=<?PHP echo(AVATAR_NAME);?>&jar=3&fn=<?PHP echo($orifilename);?>">
  523. <div style="width:100%;border:0px solid black;"><img src="/res/fileicon.png" align="center" style="width:64px;border:0px solid gray;"></div>
  524. <div style="margin-top:10px;"><?PHP echo($filename);?> </div>
  525. </a>
  526. </div>
  527. <?PHP
  528. $iEntry++;
  529. }?>
  530. </div>
  531. </div>
  532. <?PHP endif; ?>
  533. <div id="friends" style="float:left;margin:6%;margin-top:50px;width:90%;font-size:15px;font-family:Arial,Sans,Verdana;color:#000000;background:#dadada">
  534. <div class="friends-content" style="width:100%;float:left;border:3px solid transparent;border-radius:4px;color:#000000;padding-top:10px;text-align:center;">
  535. <div style="font-family:'Press Start 2P';width:fit-content;margin:auto;color:#245269;"><?PHP echo(getResource0("My Network", $lang));?>:<br><br>
  536. <?PHP
  537. $pattern = $FRIENDS_PATH . DIRECTORY_SEPARATOR . "*.txt";
  538. $aFilePaths = glob($pattern);
  539. if (empty($aFilePaths)): ?>
  540. <div class="friend-entry" style="height:fit-content;min-height:120px;float:left;width:fit-content;border:0px solid green;padding:10px;text-align:center;">
  541. <a href="http://5mode.com">
  542. <div style="width:100%;border:0px solid black;"><img src="/res/pic1.png" align="center" style="width:64px;border:0px solid gray;"></div>
  543. <div style="margin-top:10px;"><?PHP echo(getResource0("Sample", $lang));?></div>
  544. </a>
  545. </div>
  546. <?PHP else: ?>
  547. <?PHP
  548. $CUDOZ++;
  549. $iEntry = 1;
  550. foreach ($aFilePaths as $filePath) {
  551. $orifilename = basename($filePath);
  552. $link=file_get_contents($filePath);
  553. $filename = pathinfo($filePath, PATHINFO_FILENAME);
  554. if ($iEntry === count($aFilePaths)) {
  555. $marginbottom = "0px";
  556. } else {
  557. $marginbottom = "5px";
  558. }
  559. ?>
  560. <div class="friend-entry" style="height:fit-content;min-height:120px;float:left;width:fit-content;border:0px solid green;padding:10px;text-align:center;">
  561. <a href="<?PHP echo($link);?>">
  562. <div style="width:100%;border:0px solid black;"><img src="/res/pic1.png" align="center" style="width:64px;border:0px solid gray;"></div>
  563. <div style="margin-top:10px;"><?PHP echo($filename);?> </div>
  564. </a>
  565. </div>
  566. <?PHP
  567. $iEntry++;
  568. }?>
  569. <?PHP endif; ?>
  570. </div>
  571. </div>
  572. </div>
  573. <div id="passworddisplay" style="float:left;position:fixed;top:680px;left:50px;width:255px;height:120px;background:darkgray;text-align:left;white-space:nowrap; font-family:'Bungee Hairline'; color:#000000; font-weight:900;z-index:99999;">
  574. <br>
  575. &nbsp;&nbsp;<input type="password" id="Password" name="Password" placeholder="password" style="font-size:18px; background:transparent; width: 60%; border-radius:3px; font-weight:900;" 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>
  576. &nbsp;&nbsp;<input type="text" id="Salt" placeholder="salt" style="position:relative; top:+5px; font-size:18px; background:transparent; width: 90%; border-radius:3px; font-weight:900;" autocomplete="off"><br>
  577. <div style="text-align:center;">
  578. <a href="#" onclick="showEncodedPassword();" style="position:relative; left:-2px; top:+5px; font-size:18px; font-weight:900; color:#000000;"><?PHP echo(getResource0("Hash Me", $lang));?>!</a>
  579. </div>
  580. </div>
  581. </form>
  582. <div id="footerCont">&nbsp;</div>
  583. <div id="footer">
  584. <div style="float:left">
  585. <select id="cbLang" style="margin-left:22px;font-size:10px;" onchange="changeLang(this);">
  586. <option value="en-US" <?PHP echo($lang==PHP_EN?"selected":"");?>>en</option>
  587. <option value="it-IT" <?PHP echo($lang==PHP_IT?"selected":"");?>>it</option>
  588. <option value="zh-CN" <?PHP echo($lang==PHP_CN?"selected":"");?>>cn</option>
  589. </select>
  590. </div>
  591. <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>
  592. <?PHP endif; ?>
  593. <script src="/js/home-js.php?hl=<?PHP echo($lang);?>&av=<?PHP echo(AVATAR_NAME);?>&cv=<?PHP echo($CURRENT_VIEW);?>&cu=<?PHP echo($CUDOZ);?>" type="text/javascript"></script>
  594. <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "metrics.html")): ?>
  595. <?php include("../../Public/metrics.html"); ?>
  596. <?php endif; ?>
  597. </body>
  598. </html>