Add font support, start support for genres.

This commit is contained in:
Cody Cook 2024-04-29 23:27:28 -07:00
commit 9a3d58fc83
2142 changed files with 373269 additions and 29 deletions

View file

@ -7,13 +7,15 @@ class DJ
private string $name = "";
private string $bio = "";
private string $slug = "";
private string $img = "";
private string $img = "img/no-image1.png";
private bool $active = false;
private bool $claimed = false;
private string $email = "";
private array $socials = [];
private string $created = "";
private string $updated = "";
private string $claimed_by = "";
private $db = null;
@ -30,6 +32,7 @@ class DJ
private function load_from_slug(): bool
{
$socials = [];
$dj = $this->get_dj_by_slug($this->slug);
if ($dj) {
if (isset($dj['id'])) {
@ -42,14 +45,57 @@ class DJ
$this->bio = $dj['bio'];
}
if (isset($dj['img'])) {
$this->img = $dj['img'];
// is this legacy code?
// the code is legacy if it starts with /dj/,
// if it does, prefix with https://www.utahsdjs.com
if (substr($dj['img'], 0, 5) == "/djs/") {
// remove /djs/ from the string
$dj['img'] = substr($dj['img'], 4);
$this->img = "https://cdn.utahsdjs.com" . $dj['img'];
} else {
$this->img = $dj['img'];
}
}
if (isset($dj['email'])) {
$this->email = $dj['email'];
}
if (isset($dj['socials'])) {
$this->socials = json_decode($dj['socials'], true) ?? [];
if (isset($dj['facebook_url'])) {
$this->socials['facebook'] = $dj['facebook_url'];
}
if (isset($dj['instagram_url'])) {
$this->socials['instagram'] = $dj['instagram_url'];
}
if (isset($dj['twitter_url'])) {
$this->socials['twitter'] = $dj['twitter_url'];
}
if (isset($dj['myspace_url'])) {
$this->socials['myspace'] = $dj['myspace_url'];
}
if (isset($dj['soundcloud_url'])) {
$this->socials['soundcloud'] = $dj['soundcloud_url'];
}
if (isset($dj['mixcloud_url'])) {
$this->socials['mixcloud'] = $dj['mixcloud_url'];
}
if (isset($dj['spotify_url'])) {
$this->socials['spotify'] = $dj['spotify_url'];
}
if (isset($dj['active'])) {
$this->active = $dj['active'];
}
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'])) {
$this->created = $dj['created'];
}
@ -124,5 +170,10 @@ class DJ
return $this->updated;
}
public function get_claimed(): bool
{
return $this->claimed;
}
}