Time to do an update.
This commit is contained in:
parent
70c8a87e15
commit
0b0697bb42
22 changed files with 4352 additions and 268 deletions
76
mixshow.php
76
mixshow.php
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once 'includes/globals.php';
|
||||
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
use DJMixHosting\Database;
|
||||
|
@ -52,17 +51,19 @@ require_once 'includes/header.php';
|
|||
<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
|
||||
<h5 class="my-3"><?php echo $mixshow->get_name(); ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
<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 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>
|
||||
|
@ -163,6 +164,59 @@ require_once 'includes/header.php';
|
|||
</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/mixshow/' . $_GET['mixshow'];
|
||||
$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>
|
||||
</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">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue