From 8288ebc67a6e0ef66c2469092c71bc673315d8bc Mon Sep 17 00:00:00 2001 From: Cody Cook Date: Thu, 2 May 2024 19:21:24 -0700 Subject: [PATCH] Check-in; adding features like mixshow and google analytics. --- classes/CustomCDN.php | 71 ++++++ classes/DJ.php | 24 +- classes/Genre.php | 25 +- classes/Mix.php | 345 ++++++++++++++++----------- classes/Mixshow.php | 134 +++++++++++ classes/S3.php | 8 + composer.json | 3 +- dj.php | 202 ++++++++++------ djs.php | 1 + genre.php | 249 ++++++++------------ genres.php | 1 + includes/footer.php | 9 +- includes/globals.php | 12 +- includes/google_tag_manager.php | 15 ++ includes/header.php | 37 ++- includes/hreflang.php | 21 ++ includes/lang_loader.php | 1 - index.php | 1 + locale/af_ZA/messages.php | 13 ++ locale/ar_SA/messages.php | 13 ++ locale/ca_ES/messages.php | 13 ++ locale/cs_CZ/messages.php | 13 ++ locale/da_DK/messages.php | 13 ++ locale/de_DE/messages.php | 13 ++ locale/el_GR/messages.php | 13 ++ locale/en_US/messages.php | 19 ++ locale/es_ES/messages.php | 13 ++ locale/fi_FI/messages.php | 13 ++ locale/fil_PH/messages.php | 13 ++ locale/fr_FR/messages.php | 13 ++ locale/he_IL/messages.php | 13 ++ locale/hu_HU/messages.php | 13 ++ locale/it_IT/messages.php | 13 ++ locale/ja_JP/messages.php | 13 ++ locale/ko_KR/messages.php | 13 ++ locale/nl_NL/messages.php | 13 ++ locale/no_NO/messages.php | 13 ++ locale/pl_PL/messages.php | 17 +- locale/pt_BR/messages.php | 13 ++ locale/pt_PT/messages.php | 13 ++ locale/ro_RO/messages.php | 13 ++ locale/ru_RU/messages.php | 13 ++ locale/sr_SP/messages.php | 13 ++ locale/sv_SE/messages.php | 13 ++ locale/tr_TR/messages.php | 13 ++ locale/uk_UA/messages.php | 13 ++ locale/vi_VN/messages.php | 13 ++ locale/zh_CN/messages.php | 13 ++ locale/zh_TW/messages.php | 13 ++ mix.php | 403 ++++++++++++++++++++++++-------- 50 files changed, 1492 insertions(+), 483 deletions(-) create mode 100644 classes/CustomCDN.php create mode 100644 classes/Mixshow.php create mode 100644 classes/S3.php create mode 100644 includes/google_tag_manager.php create mode 100644 includes/hreflang.php diff --git a/classes/CustomCDN.php b/classes/CustomCDN.php new file mode 100644 index 0000000..70ce8fe --- /dev/null +++ b/classes/CustomCDN.php @@ -0,0 +1,71 @@ +space = $space; + $this->region = $region; + $this->storageType = $storageType; + $this->accessKey = $accessKey; + $this->secretKey = $secretKey; + } + + public function uploadFile($filePath, $spacePath) + { + $file = basename($filePath); + $date = gmdate('D, d M Y H:i:s T'); + if ($this->public) { + $acl = "x-amz-acl:public-read"; + } else { + $acl = "x-amz-acl:private"; + } + $contentType = $this->getContentType($filePath); + $storageClass = "x-amz-storage-class:{$this->storageType}"; + + $stringToSign = "PUT\n\n{$contentType}\n{$date}\n{$acl}\n{$storageClass}\n/{$this->space}{$spacePath}{$file}"; + $signature = base64_encode(hash_hmac('sha1', $stringToSign, $this->secretKey, true)); + + $headers = ["Host: {$this->space}.{$this->region}.digitaloceanspaces.com", "Date: {$date}", "Content-Type: {$contentType}", "{$storageClass}", "{$acl}", "Authorization: AWS {$this->accessKey}:{$signature}"]; + + $ch = curl_init("https://{$this->space}.{$this->region}.digitaloceanspaces.com{$spacePath}{$file}"); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_PUT, true); + curl_setopt($ch, CURLOPT_INFILE, fopen($filePath, 'r')); + curl_setopt($ch, CURLOPT_INFILESIZE, filesize($filePath)); + + $response = curl_exec($ch); + $error = curl_error($ch); + curl_close($ch); + + return $error ? $error : $response; + } + + private function getContentType($filePath) + { + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $mimeType = finfo_file($finfo, $filePath); + finfo_close($finfo); + return $mimeType ?: 'application/octet-stream'; + } + + public function setPublic() + { + $this->public = true; + } + + public function setPrivate() + { + $this->public = false; + } +} + +?> diff --git a/classes/DJ.php b/classes/DJ.php index dc17038..1cc754e 100644 --- a/classes/DJ.php +++ b/classes/DJ.php @@ -17,6 +17,7 @@ class DJ private string $updated = ""; private string $claimed_by = ""; private mysqli $db; + private array $mixes = []; public function __construct($value, $db) @@ -118,8 +119,6 @@ class DJ if (isset($dj['claimed_by']) && $dj['claimed_by'] != null) { // TODO: pull some quick data on the user who claimed this DJ $this->claimed = true; - - } if (isset($dj['created'])) { @@ -129,6 +128,8 @@ class DJ $this->updated = $dj['lastupdated']; } + $this->load_dj_mixes(); + return true; } else { return false; @@ -208,5 +209,24 @@ class DJ return $this->claimed; } + private function load_dj_mixes(): void + { + $stmt = $this->db->prepare("SELECT * FROM mix WHERE dj1 = ? OR dj2 = ? OR dj3 = ?"); + $stmt->bind_param("iii", $this->id, $this->id, $this->id); + $stmt->execute(); + $result = $stmt->get_result(); + $mixes = []; + while ($mix = $result->fetch_assoc()) { + $mixes[] = $mix; + } + $stmt->close(); + $this->mixes = $mixes; + + } + + public function get_dj_mixes() + { + return $this->mixes; + } } \ No newline at end of file diff --git a/classes/Genre.php b/classes/Genre.php index f724797..0483cab 100644 --- a/classes/Genre.php +++ b/classes/Genre.php @@ -3,12 +3,13 @@ class Genre { - private $id = -1 ; + private $id = -1; private $enabled = ""; private $count = 0; private $name = ""; private $slug = ""; private $db = ""; + private $mixes = []; public function __construct($value, $db) { @@ -22,6 +23,7 @@ class Genre return $this->load_by_slug(); } } + private function load_by_id(): bool { $genre = $this->get_genre_by_id(); @@ -30,6 +32,7 @@ class Genre $this->count = $genre['count']; $this->name = $genre['name']; $this->slug = $genre['slug']; + $this->mixes = $this->load_mixes(); return true; } else { return false; @@ -56,6 +59,7 @@ class Genre $this->enabled = $genre['enabled']; $this->count = $genre['count']; $this->name = $genre['name']; + $this->mixes = $this->load_mixes(); return true; } return false; @@ -98,4 +102,23 @@ class Genre return $this->count; } + public function get_mixes(): array + { + return $this->mixes; + } + + private function load_mixes(): array + { + $stmt = $this->db->prepare("SELECT mix_id FROM mix_meta WHERE attribute = 'genre' AND value = ?"); + $stmt->bind_param("i", $this->id); + $stmt->execute(); + $result = $stmt->get_result(); + $mixes = []; + while ($row = $result->fetch_assoc()) { + $mixes[] = $row['mix_id']; + } + $stmt->close(); + return $mixes; + + } } \ No newline at end of file diff --git a/classes/Mix.php b/classes/Mix.php index 0c34416..51ccbbe 100644 --- a/classes/Mix.php +++ b/classes/Mix.php @@ -7,26 +7,32 @@ class Mix private $enabled = false; private $name = ""; private $slug = ""; - private $genre = []; private $db = null; private $description = ""; private $cover = ""; private $url = ""; private $seconds = 0; - private $mediaplayer = false; + private $download_only = true; private $djs = []; private $genres = []; private $recorded; + private $downloads = 0; private $created; private $updated; private $playcount = 0; private $tracklist = []; + private $loadDJs = true; + private $related_mixes = []; + private $duration = []; + private $mixshow = []; - public function __construct($value, $db) + public function __construct($value, $db, $loadDJs = true) { $this->db = $db; + // echo the type of value + if (ctype_digit((string)$value)) { $this->id = (int)$value; return $this->load_by_id(); @@ -40,7 +46,7 @@ class Mix private function load_by_id(): bool { $mix = $this->get_mix_by_id(); - if ($mix && $mix['name'] != "") { + if ($mix && $mix['title'] != "") { return $this->build_mix($mix); } else { return false; @@ -58,122 +64,6 @@ class Mix return $mix; } - private function get_mix_genres() - { - $stmt = $this->db->prepare("SELECT * FROM mix_meta WHERE attribute = 'genre' AND mix_id = ?"); - $stmt->bind_param("i", $this->id); - $stmt->execute(); - $result = $stmt->get_result(); - $genres = $result->fetch_all(MYSQLI_ASSOC); - $stmt->close(); - return $genres; - } - - private function get_playcount() - { - $stmt = $this->db->prepare("SELECT value FROM mix_meta WHERE attribute = 'playcount' AND mix_id = ?"); - $stmt->bind_param("i", $this->id); - $stmt->execute(); - $result = $stmt->get_result(); - $genres = $result->fetch_all(MYSQLI_ASSOC); - $stmt->close(); - return $genres; - } - - private function load_by_slug(): bool - { - $mix = $this->get_mix_by_slug(); - - if ($mix['title'] != "") { - return $this->build_mix($mix); - } else { - return false; - } - } - - private function get_mix_by_slug() - { - $stmt = $this->db->prepare("SELECT * FROM mix WHERE slug = ?"); - $stmt->bind_param("s", $this->slug); - $stmt->execute(); - $result = $stmt->get_result(); - $mix = $result->fetch_assoc(); - $stmt->close(); - return $mix; - } - - private function load_mix_genres() - { - $genres = $this->get_mix_genres(); - if (count($genres) == 0) { - $this->genres = []; - } else { - // iterate through the genres; add each of the rest to the array - $this->genres = []; - require_once 'Genre.php'; - foreach ($genres as $genre) { - $genre = new Genre($genre['value'], $this->db); - if ($genre->get_id() != -1) { - $this->genres[] = ['id' => $genre->get_id(), 'name' => $genre->get_name(), 'slug' => $genre->get_slug()]; - } - - } - - } - - } - - private function evaluate_tracklist(): array - { - if (empty($this->tracklist)){ - return []; - } else { - // if the first item in the array is also an array, then return it - if (is_array($this->tracklist[0]['value'])){ - - return $this->tracklist[0]['value']; - } else { - return explode("\n", $this->tracklist[0]['value']); - } - } - - } - - private function load_mix_tracklist() - { - $stmt = $this->db->prepare("SELECT value FROM mix_meta WHERE attribute = 'tracklist' AND mix_id = ?"); - $stmt->bind_param("i", $this->id); - $stmt->execute(); - $result = $stmt->get_result(); - $tracklist = $result->fetch_all(MYSQLI_ASSOC); - $stmt->close(); - return $tracklist; - } - - public function get_img(): string - { - return $this->cover; - } - - public function get_id(): int - { - return $this->id; - } - - public function get_name(): string - { - return $this->name; - } - - public function get_slug(): string - { - return $this->slug; - } - - public function get_djs(){ - return $this->djs; - } - /** * @param $mix * @return true @@ -198,29 +88,157 @@ class Mix } $this->url = $mix['url']; $this->seconds = $mix['seconds']; - $this->mediaplayer = $mix['mediaplayer']; + $this->duration = $this->configure_duration(); + $this->download_only = $mix['mediaplayer']; $this->recorded = $mix['recorded']; $this->created = $mix['created']; $this->updated = $mix['lastupdated']; $this->enabled = $mix['pending']; - require 'DJ.php'; - $this->djs[] = new DJ($mix['dj1'], $this->db); - if ($mix['dj2'] != null) - $this->djs[] = new DJ($mix['dj2'], $this->db); - if ($mix['dj3'] != null) - $this->djs[] = new DJ($mix['dj3'], $this->db); + if ($this->loadDJs) { + require_once 'DJ.php'; + $this->djs[] = new DJ($mix['dj1'], $this->db); + if ($mix['dj2'] != null) $this->djs[] = new DJ($mix['dj2'], $this->db); + if ($mix['dj3'] != null) $this->djs[] = new DJ($mix['dj3'], $this->db); - // delete any nulls from the array - $this->djs = array_filter($this->djs); + $this->djs = array_filter($this->djs); + } - $this->genre = $this->get_mix_genres(); - $this->playcount = $this->get_playcount(); - $this->tracklist = $this->load_mix_tracklist(); + $this->load_mix_meta(); $this->tracklist = $this->evaluate_tracklist(); - return true; } + private function configure_duration(): array + { + $seconds = $this->seconds; + $hours = floor($seconds / 3600); + $minutes = floor(($seconds / 60) % 60); + $seconds = $seconds % 60; + + // for 't', we need to show it as 01:02:03 + if ($hours < 10) { + $hours0 = "0" . $hours; + } else { + $hours0 = $hours; + } + if ($minutes < 10) { + $minutes0 = "0" . $minutes; + } else { + $minutes0 = $minutes; + } + if ($seconds < 10) { + $seconds0 = "0" . $seconds; + } else { + $seconds0 = $seconds; + } + + // if hours is 0, we don't need to show it + $time = $hours > 0 ? $hours0 . ":" . $minutes0 . ":" . $seconds0 : $minutes0 . ":" . $seconds0; + + return ['h' => $hours, 'm' => $minutes, 's' => $seconds, 't' => $time, 'S' => $this->seconds]; + } + + private function load_mix_meta(): void + { + $stmt = $this->db->prepare("SELECT attribute,value FROM mix_meta WHERE mix_id = ?"); + $stmt->bind_param("i", $this->id); + $stmt->execute(); + $result = $stmt->get_result(); + $meta = $result->fetch_all(MYSQLI_ASSOC); + $stmt->close(); + + foreach ($meta as $key => $value) { + if ($value['attribute'] == "genre") { + $this->genres[] = $value['value']; + unset($meta[$key]); + } + if ($value['attribute'] == "related") { + $this->related_mixes[] = $value['value']; + unset($meta[$key]); + } + if ($value['attribute'] == "playcount") { + $this->playcount = $value['value']; + unset($meta[$key]); + } + if ($value['attribute'] == "downloads") { + $this->downloads = $value['value']; + unset($meta[$key]); + } + if ($value['attribute'] == "tracklist") { + $this->tracklist = $value['value']; + unset($meta[$key]); + } + if ($value['attribute'] == "mixshow") { + $this->mixshow[] = $value['value']; + unset($meta[$key]); + } + + } + + } + + private function evaluate_tracklist() + { + if (empty($this->tracklist)) { + return []; + } else { + // if the first item in the array is also an array, then return it + if (is_array($this->tracklist)) { + return $this->tracklist; + } else { + return explode("\n", (string)$this->tracklist); + } + } + + } + + private function load_by_slug(): bool + { + $mix = $this->get_mix_by_slug(); + + if ($mix['title'] != "") { + return $this->build_mix($mix); + } else { + return false; + } + } + + private function get_mix_by_slug() + { + $stmt = $this->db->prepare("SELECT * FROM mix WHERE slug = ?"); + $stmt->bind_param("s", $this->slug); + $stmt->execute(); + $result = $stmt->get_result(); + $mix = $result->fetch_assoc(); + $stmt->close(); + return $mix; + } + + public function get_recorded() + { + return $this->recorded; + } + + public function get_created() + { + return $this->created; + } + + public function get_updated() + { + return $this->updated; + } + + public function get_img(): string + { + return $this->cover; + } + + public function get_djs() + { + return $this->djs; + } + public function get_description() { return $this->description; @@ -231,5 +249,66 @@ class Mix return $this->tracklist; } + public function get_genres() + { + return $this->genres; + } + + public function get_seconds(): int + { + return $this->seconds; + } + + public function is_download_only(): bool + { + return $this->download_only; + } + + public function get_url(): string + { + return $this->url; + } + + public function get_cover(): string + { + return $this->cover; + } + + public function get_downloads(): int + { + return $this->downloads; + } + + public function get_plays(): int + { + return $this->playcount; + } + + public function get_id(): int + { + return $this->id; + } + + public function get_name(): string + { + return $this->name; + } + + public function get_slug(): string + { + return $this->slug; + } + + public function get_duration(): array + { + return $this->duration; + } + + public function get_mixshow(): array + { + return $this->mixshow; + } + } + diff --git a/classes/Mixshow.php b/classes/Mixshow.php new file mode 100644 index 0000000..693bd04 --- /dev/null +++ b/classes/Mixshow.php @@ -0,0 +1,134 @@ +db = $db; + + if (ctype_digit((string)$value)) { + $this->id = (int)$value; + return $this->load_by_id(); + } else { + $this->slug = $value; + return $this->load_by_slug(); + } + } + + private function load_by_id() + { + $mixshow = $this->get_mixshow_by_id(); + if ($mixshow && $mixshow['title'] != "") { + return $this->build_mixshow($mixshow); + } else { + return false; + } + } + + private function get_mixshow_by_id() + { + $stmt = $this->db->prepare("SELECT * FROM shows WHERE id = ?"); + $stmt->bind_param("i", $this->id); + $stmt->execute(); + $result = $stmt->get_result(); + return $result->fetch_assoc(); + } + + private function build_mixshow($mixshow) + { + + $this->id = $mixshow['id']; + $this->name = $mixshow['name']; + $this->slug = $mixshow['slug']; + $this->description = $mixshow['description']; + $this->cover = $mixshow['cover']; + $this->enabled = $mixshow['enabled']; + $this->count = $mixshow['count']; + $this->load_mixes(); + return true; + } + + private function load_mixes() + { + $stmt = $this->db->prepare("SELECT value FROM mix_meta WHERE value = ?"); + $stmt->bind_param("i", $this->id); + $stmt->execute(); + $result = $stmt->get_result(); + $this->mixes = []; + while ($mix = $result->fetch_assoc()) { + $this->mixes[] = $mix; + } + } + + private function load_by_slug() + { + $mixshow = $this->get_mixshow_by_slug(); + if ($mixshow && $mixshow['title'] != "") { + return $this->build_mixshow($mixshow); + } else { + return false; + } + } + + private function get_mixshow_by_slug() + { + $stmt = $this->db->prepare("SELECT * FROM shows WHERE slug = ?"); + $stmt->bind_param("s", $this->slug); + $stmt->execute(); + $result = $stmt->get_result(); + return $result->fetch_assoc(); + } + + public function get_id() + { + return $this->id; + } + + public function get_name() + { + return $this->name; + } + + public function get_slug() + { + return $this->slug; + } + + public function get_description() + { + return $this->description; + } + + public function get_cover() + { + return $this->cover; + } + + public function get_enabled() + { + return $this->enabled; + } + + public function get_count() + { + return $this->count; + } + + public function get_mixes() + { + return $this->mixes; + } + + +} \ No newline at end of file diff --git a/classes/S3.php b/classes/S3.php new file mode 100644 index 0000000..3e8bd4e --- /dev/null +++ b/classes/S3.php @@ -0,0 +1,8 @@ +=8.2.0", "yosymfony/toml": "*", - "ext-mysqli": "*" + "ext-mysqli": "*", + "ext-curl": "*" } } \ No newline at end of file diff --git a/dj.php b/dj.php index 6fddd5a..1c1b7e7 100644 --- a/dj.php +++ b/dj.php @@ -3,6 +3,8 @@ require 'includes/globals.php'; require_once 'classes/Database.php'; require_once 'classes/DJ.php'; +require_once 'classes/Genre.php'; +require_once 'classes/Mix.php'; // if there's a query parameter named 'dj', load the DJ class $db = new Database($config); @@ -13,6 +15,7 @@ if (isset($_GET['dj']) && $_GET['dj'] != "") { $djFound = true; } } +$title = $dj->get_name(); require_once 'includes/header.php'; ?>
@@ -27,7 +30,6 @@ require_once 'includes/header.php'; aria-current="page">get_name() != "") { echo $dj->get_name(); - } else { echo $locale['notfound']; } @@ -38,88 +40,142 @@ require_once 'includes/header.php'; -
-
-
-
- avatar -
get_name(); - ?>
- +
+
+
+ avatar +
get_name(); + ?>
+ get_claimed()) { - echo '

'; - echo "Claimed"; - echo "

"; - } + if ($dj->get_claimed()) { + echo '

'; + echo "Claimed"; + echo "

"; + } - ?> -

-

$location1

-
- - -
-
-
- get_socials() != []) { ?> -
-
-
    - get_socials(); - foreach ($socials as $key => $value) { - echo social_line($key, $value); +
    + + +
    +
+
+ get_socials() != []) { + ?> +
+
+
    + get_socials(); + foreach ($socials as $key => $value) { + echo social_line($key, $value); + } + ?> +
+
+
+ +
+
+
+
+
+
+

+
+
+

get_name(); ?>

+
+
+ get_bio() != "") { + echo box_line($locale['bio'], $dj->get_bio()); + } + echo box_line($locale['lastupdated'], $dj->get_updated()); + ?> +
+
+ +
+
+
+
+ get_dj_mixes(); + $count = 0; + + foreach ($mixes as $mix) { + $output = new Mix($mix['slug'], $db); + $genres = $output->get_genres(); + $genrelist = []; + + foreach ($genres as $genre) { + $genr = new Genre($genre, $db); + $genrelist[$genr->get_slug()] = $genr->get_name(); } - ?> - + + echo '
'; // Start row for each mix + + // Column for mix name and link + echo '
'; + echo '

'; + echo ''; + echo $output->get_name(); + echo ''; + echo '

'; + echo '
'; // End column + + // Column for genres + echo '
'; + echo '

'; + foreach ($genrelist as $slug => $name) { + echo ' '; + echo '' . $name . ''; + echo ''; + } + echo '

'; + echo '
'; // End column + + // Column for duration + echo '
'; + echo '

'; + $duration = $output->get_duration(); + echo $duration['t']; + echo '

'; + echo '
'; // End column + echo '
'; // End row + + $count++; + // Add horizontal rule only if it's not the last mix + if ($count < count($mixes)) { + echo '
'; + } + } + ?> +
- +
-
-
-
-
-
-

-
-
-

get_name(); ?>

-
+ +
+
+ - get_bio() != "") { - echo box_line($locale['bio'], $dj->get_bio()); - } - echo box_line($locale['lastupdated'], $dj->get_updated()); - ?>
-
- -
+
- -
-
- -
-
- - +
diff --git a/djs.php b/djs.php index 6da0137..3a9f19e 100644 --- a/djs.php +++ b/djs.php @@ -6,6 +6,7 @@ require_once 'classes/DJs.php'; $db = new Database($config); $djs = new DJs($db); +$title = $locale['djs']; require_once 'includes/header.php'; ?>
diff --git a/genre.php b/genre.php index 5cadd1b..6ba9012 100644 --- a/genre.php +++ b/genre.php @@ -3,6 +3,7 @@ require 'includes/globals.php'; require_once 'classes/Database.php'; require_once 'classes/Genre.php'; +require_once 'classes/Mix.php'; $genre = null; $genreFound = false; @@ -17,166 +18,108 @@ if (isset($_GET['genre']) && $_GET['genre'] != "") { } } +$title = $genre->get_name(); require_once 'includes/header.php'; ?> -
-
-
-
- -
-
- -
-
-
-
- avatar -
get_name(); - ?>
- -

-
- -
-
-
-
-
-
-
-
-
-

-
-
-

get_count(); ?> -

-
-
-
-
-
-

Email

-
-
-

example@example.com

-
-
-
-
-
-
-
-
-

assigment Project - Status -

-

Web Design

-
-
-
-

Website Markup

-
-
-
-

One Page

-
-
-
-

Mobile Template

-
-
-
-

Backend API

-
-
-
-
-
-
-
-
-
-

assigment Project - Status -

-

Web Design

-
-
-
-

Website Markup

-
-
-
-

One Page

-
-
-
-

Mobile Template

-
-
-
-

Backend API

-
-
-
-
-
-
-
-
-
- +
+
- +
- +
+
+
+
+ avatar +
get_name(); + ?>
- ?> +

+
+ +
+
+
+
+
+
+
+
+
+

+
+
+

get_count(); ?> +

+
+
-
-
+
+ +
+
+
+
+ get_mixes(); + foreach ($mixes as $mix) { + $output = new Mix($mix, $db); + echo '
'; + echo '

'; + echo ''; + echo $output->get_name(); + echo ''; + echo '

'; + echo '
'; + $count++; + if ($count < count($mixes)) { + echo '
'; + } + + } + + ?> +
+
+
+
+ + + +
+
+ +
+
+ + + +
\ No newline at end of file diff --git a/genres.php b/genres.php index e42c99e..6edddbc 100644 --- a/genres.php +++ b/genres.php @@ -8,6 +8,7 @@ $genresFound = false; // if there's a query parameter named 'dj', load the DJ class $db = new Database($config); $genres = new Genres($db); +$title = $locale['genres']; require_once 'includes/header.php'; ?>
diff --git a/includes/footer.php b/includes/footer.php index 3ef6263..61299e5 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -1,12 +1,5 @@ - + \ No newline at end of file diff --git a/includes/globals.php b/includes/globals.php index b37d193..ba95606 100644 --- a/includes/globals.php +++ b/includes/globals.php @@ -84,12 +84,18 @@ function social_line($social, $value): string $color = "#1DB954"; $name = "Spotify"; break; + case "linktree": + $icon = "fa-solid fa-link"; + $url = "https://www.linktr.ee/$value"; + $color = "#39E09B"; + $name = "Linktree"; + break; } return " -
  • - -

    $value +

  • + +

    $value

  • "; } diff --git a/includes/google_tag_manager.php b/includes/google_tag_manager.php new file mode 100644 index 0000000..ea9e248 --- /dev/null +++ b/includes/google_tag_manager.php @@ -0,0 +1,15 @@ +(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','$tag') +HTML; +} + +function get_google_tag_manager_body($tag): string +{ + return << +HTML; +} \ No newline at end of file diff --git a/includes/header.php b/includes/header.php index fe9ecab..608921c 100644 --- a/includes/header.php +++ b/includes/header.php @@ -1,16 +1,34 @@ + - <?php echo $config['app']['name']; ?> - - - - + <?php echo $title . " | " . $config['app']['name']; ?> + + + + + + - + + +