1
0
www.mikescher.com/www/pages/blog_view.php

56 lines
1.5 KiB
PHP
Raw Normal View History

2017-12-30 23:11:51 +01:00
<?php
2020-01-16 10:50:18 +01:00
require_once (__DIR__ . '/../internals/website.php');
2019-11-02 20:19:34 +01:00
2020-01-16 10:50:18 +01:00
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
/** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE;
2017-12-30 23:11:51 +01:00
?>
2019-12-02 14:57:01 +01:00
<?php
2020-01-16 10:50:18 +01:00
$id = $ROUTE->parameter['id'];
$subview = $ROUTE->parameter['subview'];
2017-12-30 23:11:51 +01:00
2020-01-16 10:50:18 +01:00
$post = $SITE->modules->Blog()->getFullBlogpost($id, $subview, $err);
if ($post === null) { $FRAME_OPTIONS->setForced404($err); return; }
2017-12-30 23:11:51 +01:00
2020-01-16 10:50:18 +01:00
$FRAME_OPTIONS->title = 'Mikescher.com - ' . $post['title'];
$FRAME_OPTIONS->canonical_url = $post['canonical'];
2017-12-30 23:11:51 +01:00
2020-01-16 10:50:18 +01:00
if ($post['type'] == 'euler')
$FRAME_OPTIONS->activeHeader = 'euler';
else if ($post['type'] == 'euler' && $post['issubview'])
$FRAME_OPTIONS->activeHeader = 'aoc';
else
$FRAME_OPTIONS->activeHeader = 'blog';
?>
2019-11-02 20:19:34 +01:00
2017-12-30 23:11:51 +01:00
2020-01-16 10:50:18 +01:00
<div class="blockcontent">
<div class="contentheader"><h1><?php echo htmlspecialchars($post['title']); ?></h1><hr/></div>
<?php
if ($post['type'] === 'plain')
{
$SITE->fragments->BlogviewPlain($post);
}
elseif ($post['type'] === 'markdown')
{
$SITE->fragments->BlogviewMarkdown($post);
}
elseif ($post['type'] === 'euler')
{
if ($subview === '') $SITE->fragments->BlogviewEulerList($post);
else $SITE->fragments->BlogviewEulerSingle($post, $subview);
}
elseif ($post['type'] === 'aoc')
{
if ($subview === '') $SITE->fragments->BlogviewAdventOfCodeList($post);
else $SITE->fragments->BlogviewAdventOfCodeSingle($post, $subview);
}
?>
2017-12-30 23:11:51 +01:00
</div>