Dev #232
4 changed files with 101 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ if ($host == 'dev.dtch.online') {
|
||||||
<a href="latestmatches.php">Last Matches</a>
|
<a href="latestmatches.php">Last Matches</a>
|
||||||
<a href="topstats.php">Top20</a>
|
<a href="topstats.php">Top20</a>
|
||||||
<a href="user_stats.php">User Stats</a>
|
<a href="user_stats.php">User Stats</a>
|
||||||
|
<a href="videos.php">Videos</a>
|
||||||
</div>
|
</div>
|
||||||
<a href="javascript:void(0);" class="icon" onclick="myFunction()">
|
<a href="javascript:void(0);" class="icon" onclick="myFunction()">
|
||||||
<i class="fa fa-bars"></i>
|
<i class="fa fa-bars"></i>
|
||||||
|
|
|
||||||
|
|
@ -240,3 +240,25 @@ td, th {
|
||||||
background-color: #0f0f0f;
|
background-color: #0f0f0f;
|
||||||
color: #e69109;
|
color: #e69109;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Videos page styles */
|
||||||
|
.videos-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 16px;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
.video-item {
|
||||||
|
flex: 1 1 300px;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.video-item video {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 80vh;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
object-fit: contain;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,3 +82,22 @@ section h2 {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/* Videos page responsive adjustments */
|
||||||
|
.videos-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 16px;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
.video-item {
|
||||||
|
flex: 1 1 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.video-item video {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
58
videos.php
Normal file
58
videos.php
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
$ogDescription = "Bekijk alle video's";
|
||||||
|
|
||||||
|
// Scan the media/videos directory for mp4 files
|
||||||
|
$videosDir = __DIR__ . '/media/videos';
|
||||||
|
$allFiles = scandir($videosDir);
|
||||||
|
$videoFiles = array_filter($allFiles, function($file) use ($videosDir) {
|
||||||
|
return is_file($videosDir . '/' . $file) && strtolower(pathinfo($file, PATHINFO_EXTENSION)) === 'mp4';
|
||||||
|
});
|
||||||
|
|
||||||
|
// Build array with creation time and sort by creation date descending
|
||||||
|
$videoData = [];
|
||||||
|
foreach ($videoFiles as $file) {
|
||||||
|
$path = $videosDir . '/' . $file;
|
||||||
|
$videoData[] = [
|
||||||
|
'filename' => $file,
|
||||||
|
'ctime' => filectime($path)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
usort($videoData, function($a, $b) {
|
||||||
|
return $b['ctime'] - $a['ctime'];
|
||||||
|
});
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<?php include './includes/head.php'; ?>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<?php include './includes/navigation.php'; ?>
|
||||||
|
<?php include './includes/header.php'; ?>
|
||||||
|
<main>
|
||||||
|
<section>
|
||||||
|
<h2>Videos</h2>
|
||||||
|
|
||||||
|
<?php if (!empty($videoData)): ?>
|
||||||
|
<div class="videos-container">
|
||||||
|
<?php foreach ($videoData as $video): ?>
|
||||||
|
<div class="video-item">
|
||||||
|
<video controls>
|
||||||
|
<source src="media/videos/<?php echo htmlspecialchars($video['filename']); ?>" type="video/mp4">
|
||||||
|
Your browser does not support the video tag.
|
||||||
|
</video>
|
||||||
|
<p><?php echo pathinfo($video['filename'], PATHINFO_FILENAME); ?></p>
|
||||||
|
<p><?php echo date('d-m-Y H:i', $video['ctime']); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<p>No videos found.</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<?php include './includes/footer.php'; ?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue