Ttitles cleanup and logo positioning

This commit is contained in:
hbrain 2026-06-01 07:59:13 +02:00
parent a87d8d8920
commit 6343ebf654
3 changed files with 94 additions and 16 deletions

View file

@ -57,6 +57,17 @@ function map_hidden_outputs($config){
return $hidden;
}
function video_thumb_public_url($config, $videoName){
$videoName = basename((string)$videoName);
if ($videoName === '') return '';
$base = pathinfo($videoName, PATHINFO_FILENAME);
foreach (['jpg','jpeg','png','webp','gif'] as $ext) {
$file = $config['thumbs_dir'] . '/' . $base . '.' . $ext;
if (is_file($file)) return $config['public_thumbs'] . '/' . rawurlencode($base . '.' . $ext) . '?v=' . filemtime($file);
}
return '';
}
function video_metadata($path){
$base = pathinfo($path, PATHINFO_FILENAME);
$meta = [
@ -246,20 +257,12 @@ $headerTitles = [
'Many Voices of Life',
'Many Views of Life',
'Modern Vagabond Log',
'Motorcycle Wanderlust Log',
'Mapped Wanderings Log',
'Miles Beyond Reason',
'Miles Beyond Reality',
'Motion, Velocity & Lunacy',
'Miles, Wind & Luck',
'Maps, Villages & Legends',
'Multi-Vision Log',
'Multi-Vista Log',
'Mutable View Log',
'Mistakes, Victories & Lessons',
'Mostly Verified Legends',
'Mostly Vague Logistics',
'Marginally Viable Leadership',
'Mileage Versus Luck',
'Mechanical Violence Log',
'Moderately Violent Leisure',
@ -272,7 +275,7 @@ $siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title><?=h($siteHeaderTitle)?></title>
<title>MVL</title>
<link rel="alternate" type="application/rss+xml" title="MVLog RSS" href="feed.php">
<link rel="icon" type="image/png" href="assets/img/moto_travel.png">
<link rel="stylesheet" href="style.css">
@ -338,6 +341,7 @@ $siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
$name = basename($v);
$url = $config['public_videos'].'/'.rawurlencode($name);
$m = $videoCache[$name]['metadata'] ?? video_metadata($v);
$posterUrl = video_thumb_public_url($config, $name);
$dateFilterUrl = query_url(['q' => 'date=' . (string)($m['date'] ?? '')]);
$locFilterUrl = query_url(['q' => 'location=' . (string)($m['location'] ?? '')]);
?>
@ -352,7 +356,7 @@ $siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
</p>
</div>
<div class="video-wrapper">
<video controls controlsList="nodownload" oncontextmenu="return false" preload="metadata" src="<?=h($url)?>"></video>
<video controls controlsList="nodownload" oncontextmenu="return false" preload="metadata" src="<?=h($url)?>"<?= $posterUrl !== '' ? ' poster="'.h($posterUrl).'"' : '' ?>></video>
<?php
$map = pathinfo($name, PATHINFO_FILENAME).".png";
$hideMap = !empty($hiddenMapOutputs[$name]);