home.php 51 KB

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