Time to do an update.
This commit is contained in:
parent
70c8a87e15
commit
0b0697bb42
22 changed files with 4352 additions and 268 deletions
233
genre.php
233
genre.php
|
@ -17,10 +17,10 @@ if (isset($_GET['genre']) && $_GET['genre'] != "") {
|
|||
if ($genre->get_name() != "") {
|
||||
$genreRequested = true;
|
||||
$genreFound = true;
|
||||
$title = $genre->get_name();
|
||||
}
|
||||
}
|
||||
|
||||
$title = $genre->get_name();
|
||||
|
||||
require_once 'includes/header.php';
|
||||
?>
|
||||
|
@ -45,104 +45,167 @@ require_once 'includes/header.php';
|
|||
</div>
|
||||
</div>
|
||||
<?php if ($genreFound): ?>
|
||||
<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 $genre->get_img(); ?>"
|
||||
alt="avatar"
|
||||
class="rounded-circle img-fluid" style="width: 150px;">
|
||||
<h5 class="my-3"><?php echo $genre->get_name();
|
||||
?></h5>
|
||||
<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 $genre->get_img(); ?>"
|
||||
alt="avatar"
|
||||
class="rounded-circle img-fluid" style="width: 150px;">
|
||||
<h5 class="my-3"><?php echo $genre->get_name();
|
||||
?></h5>
|
||||
|
||||
</p>
|
||||
<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>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-body bg-body-secondary text-center ">
|
||||
<a type="button" id="followBtn" class="w-100 mb-2 btn btn-secondary">
|
||||
<?php echo $locale['follow']; ?>
|
||||
</a>
|
||||
<button type="button" id="shareBtn" class="w-100 mb-2 btn btn-secondary"
|
||||
data-bs-toggle="modal" data-bs-target="#shareModal">
|
||||
<?php echo $locale['share']; ?>
|
||||
</button>
|
||||
|
||||
</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['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>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0"><?php echo $genre->get_count(); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<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>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0"><?php echo $genre->get_count(); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card mb-4">
|
||||
<div class="card-body bg-body-secondary">
|
||||
<?php
|
||||
$count = 0;
|
||||
$mixes = $genre->get_mixes();
|
||||
foreach ($mixes as $mix) {
|
||||
$output = new Mix($mix, $db);
|
||||
echo '<div class="row">';
|
||||
echo '<p class="mb-0">';
|
||||
echo '<a href="/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/' . $dj->getSlug() . '">';
|
||||
echo $dj->getName();
|
||||
echo '</a>';
|
||||
$djCount++;
|
||||
if ($djCount < count($djs)) {
|
||||
echo ', ';
|
||||
}
|
||||
}
|
||||
echo '</p>';
|
||||
echo ' </div>';
|
||||
$count++;
|
||||
if ($count < count($mixes)) {
|
||||
echo '<hr>';
|
||||
}
|
||||
|
||||
<?php
|
||||
$count = 0;
|
||||
$mixes = $genre->get_mixes();
|
||||
foreach ($mixes as $mix) {
|
||||
$output = new Mix($mix, $db);
|
||||
echo '<div class="row">';
|
||||
echo '<p class="mb-0">';
|
||||
echo '<a href="/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/' . $dj->getSlug() . '">';
|
||||
echo $dj->getName();
|
||||
echo '</a>';
|
||||
$djCount++;
|
||||
if ($djCount < count($djs)) {
|
||||
echo ', ';
|
||||
}
|
||||
}
|
||||
echo '</p>';
|
||||
echo ' </div>';
|
||||
$count++;
|
||||
if ($count < count($mixes)) {
|
||||
echo '<hr>';
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php echo $locale['genreNotFound']; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="shareModal" tabindex="-1" aria-labelledby="shareModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="shareModalLabel"><?php echo $locale['share']; ?></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php
|
||||
$url = 'https://utahsdjs.com/genre/' . $_GET['genre'];
|
||||
$utm_params = '?utm_source=website&utm_medium=share_modal&utm_campaign=sharing';
|
||||
$share_url = urlencode($url . $utm_params);
|
||||
?>
|
||||
<a href="#" id="copyLinkBtn" class="btn btn-secondary w-100 mb-2">Copy URL</a>
|
||||
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $share_url; ?>"
|
||||
target="_blank" class="btn btn-primary w-100 mb-2" onclick="hideModal()">Share to
|
||||
Facebook</a>
|
||||
<a href="https://twitter.com/intent/tweet?url=<?php echo $share_url; ?>"
|
||||
target="_blank" class="btn btn-info w-100 mb-2" onclick="hideModal()">Share to
|
||||
Twitter</a>
|
||||
<a href="https://www.instagram.com/" target="_blank" class="btn btn-danger w-100"
|
||||
onclick="hideModal()">Share to Instagram</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
?>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var shareBtn = document.getElementById('shareBtn');
|
||||
var shareModal = new bootstrap.Modal(document.getElementById('shareModal'));
|
||||
var copyLinkBtn = document.getElementById("copyLinkBtn");
|
||||
var urlToCopy = window.location.href + '?utm_source=website&utm_medium=share_modal&utm_campaign=sharing';
|
||||
|
||||
shareBtn.addEventListener('click', function () {
|
||||
shareModal.show();
|
||||
});
|
||||
|
||||
copyLinkBtn.onclick = function () {
|
||||
navigator.clipboard.writeText(urlToCopy).then(function () {
|
||||
alert('URL copied to clipboard');
|
||||
shareModal.hide();
|
||||
}, function (err) {
|
||||
alert('Failed to copy URL: ' + err);
|
||||
});
|
||||
}
|
||||
|
||||
window.hideModal = function () {
|
||||
shareModal.hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php else: ?>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php echo $locale['genreNotFound']; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue