diff --git a/www/data/css/styles.css b/www/data/css/styles.css
index 4187799..1751913 100644
--- a/www/data/css/styles.css
+++ b/www/data/css/styles.css
@@ -204,6 +204,21 @@ html, body {
@media (max-width: 767px) {
.ble_title {
font-size: 1.25em; } }
+.blogcontent {
+ color: #333;
+ border: 1px solid black;
+ background-color: #E0E0E0;
+ width: 80%;
+ margin-left: auto;
+ margin-right: auto; }
+
+.bc_header {
+ background-color: #BBB;
+ padding: 0 4px; }
+
+.bc_data {
+ padding: 8px; }
+
.euler_pnl_base {
display: inline-flex;
flex-direction: column;
diff --git a/www/data/css/styles.scss b/www/data/css/styles.scss
index addaef4..ab88641 100644
--- a/www/data/css/styles.scss
+++ b/www/data/css/styles.scss
@@ -4,5 +4,6 @@
@import 'styles_main';
@import 'styles_bloglist';
+@import 'styles_blogview';
@import 'styles_eulerpanel';
\ No newline at end of file
diff --git a/www/data/css/styles_blogview.scss b/www/data/css/styles_blogview.scss
new file mode 100644
index 0000000..085cdbb
--- /dev/null
+++ b/www/data/css/styles_blogview.scss
@@ -0,0 +1,19 @@
+@import 'styles_config';
+
+.blogcontent {
+ color: $COL_TEXT_DARK;
+ border: 1px solid black;
+ background-color: $COL_BACKGROUND_2;
+ width: 80%;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.bc_header {
+ background-color: #BBB;
+ padding: 0 4px;
+}
+
+.bc_data {
+ padding: 8px;
+}
\ No newline at end of file
diff --git a/www/data/css/styles_config.scss b/www/data/css/styles_config.scss
index fa2a878..3e05e6a 100644
--- a/www/data/css/styles_config.scss
+++ b/www/data/css/styles_config.scss
@@ -1,5 +1,7 @@
$COL_BACKGROUND: #EEE;
+$COL_BACKGROUND_2: #E0E0E0;
$COL_TEXT_NORMAL: #CCC;
+$COL_TEXT_DARK: #333;
$COL_TRANSPARENT: #FFFFFF00;
$FONT_HEADER: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
\ No newline at end of file
diff --git a/www/data/css/styles_global.scss b/www/data/css/styles_global.scss
index 2acd8bb..4b5fb79 100644
--- a/www/data/css/styles_global.scss
+++ b/www/data/css/styles_global.scss
@@ -25,7 +25,7 @@ body {
.contentheader {
width: 100%;
- color: #333;
+ color: $COL_TEXT_DARK;
font-size: large;
}
diff --git a/www/fragments/blogview_plain.php b/www/fragments/blogview_plain.php
new file mode 100644
index 0000000..e2b8a3c
--- /dev/null
+++ b/www/fragments/blogview_plain.php
@@ -0,0 +1,16 @@
+
+
+
\ No newline at end of file
diff --git a/www/index.php b/www/index.php
index b5ec635..9cce99a 100644
--- a/www/index.php
+++ b/www/index.php
@@ -36,13 +36,18 @@ $URL_RULES =
[ 'url' => ['msmain', 'admin', 'egh', '?{commandcode}'], 'target' => 'pages/admin_egh.php', 'options' => [ 'commandcode' => '%URL%' ], ],
[ 'url' => ['msmain', 'adminEGH'], 'target' => 'pages/admin_egh.php', 'options' => [ 'commandcode' => '%GET%' ], ],
-
+
[ 'url' => ['blog'], 'target' => 'pages/blog_list.php', 'options' => [], ],
+ [ 'url' => ['log'], 'target' => 'pages/blog_list.php', 'options' => [], ],
[ 'url' => ['blogpost', 'index'], 'target' => 'pages/blog_list.php', 'options' => [], ],
[ 'url' => ['blog', '?{id}'], 'target' => 'pages/blog_view.php', 'options' => [ 'id' => '%URL%', 'subview' => '' ], ],
[ 'url' => ['blog', '?{id}'], 'target' => 'pages/blog_view.php', 'options' => [ 'id' => '%URL%', 'subview' => '' ], ],
[ 'url' => ['blog', '?{id}', '?{name}'], 'target' => 'pages/blog_view.php', 'options' => [ 'id' => '%URL%', 'subview' => '' ], ],
[ 'url' => ['blog', '?{id}', '?{name}', '?{subview}'], 'target' => 'pages/blog_view.php', 'options' => [ 'id' => '%URL%', 'subview' => '%URL%' ], ],
+ [ 'url' => ['log', '?{id}'], 'target' => 'pages/blog_view.php', 'options' => [ 'id' => '%URL%', 'subview' => '' ], ],
+ [ 'url' => ['log', '?{id}'], 'target' => 'pages/blog_view.php', 'options' => [ 'id' => '%URL%', 'subview' => '' ], ],
+ [ 'url' => ['log', '?{id}', '?{name}'], 'target' => 'pages/blog_view.php', 'options' => [ 'id' => '%URL%', 'subview' => '' ], ],
+ [ 'url' => ['log', '?{id}', '?{name}', '?{subview}'], 'target' => 'pages/blog_view.php', 'options' => [ 'id' => '%URL%', 'subview' => '%URL%' ], ],
[ 'url' => ['blogpost', 'view'], 'target' => 'pages/blog_view.php', 'options' => [ 'id' => '%GET%', 'subview' => '' ], ],
[ 'url' => ['highscores', 'list.php'], 'target' => 'pages/highscores_listentries.php', 'options' => [ 'gameid' => '%GET%' ], ],
diff --git a/www/internals/blog.php b/www/internals/blog.php
index 284d200..68c9c8e 100644
--- a/www/internals/blog.php
+++ b/www/internals/blog.php
@@ -6,9 +6,9 @@ class Blog
{
return
[
- [ 'id' => 5, 'date' => '2009-04-08', 'visible' => true, 'title' => 'Beginning the log', 'fragment' => 'initial.md', 'type' => 'plain', 'cat' => 'log' ],
+ [ 'id' => 5, 'date' => '2009-04-08', 'visible' => true, 'title' => 'Beginning the log', 'fragment' => 'initial.md', 'type' => 'markdown', 'cat' => 'log' ],
[ 'id' => 6, 'date' => '2009-05-01', 'visible' => false, 'title' => 'Mess with the best ...', 'fragment' => 'hack.md', 'type' => 'markdown', 'cat' => 'log' ],
- [ 'id' => 4, 'date' => '2009-06-22', 'visible' => true, 'title' => 'New Layout!', 'fragment' => 'newlayout.txt', 'type' => 'markdown', 'cat' => 'log' ],
+ [ 'id' => 4, 'date' => '2009-06-22', 'visible' => true, 'title' => 'New Layout!', 'fragment' => 'newlayout.txt', 'type' => 'plain', 'cat' => 'log' ],
[ 'id' => 10, 'date' => '2009-06-28', 'visible' => true, 'title' => '"FUN" update', 'fragment' => 'funupdate.md', 'type' => 'markdown', 'cat' => 'log' ],
[ 'id' => 11, 'date' => '2009-07-05', 'visible' => true, 'title' => 'New Download: LAN Control 2.0', 'fragment' => 'lancontrol.md', 'type' => 'markdown', 'cat' => 'log' ],
[ 'id' => 12, 'date' => '2009-09-07', 'visible' => false, 'title' => 'Airline BSOD', 'fragment' => 'bsod.md', 'type' => 'markdown', 'cat' => 'log' ],
@@ -34,6 +34,19 @@ class Blog
usort($data, function($a, $b) { return strcasecmp($b['date'], $a['date']); });
return $data;
}
+
+ public static function getBlogpost($id)
+ {
+ foreach (self::listAll() as $post) {
+ if ($post['id'] == $id) return $post;
+ }
+ return null;
+ }
+
+ public static function getPostFragment($post)
+ {
+ return file_get_contents( __DIR__ . '/../statics/blog/' . $post['fragment']);
+ }
}
diff --git a/www/pages/blog_list.php b/www/pages/blog_list.php
index 8bb0b45..5567e67 100644
--- a/www/pages/blog_list.php
+++ b/www/pages/blog_list.php
@@ -7,7 +7,6 @@ require_once (__DIR__ . '/../internals/blog.php');
$allposts = Blog::listAllOrderedDescending();
?>
-
Mikescher.com - Blog
diff --git a/www/pages/blog_view.php b/www/pages/blog_view.php
new file mode 100644
index 0000000..b185f45
--- /dev/null
+++ b/www/pages/blog_view.php
@@ -0,0 +1,63 @@
+
+
+
+
+
+ Mikescher.com - Blog
+
+
+
+
+
+
+
+
\ No newline at end of file