Fixed empty landing page
This commit is contained in:
parent
ab07d7ab35
commit
469243897b
1 changed files with 27 additions and 1 deletions
28
index.php
28
index.php
|
|
@ -118,6 +118,31 @@ function render_404_page(){
|
|||
exit;
|
||||
}
|
||||
|
||||
function render_blank_page(){
|
||||
$headerTitles = require __DIR__ . '/header_titles.php';
|
||||
$siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
|
||||
$brandUrl = '/';
|
||||
?>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>MVLog</title>
|
||||
<link rel="icon" type="image/png" href="assets/img/moto_travel.png">
|
||||
<link rel="stylesheet" href="style.css?v=20260531u">
|
||||
<style>html,body{height:100%;overflow:hidden}body{height:100dvh}main{flex:1;min-height:0}</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php include __DIR__ . '/_header.php'; ?>
|
||||
<main></main>
|
||||
<?php include __DIR__ . '/_footer.php'; ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
exit;
|
||||
}
|
||||
|
||||
function video_metadata($path){
|
||||
$base = pathinfo($path, PATHINFO_FILENAME);
|
||||
$meta = [
|
||||
|
|
@ -229,9 +254,10 @@ usort($videos, function($a, $b) use ($videoCache) {
|
|||
});
|
||||
|
||||
$articleId = trim((string)($_GET['id'] ?? ''));
|
||||
if ($articleId === '' || !preg_match('/^[0-9]{14}[a-f0-9]{16}$/', $articleId) || count(array_diff_key($_GET, ['id' => true])) > 0) {
|
||||
if ($articleId !== '' && (!preg_match('/^[0-9]{14}[a-f0-9]{16}$/', $articleId) || count(array_diff_key($_GET, ['id' => true])) > 0)) {
|
||||
render_404_page();
|
||||
}
|
||||
render_blank_page();
|
||||
|
||||
if ($articleId !== '') {
|
||||
$videos = array_values(array_filter($videos, function($v) use ($articleId, $config) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue