home.php 52 KB

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