1
0
www.mikescher.com/www/pages/blog_view.php
Mike Schwörer 300992b49f
All checks were successful
Build Docker and Deploy / Build Docker (push) Successful in 1m18s
Build Docker and Deploy / Deploy to Server (push) Successful in 27s
Added ProjectLawful-ebook downloads (blog::29)
2023-09-11 19:59:07 +02:00

60 lines
1.5 KiB
PHP

<?php
require_once (__DIR__ . '/../internals/website.php');
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
/** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE;
?>
<?php
$id = $ROUTE->parameter['id'];
$subview = $ROUTE->parameter['subview'];
$post = $SITE->modules->Blog()->getFullBlogpost($id, $subview, $err);
if ($post === null) { $FRAME_OPTIONS->setForced404($err); return; }
$FRAME_OPTIONS->title = $post['title'];
$FRAME_OPTIONS->canonical_url = $post['canonical'];
if ($post['type'] == 'euler')
$FRAME_OPTIONS->activeHeader = 'euler';
else if ($post['type'] == 'aoc')
$FRAME_OPTIONS->activeHeader = 'aoc';
else
$FRAME_OPTIONS->activeHeader = 'blog';
?>
<div class="blockcontent">
<div class="contentheader"><h1><?php echo htmlspecialchars($post['title']); ?></h1><hr/></div>
<?php
if ($post['type'] === 'plain')
{
echo $SITE->fragments->BlogviewPlain($post);
}
elseif ($post['type'] === 'markdown')
{
echo $SITE->fragments->BlogviewMarkdown($post);
}
elseif ($post['type'] === 'html')
{
echo $SITE->fragments->BlogviewHTML($post);
}
elseif ($post['type'] === 'euler')
{
if ($subview === '') echo $SITE->fragments->BlogviewEulerList($post);
else echo $SITE->fragments->BlogviewEulerSingle($post, $subview);
}
elseif ($post['type'] === 'aoc')
{
if ($subview === '') echo $SITE->fragments->BlogviewAdventOfCodeList($post);
else echo $SITE->fragments->BlogviewAdventOfCodeSingle($post, $subview);
}
?>
</div>