From 9f9d66afebc59c6c265c4424f7b8fb36d8876541 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 26 Oct 2023 16:39:03 +0200 Subject: Updated 34 files and added 146 files (automated) --- includes/session.php | 85 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 78 insertions(+), 7 deletions(-) (limited to 'includes/session.php') diff --git a/includes/session.php b/includes/session.php index 8427fc2..36c5216 100644 --- a/includes/session.php +++ b/includes/session.php @@ -28,11 +28,18 @@ global $albums; global $songs; if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/users"); if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-favorites.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-favorites.json", "[]"); if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-library.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-library.json", "[]"); +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-history.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-history.json", "[]"); $albums = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/content/albums.json"), true); $songs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/content/songs.json"), true); $favorites = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-favorites.json"), true); $library = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-library.json"), true); +$history = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-history.json"), true); + +$albums = array_map(function ($i) { + $i["artist"] = str_replace(";", ", ", $i["artist"]); + return $i; +}, $albums); function displayList($list, $hasAlbum = false) { global $albums; global $favorites; ?>
@@ -42,26 +49,90 @@ function displayList($list, $hasAlbum = false) { global $albums; global $favorit
- -
+ +
-
+
-

+
- +
- favoriteSong('');" class="player-btn" style="border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; height: 48px; width: 48px;" id="btn-favorite-"> + ');" class="player-btn" style="border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; height: 48px; width: 48px;" id="btn-play-"> + + + + + +
+