home.php 55 KB

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