home.php 56 KB

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