parent
8b4dfe0c0c
commit
ef4eedcd6e
@ -9,9 +9,10 @@ class Mixshow
|
||||
private $slug = "";
|
||||
private $db = null;
|
||||
private $description = "";
|
||||
private $cover = "";
|
||||
private $cover = "img/no-image1.png";
|
||||
private $count;
|
||||
private $mixes = [];
|
||||
private $updated;
|
||||
|
||||
public function __construct($value, $db)
|
||||
{
|
||||
@ -29,7 +30,7 @@ class Mixshow
|
||||
private function load_by_id()
|
||||
{
|
||||
$mixshow = $this->get_mixshow_by_id();
|
||||
if ($mixshow && $mixshow['title'] != "") {
|
||||
if ($mixshow && $mixshow['name'] != "") {
|
||||
return $this->build_mixshow($mixshow);
|
||||
} else {
|
||||
return false;
|
||||
@ -52,8 +53,16 @@ class Mixshow
|
||||
$this->name = $mixshow['name'];
|
||||
$this->slug = $mixshow['slug'];
|
||||
$this->description = $mixshow['description'];
|
||||
$this->cover = $mixshow['cover'];
|
||||
$this->enabled = $mixshow['enabled'];
|
||||
// is this legacy code?
|
||||
// the code is legacy if it starts with /dj/,
|
||||
// if it does, prefix with https://www.utahsdjs.com
|
||||
if (substr($mixshow['cover'], 0, 5) == "/djs/") {
|
||||
// remove /djs/ from the string
|
||||
$mixshow['cover'] = substr($mixshow['cover'], 4);
|
||||
$this->cover = "https://cdn.utahsdjs.com" . $mixshow['cover'];
|
||||
}
|
||||
|
||||
$this->updated = $mixshow['lastupdated'];
|
||||
$this->count = $mixshow['count'];
|
||||
$this->load_mixes();
|
||||
return true;
|
||||
@ -61,7 +70,7 @@ class Mixshow
|
||||
|
||||
private function load_mixes()
|
||||
{
|
||||
$stmt = $this->db->prepare("SELECT value FROM mix_meta WHERE value = ?");
|
||||
$stmt = $this->db->prepare("SELECT mix_id FROM mix_meta WHERE value = ? AND attribute = 'mixshow'");
|
||||
$stmt->bind_param("i", $this->id);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
@ -74,7 +83,7 @@ class Mixshow
|
||||
private function load_by_slug()
|
||||
{
|
||||
$mixshow = $this->get_mixshow_by_slug();
|
||||
if ($mixshow && $mixshow['title'] != "") {
|
||||
if ($mixshow && $mixshow['name'] != "") {
|
||||
return $this->build_mixshow($mixshow);
|
||||
} else {
|
||||
return false;
|
||||
@ -130,5 +139,8 @@ class Mixshow
|
||||
return $this->mixes;
|
||||
}
|
||||
|
||||
public function get_updated(){
|
||||
return $this->updated;
|
||||
}
|
||||
|
||||
}
|
53
classes/Mixshows.php
Normal file
53
classes/Mixshows.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
class Mixshows
|
||||
{
|
||||
|
||||
private $db;
|
||||
private $mixshows = [];
|
||||
|
||||
public function __construct($db)
|
||||
{
|
||||
|
||||
$this->db = $db;
|
||||
if (!$this->load_all_mixshows()) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function load_all_mixshows(): bool
|
||||
{
|
||||
$mixshows = $this->get_all_mixshows();
|
||||
if ($mixshows) {
|
||||
$this->mixshows = $mixshows;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function get_all_mixshows($order = "ASC")
|
||||
{
|
||||
$stmt = $this->db->prepare("SELECT * FROM shows ORDER BY name $order");
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$mixshows = $result->fetch_all(MYSQLI_ASSOC);
|
||||
$stmt->close();
|
||||
return $mixshows;
|
||||
}
|
||||
|
||||
public function get_nonzero_mixshows()
|
||||
{
|
||||
$stmt = $this->db->prepare("SELECT * FROM shows WHERE count > 0 ORDER BY name ASC");
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$mixshows = $result->fetch_all(MYSQLI_ASSOC);
|
||||
$stmt->close();
|
||||
return $mixshows;
|
||||
}
|
||||
}
|
50
classes/User.php
Normal file
50
classes/User.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Random\RandomException;
|
||||
|
||||
Class User{
|
||||
|
||||
private $db;
|
||||
private $id;
|
||||
private $username;
|
||||
private $email;
|
||||
private $location;
|
||||
private $bio;
|
||||
private $created;
|
||||
private $updated;
|
||||
private $verified;
|
||||
private $role;
|
||||
private $img;
|
||||
private $api_key;
|
||||
|
||||
public function __construct($db){
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RandomException
|
||||
*/
|
||||
public function newUser($username, $password, $email){
|
||||
$this->username = $username;
|
||||
$this->email = $email;
|
||||
$password2 = password_hash($password, PASSWORD_DEFAULT);
|
||||
$this->password = $password2;
|
||||
|
||||
$this->location = "";
|
||||
$this->bio = "";
|
||||
$this->created = date('Y-m-d H:i:s');
|
||||
$this->updated = date('Y-m-d H:i:s');
|
||||
$this->verified = 0;
|
||||
$this->role = "user";
|
||||
$this->img = "";
|
||||
$this->api_key = bin2hex(random_bytes(32));
|
||||
|
||||
$stmt = $this->db->prepare("INSERT INTO users (username, password, email, img) VALUES (?, ?, ?, ?)");
|
||||
$stmt->bind_param("ssss", $this->username, $this->password, $this->email, $this->img);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
40
dj.php
40
dj.php
@ -72,7 +72,7 @@ require_once 'includes/header.php';
|
||||
if ($dj->get_socials() != []) {
|
||||
?>
|
||||
<div class="card mb-4 mb-lg-0">
|
||||
<div class="card-body p-0 " >
|
||||
<div class="card-body p-0 ">
|
||||
<ul class="list-group list-group-flush rounded-3">
|
||||
<?php
|
||||
$socials = $dj->get_socials();
|
||||
@ -123,22 +123,23 @@ require_once 'includes/header.php';
|
||||
$genrelist[$genr->get_slug()] = $genr->get_name();
|
||||
}
|
||||
|
||||
echo '<div class="row">'; // Start row for each mix
|
||||
echo '<div class="row ">'; // Start row for each mix
|
||||
|
||||
// Column for mix name and link
|
||||
echo '<div class="col-md-4">';
|
||||
echo '<p class="mb-0">';
|
||||
echo '<a href="/mix.php?mix=' . $output->get_slug() . '">';
|
||||
echo '<div class="col-md text-truncate" >';
|
||||
echo '<p class="mb-0 " >';
|
||||
echo '<a title="' . $output->get_name() . '" href="/mix.php?mix=' . $output->get_slug() . '">';
|
||||
echo $output->get_name();
|
||||
echo '</a>';
|
||||
echo '</p>';
|
||||
echo '</div>'; // End column
|
||||
|
||||
// Column for genres
|
||||
echo '<div class="col-md-4">';
|
||||
echo '<div class="col-md ">';
|
||||
echo '<p class="mb-0">';
|
||||
foreach ($genrelist as $slug => $name) {
|
||||
echo ' <a href="/genre.php?genre=' . $slug . '">';
|
||||
// ellipse the genre name if it's too long
|
||||
echo '<span class="">' . $name . '</span>';
|
||||
echo '</a>';
|
||||
}
|
||||
@ -146,12 +147,27 @@ require_once 'includes/header.php';
|
||||
echo '</div>'; // End column
|
||||
|
||||
// Column for duration
|
||||
echo '<div class="col-md-4">';
|
||||
echo '<div class="col-md">';
|
||||
echo '<p class="mb-0">';
|
||||
$duration = $output->get_duration();
|
||||
echo $duration['t'];
|
||||
echo '</p>';
|
||||
echo '</div>'; // End column
|
||||
|
||||
// Column for date
|
||||
echo '<div class="col-md">';
|
||||
echo '<p class="mb-0">';
|
||||
// date format should just be year
|
||||
$date = $output->get_recorded();
|
||||
if ($date == "") {
|
||||
$date = $output->get_created();
|
||||
}
|
||||
echo date('Y', strtotime($date));
|
||||
|
||||
echo '</p>';
|
||||
echo '</div>'; // End column
|
||||
|
||||
|
||||
echo '</div>'; // End row
|
||||
|
||||
$count++;
|
||||
@ -168,12 +184,12 @@ require_once 'includes/header.php';
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php echo $locale['djNotFound']; ?>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php echo $locale['djNotFound']; ?>
|
||||
</div>
|
||||
</div><?php endif;?>
|
||||
</div>
|
||||
</div><?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
22
genre.php
22
genre.php
@ -66,6 +66,16 @@ require_once 'includes/header.php';
|
||||
<div class="col-lg-8">
|
||||
<div class="card mb-4">
|
||||
<div class="card-body bg-body-secondary">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0"><?php echo $locale['genre']; ?></p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0"><?php echo $genre->get_name(); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0"><?php echo $locale['mix-count']; ?></p>
|
||||
@ -92,6 +102,18 @@ require_once 'includes/header.php';
|
||||
echo '<a href="/mix.php?mix=' . $output->get_slug() . '">';
|
||||
echo $output->get_name();
|
||||
echo '</a>';
|
||||
echo ' ‐ ';
|
||||
$djs = $output->get_djs();
|
||||
$djCount = 0;
|
||||
foreach ($djs as $dj) {
|
||||
echo '<a href="/dj.php?dj=' . $dj->get_slug() . '">';
|
||||
echo $dj->get_name();
|
||||
echo '</a>';
|
||||
$djCount++;
|
||||
if ($djCount < count($djs)) {
|
||||
echo ', ';
|
||||
}
|
||||
}
|
||||
echo '</p>';
|
||||
echo ' </div>';
|
||||
$count++;
|
||||
|
@ -25,7 +25,7 @@ function card_output(int $count, mixed $dj, mixed $locale): void
|
||||
echo '<div class="col-md-3">';
|
||||
echo '<div class="card mb-4">';
|
||||
echo '<div class="card-body bg-body-secondary">';
|
||||
echo '<h5 class="card-title" title="' . $dj['name'] . '">' . $dj['name'] . '</h5>';
|
||||
echo '<h5 class="card-title text-truncate" title="' . $dj['name'] . '">' . $dj['name'] . '</h5>';
|
||||
echo '<p class="card-text">' . $dj['count'] . ' ';
|
||||
if ($dj['count'] == 1) {
|
||||
echo $locale['mix'];
|
||||
|
@ -41,6 +41,12 @@ $current_lang = $_SESSION['lang'] ?? $config['app']['locale'];
|
||||
echo current_list();
|
||||
} ?>" href="/djs.php"><?php echo $locale['djs']; ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link<?php
|
||||
if (basename($_SERVER['SCRIPT_NAME']) == 'mixshows.php') {
|
||||
echo current_list();
|
||||
} ?>" href="/mixshows.php"><?php echo $locale['mixshows']; ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
|
@ -2,6 +2,7 @@
|
||||
return [
|
||||
'welcome' => 'Welcome to our Website!',
|
||||
'description' => 'This is a description in English.',
|
||||
'desc' => 'Description',
|
||||
'userProfile' => "User Profile",
|
||||
'user' => 'User',
|
||||
'home' => 'Home',
|
||||
@ -23,6 +24,7 @@ return [
|
||||
"mixes" => "Mixes",
|
||||
"mix" => "Mix",
|
||||
"mixNotFound" => "Could not load mix; either the mix wasn't found, was empty, or this mix is private.",
|
||||
"mixshowNotFound" => "Could not load mixshow; either the mixshow wasn't found, was empty, or this mixshow is private.",
|
||||
"mixName" => "Mix Name",
|
||||
"mixDescription" => "Mix Description",
|
||||
"mixLength" => "Mix Length",
|
||||
@ -53,6 +55,9 @@ return [
|
||||
"play" => "Play",
|
||||
"contactus" => "Contact Us",
|
||||
"allrightsreserved" => "All rights reserved.",
|
||||
"mixshows" => "Mixshows",
|
||||
"mixshow" => "Mixshow",
|
||||
"mixshowName" => "Mixshow Name",
|
||||
|
||||
|
||||
|
||||
|
58
login.php
Normal file
58
login.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
require_once 'includes/globals.php';
|
||||
$title = $locale['home'];
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if (isset($_POST['username']) && isset($_POST['password'])) {
|
||||
$username = $_POST['username'];
|
||||
$password = $_POST['password'];
|
||||
|
||||
$db = new Database($config);
|
||||
$user = new User($db);
|
||||
$user->login($username, $password);
|
||||
}
|
||||
}
|
||||
|
||||
require_once 'includes/header.php'; ?>
|
||||
<section>
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<nav aria-label="breadcrumb" class="bg-body-tertiary rounded-3 p-3 mb-4">
|
||||
<ol class="breadcrumb mb-0">
|
||||
<li class="breadcrumb-item"><a href="/"><?php echo $locale['home']; ?></a></li>
|
||||
<li class="breadcrumb-item active"><a href="/login.php"><?php echo $locale['login']; ?></a></li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 offset-lg-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><?php echo $locale['login']; ?></h5>
|
||||
<form action="login.php" method="post">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label"><?php echo $locale['username']; ?></label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label"><?php echo $locale['password']; ?></label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $locale['login']; ?></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<?php require_once 'includes/footer.php'; ?>
|
36
mix.php
36
mix.php
@ -150,6 +150,34 @@ require_once 'includes/header.php'; ?>
|
||||
?>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
|
||||
<?php
|
||||
$mixshows = $mix->get_mixshow();
|
||||
$mixshowsCount = count($mixshows);
|
||||
if ($mixshowsCount > 0) {
|
||||
?>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0"><?php echo $locale['mixshow'] ?></p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($mixshows as $mixshow) {
|
||||
$mixshow = new Mixshow($mixshow, $db);
|
||||
echo "<a href='/mixshow.php?mixshow=";
|
||||
echo $mixshow->get_slug();
|
||||
echo "'>" . $mixshow->get_name() . "</a>";
|
||||
if ($i < $mixshowsCount - 1) {
|
||||
echo ", ";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
@ -303,13 +331,13 @@ require_once 'includes/header.php'; ?>
|
||||
|
||||
<?php
|
||||
if ($mix->get_tracklist() != []) {
|
||||
echo "<div class='card mb-4'>";
|
||||
echo "<div class='card-body'>";
|
||||
echo "<div class='card mb-4 bg-body-secondary'>";
|
||||
echo "<div class='card-body '>";
|
||||
echo "<p class='mb-4'><span class='text-primary font-italic me-1'>" . $locale['tracklist'] . "</span></p>";
|
||||
echo "<ul class='list-group list-group-flush rounded-3'>";
|
||||
echo "<ul class='list-group list-group-flush rounded-3 bg-body-secondary'>";
|
||||
$tracklist = $mix->get_tracklist();
|
||||
foreach ($tracklist as $track) {
|
||||
echo "<li class='list-group-item d-flex justify-content-between align-items-center'>";
|
||||
echo "<li class='list-group-item bg-body-secondary d-flex justify-content-between align-items-center'>";
|
||||
echo $track;
|
||||
echo "</li>";
|
||||
}
|
||||
|
174
mixshow.php
Normal file
174
mixshow.php
Normal file
@ -0,0 +1,174 @@
|
||||
<?php
|
||||
|
||||
require_once 'includes/globals.php';
|
||||
require_once 'classes/Database.php';
|
||||
require_once 'classes/Mixshow.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);
|
||||
$mixshowFound = false;
|
||||
if (isset($_GET['mixshow']) && $_GET['mixshow'] != "") {
|
||||
$mixshow = new Mixshow($_GET['mixshow'], $db);
|
||||
if ($mixshow->get_name() != "") {
|
||||
|
||||
$mixshowFound = true;
|
||||
}
|
||||
}
|
||||
$title = $mixshow->get_name();
|
||||
require_once 'includes/header.php';
|
||||
?>
|
||||
<section>
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<nav aria-label="breadcrumb" class="bg-body-tertiary rounded-3 p-3 mb-4">
|
||||
<ol class="breadcrumb mb-0">
|
||||
<li class="breadcrumb-item"><a href="/"><?php echo $locale['home']; ?></a></li>
|
||||
<li class="breadcrumb-item"><a href="/mixshows.php"><?php echo $locale['mixshows']; ?></a></li>
|
||||
<li class="breadcrumb-item active"
|
||||
aria-current="page"><?php
|
||||
if ($mixshow && $mixshow->get_name() != "") {
|
||||
echo $mixshow->get_name();
|
||||
} else {
|
||||
echo $locale['notfound'];
|
||||
}
|
||||
?></li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($mixshowFound): ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div class="card mb-4">
|
||||
<div class="card-body bg-body-secondary text-center">
|
||||
<img src="<?php echo $mixshow->get_cover(); ?>"
|
||||
alt="avatar"
|
||||
class="rounded-circle img-fluid" style="width: 150px;">
|
||||
<h5 class="my-3"><?php echo $mixshow->get_name();
|
||||
?></h5>
|
||||
<?php
|
||||
|
||||
|
||||
?>
|
||||
<div class="d-flex justify-content-center mb-2">
|
||||
<button type="button" data-mdb-button-init data-mdb-ripple-init class="btn btn-primary">
|
||||
<?php echo $locale['follow']; ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="card mb-4">
|
||||
<div class="card-body bg-body-secondary">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0"><?php echo $locale['mixshowName']; ?></p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0"><?php echo $mixshow->get_name(); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if ($mixshow->get_description() != "") {
|
||||
echo box_line($locale['desc'], $mixshow->get_description());
|
||||
}
|
||||
echo box_line($locale['lastupdated'], $mixshow->get_updated());
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card mb-4">
|
||||
<div class="card-body bg-body-secondary">
|
||||
<?php
|
||||
$mixes = $mixshow->get_mixes();
|
||||
$count = 0;
|
||||
|
||||
foreach ($mixes as $mix) {
|
||||
$output = new Mix($mix['mix_id'], $db);
|
||||
$genres = $output->get_genres();
|
||||
$genrelist = [];
|
||||
|
||||
foreach ($genres as $genre) {
|
||||
$genr = new Genre($genre, $db);
|
||||
$genrelist[$genr->get_slug()] = $genr->get_name();
|
||||
}
|
||||
|
||||
echo '<div class="row">'; // Start row for each mix
|
||||
|
||||
// Column for mix name and link
|
||||
echo '<div class="col-md">';
|
||||
echo '<p class="mb-0 " >';
|
||||
echo '<a href="/mix.php?mix=' . $output->get_slug() . '">';
|
||||
echo $output->get_name();
|
||||
echo '</a>';
|
||||
echo '</p>';
|
||||
echo '</div>'; // End column
|
||||
|
||||
// Column for genres
|
||||
echo '<div class="col-md ">';
|
||||
echo '<p class="mb-0">';
|
||||
foreach ($genrelist as $slug => $name) {
|
||||
echo ' <a href="/genre.php?genre=' . $slug . '">';
|
||||
// ellipse the genre name if it's too long
|
||||
echo '<span class="">' . $name . '</span>';
|
||||
echo '</a>';
|
||||
}
|
||||
echo '</p>';
|
||||
echo '</div>'; // End column
|
||||
|
||||
// Column for duration
|
||||
echo '<div class="col-md">';
|
||||
echo '<p class="mb-0">';
|
||||
$duration = $output->get_duration();
|
||||
echo $duration['t'];
|
||||
echo '</p>';
|
||||
echo '</div>'; // End column
|
||||
|
||||
// Column for date
|
||||
echo '<div class="col-md">';
|
||||
echo '<p class="mb-0">';
|
||||
// date format should just be year
|
||||
$date = $output->get_recorded();
|
||||
if ($date == "") {
|
||||
$date = $output->get_created();
|
||||
}
|
||||
echo date('Y', strtotime($date));
|
||||
|
||||
echo '</p>';
|
||||
echo '</div>'; // End column
|
||||
|
||||
|
||||
echo '</div>'; // End row
|
||||
|
||||
$count++;
|
||||
// Add horizontal rule only if it's not the last mix
|
||||
if ($count < count($mixes)) {
|
||||
echo '<hr>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php echo $locale['mixshowNotFound']; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div><?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php require_once 'includes/footer.php'; ?>
|
46
mixshows.php
Normal file
46
mixshows.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
require_once 'includes/globals.php';
|
||||
require_once 'classes/Database.php';
|
||||
require_once 'classes/Mixshows.php';
|
||||
require_once 'classes/DJs.php';
|
||||
|
||||
$db = new Database($config);
|
||||
$mixshows = new Mixshows($db);
|
||||
$title = $locale['mixshows'];
|
||||
require_once 'includes/header.php';
|
||||
?>
|
||||
<section>
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<nav aria-label="breadcrumb" class="bg-body-tertiary rounded-3 p-3 mb-4">
|
||||
<ol class="breadcrumb mb-0">
|
||||
<li class="breadcrumb-item"><a href="/"><?php echo $locale['home']; ?></a></li>
|
||||
<li class="breadcrumb-item active"><a href="/mixshows.php"><?php echo $locale['mixshows']; ?></a>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$mixshows = $mixshows->get_nonzero_mixshows();
|
||||
$count = 0;
|
||||
foreach ($mixshows as $mixshow) {
|
||||
card_output($count, $mixshow, $locale);
|
||||
echo '<a href="/mixshow.php?mixshow=' . $mixshow['slug'] . '" class="btn btn-primary">' . $locale['view'] . '</a>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
if ($count % 4 == 3) {
|
||||
echo '</div>';
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
<?php require_once 'includes/footer.php'; ?>
|
Loading…
x
Reference in New Issue
Block a user