Address changes.

This commit is contained in:
Cody Cook 2025-02-22 17:20:19 -08:00
commit 635b3ddcbc
59 changed files with 7249 additions and 2745 deletions

View file

@ -69,7 +69,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
// Simple slugify function
function slugify($text) {
function slugify($text): string
{
$text = preg_replace('~[^\pL\d]+~u', '-', $text);
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
$text = preg_replace('~[^-\w]+~', '', $text);
@ -147,12 +148,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
unset($_SESSION['upload_task']);
$_SESSION['success'] = $locale['uploadedPendingApproval'];
header("Location: profile.php");
header("Location: /profile");
exit;
}
}
?>
<?php require_once 'includes/header.php'; ?>
require_once 'includes/header.php'; ?>
<section class="upload-section py-5">
<div class="container">
@ -170,46 +171,50 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<h3 class="card-title mb-4"><?php echo $locale['uploadHeader1'];?></h3>
<!-- Info Alert -->
<div class="alert alert-info">
<h4 class="alert-heading">Important Upload Information</h4>
<p>Utah's DJs is primarily an archival project dedicated to preserving the history and culture of EDM DJs in Utah. Your uploads contribute to this historical record.</p>
<h4 class="alert-heading"><?php echo $locale['uploadAlertHeader'];?></h4>
<p><?php echo $locale['uploadAlert1'];?></p>
</div>
<!-- Requirements -->
<h4 class="mb-3">Before You Upload</h4>
<h4 class="mb-3"><?php echo $locale['uploadHeader2'];?></h4>
<ul class="list-group list-group-flush mb-4">
<li class="list-group-item">
<i class="fas fa-check-circle text-success me-2"></i>
Verify that all DJs involved are listed in our database. If a DJ is not listed, they must be added and approved before uploading.
<?php echo $locale['uploadAlert2'];?>
</li>
<li class="list-group-item">
<i class="fas fa-check-circle text-success me-2"></i>
Check that appropriate genres are available for your mix. New genres require approval before they can be used.
<?php echo $locale['uploadAlert3'];?>
</li>
<li class="list-group-item">
<i class="fas fa-info-circle text-primary me-2"></i>
You can submit new DJ or genre requests through your profile settings.
<?php echo $locale['uploadAlert4'];?>
</li>
</ul>
<!-- Process Steps -->
<h4 class="mb-3">Upload Process</h4>
<h4 class="mb-3"><?php echo $locale['uploadProcess'];?></h4>
<ol class="list-group list-group-numbered mb-4">
<li class="list-group-item">Upload your mix file (MP3 or ZIP format)</li>
<li class="list-group-item">Enter mix details, including title, description, and recording date</li>
<li class="list-group-item">Select relevant genres and DJs</li>
<li class="list-group-item">Submit for review</li>
<li class="list-group-item"><?php echo $locale['uploadProcess1'];?></li>
<li class="list-group-item"><?php echo $locale['uploadProcess2'];?></li>
<li class="list-group-item"><?php echo $locale['uploadProcess3'];?></li>
<li class="list-group-item"><?php echo $locale['uploadProcess4'];?></li>
</ol>
<!-- Upload Form -->
<div class="card mt-4">
<div class="card-body">
<h4 class="card-title mb-4">Upload Your Mix</h4>
<h4 class="card-title mb-4"><?php echo $locale['uploadAMix'];?></h4>
<form action="/upload" method="post" enctype="multipart/form-data">
<input type="hidden" name="action" value="upload_file">
<div class="mb-3">
<label for="mix_file" class="form-label">Select Mix File (MP3 or ZIP)</label>
<input type="file" class="form-control" id="mix_file" name="mix_file" accept=".mp3,.zip" required>
<div class="form-text">Maximum file size: 500MB</div>
<label for="mix_file" class="form-label"><?php echo $locale['uploadSelectMix'];?></label>
<?php
// we need to take the file extensions from config allowed_file_types and comma separate them with periods
$acceptedFileTypes = implode(",", array_map(function($ext) { return "." . $ext; }, $config['uploads']['allowed_file_types']));
?>
<input type="file" class="form-control" id="mix_file" name="mix_file" accept="<?php echo $acceptedFileTypes; ?>" required>
<div class="form-text"><?php echo $locale['uploadMaxFileSize'];?></div>
</div>
<button type="submit" class="btn btn-primary">
<i class="fas fa-upload me-2"></i>Upload File
<i class="fas fa-upload me-2"></i><?php echo $locale['uploadFile'];?>
</button>
</form>
</div>
@ -246,19 +251,19 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<form action="/upload" method="post" class="needs-validation" novalidate>
<input type="hidden" name="action" value="submit_details">
<div class="mb-3">
<label for="title" class="form-label">Mix Title</label>
<label for="title" class="form-label"><?php echo $locale['mixName'];?></label>
<input type="text" class="form-control" id="title" name="title" required>
</div>
<div class="mb-3">
<label for="description" class="form-label">Mix Description</label>
<label for="description" class="form-label"><?php echo $locale['mixDescription'];?></label>
<textarea class="form-control" id="description" name="description" rows="3"></textarea>
</div>
<div class="mb-3">
<label for="recorded" class="form-label">Recorded Date</label>
<label for="recorded" class="form-label"><?php echo $locale['recordedDate'];?></label>
<input type="date" class="form-control" id="recorded" name="recorded" required>
</div>
<div class="mb-3">
<label for="genres" class="form-label">Select Genres (type to search)</label>
<label for="genres" class="form-label"><?php echo $locale['uploadSelectGenres'];?></label>
<select class="form-select" id="genres" name="genres[]" multiple required>
<?php foreach ($allGenres as $genre): ?>
<option value="<?php echo htmlspecialchars($genre['id']); ?>"><?php echo htmlspecialchars($genre['name']); ?></option>
@ -266,11 +271,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</select>
</div>
<div class="mb-3">
<label class="form-label">Select DJs (Maximum 3)</label>
<label class="form-label"><?php echo $locale['uploadSelectDJSMax3'];?></label>
<div class="row">
<div class="col">
<select class="form-select" name="dj1" required>
<option value="">Select DJ 1</option>
<option value=""><?php echo $locale['uploadSelectDJ1'];?></option>
<?php foreach ($allDJs as $dj): ?>
<option value="<?php echo htmlspecialchars($dj['id']); ?>"><?php echo htmlspecialchars($dj['name']); ?></option>
<?php endforeach; ?>
@ -278,7 +283,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</div>
<div class="col">
<select class="form-select" name="dj2">
<option value="">Select DJ 2 (Optional)</option>
<option value=""><?php echo $locale['uploadSelectDJ2'];?></option>
<?php foreach ($allDJs as $dj): ?>
<option value="<?php echo htmlspecialchars($dj['id']); ?>"><?php echo htmlspecialchars($dj['name']); ?></option>
<?php endforeach; ?>
@ -286,7 +291,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</div>
<div class="col">
<select class="form-select" name="dj3">
<option value="">Select DJ 3 (Optional)</option>
<option value=""><?php echo $locale['uploadSelectDJ3'];?></option>
<?php foreach ($allDJs as $dj): ?>
<option value="<?php echo htmlspecialchars($dj['id']); ?>"><?php echo htmlspecialchars($dj['name']); ?></option>
<?php endforeach; ?>
@ -294,7 +299,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Submit Mix</button>
<button type="submit" class="btn btn-primary"><?php echo $locale['uploadSubmitMix'];?></button>
</form>
</div>
</div>