home.php.ori 52 KB

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