Theme support, clean up, code formating and improvement

This commit is contained in:
mmk2410 2015-06-18 20:45:49 +02:00
parent 17b76633c0
commit bdfd878b58
17 changed files with 722 additions and 403 deletions

View file

@ -1,4 +1,5 @@
<?php <?php
// This is the configuration file. You can configure here all necessary (and possible) options without editing the index.php file. // This is the configuration file. You can configure here all necessary (and possible) options without editing the index.php file.
// Every line has an description about what you can change here. Don't delete any strings. You can set your value after the '=' sign and between the apostrophes. // Every line has an description about what you can change here. Don't delete any strings. You can set your value after the '=' sign and between the apostrophes.
// Make sure that every line ends with an semicolon (';'). // Make sure that every line ends with an semicolon (';').
@ -28,4 +29,6 @@ $blogfooter = 'Rangitaki ' . date("Y") . ' <a href="https://github.com/mmk2410/
$rcc = 'no'; $rcc = 'no';
// Here you can disable and enable the navigation menu. Usefull if you have no subblogs and no home directory // Here you can disable and enable the navigation menu. Usefull if you have no subblogs and no home directory
$nav_drawer = 'yes'; $nav_drawer = 'yes';
// Set here the name of your theme. Read the documentation for more themes
$theme = 'material-light';
?> ?>

View file

@ -30,6 +30,10 @@ THE SOFTWARE.
require_once 'res/php/Parsedown.php'; require_once 'res/php/Parsedown.php';
require_once 'res/php/ArticleGenerator.php'; require_once 'res/php/ArticleGenerator.php';
require_once './res/php/BlogListGenerator.php'; require_once './res/php/BlogListGenerator.php';
$getblog = filter_input(INPUT_GET, "blog");
$getarticle = filter_input(INPUT_GET, "article");
$gettag = filter_input(INPUT_GET, "tag");
$url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") . filter_input(INPUT_SERVER, "REQUEST_URI");
?> ?>
<head> <head>
@ -37,10 +41,17 @@ THE SOFTWARE.
<!--Metatags--> <!--Metatags-->
<meta name="author" content="<?php echo $blogauthor; ?>" /> <meta name="author" content="<?php echo $blogauthor; ?>" />
<meta name="description" content="<?php echo $blogdescription; ?>" /> <meta name="description" content="<?php echo $blogdescription; ?>" />
<meta name="theme-color" content="#ac2900"/>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' /> <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<!--CSS no change needed--> <!--CSS no change needed-->
<link rel="stylesheet" type="text/css" href="res/css/rangitaki.css" /> <link rel="stylesheet" type="text/css" href="res/css/rangitaki.css" />
<link rel="stylesheet" type="text/css" href="themes/<?php echo $theme; ?>.css" />
<?php
if ($nav_drawer == 'no') {
?>
<link rel="stylesheet" type="text/css" href="res/css/no-nav.css" />
<?php
}
?>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,500,700,300,400italic,100,100italic,900' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Roboto:400,500,700,300,400italic,100,100italic,900' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" href="res/favicon.png"> <link rel="shortcut icon" href="res/favicon.png">
<link rel="stylesheet" href="./res/css/github-gist.css"> <link rel="stylesheet" href="./res/css/github-gist.css">
@ -54,18 +65,18 @@ THE SOFTWARE.
<div class="nav"> <div class="nav">
<div class="divider"></div> <div class="divider"></div>
<?php <?php
if($_GET['article'] == ""){ if ($getarticle == "") {
echo "<section>"; echo "<section>";
echo "<div class='nav-item-static'>Blogs of $blogtitle:</div>"; echo "<div class='nav-item-static'>Blogs of $blogtitle:</div>";
$blogs = scandir("./blogs/"); $blogs = scandir("./blogs/");
foreach ($blogs as $blog) { foreach ($blogs as $blog) {
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") { if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
if($_GET['blog'] == ""){ if ($getblog == "") {
if ($blog != "main.md") { if ($blog != "main.md") {
BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle); BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle);
} }
} else { } else {
if($_GET['blog'] . ".md" != $blog){ if ($getblog . ".md" != $blog) {
BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle); BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle);
} }
} }
@ -84,10 +95,10 @@ THE SOFTWARE.
<?php <?php
} }
if($_GET['blog'] == ""){ if ($getblog == "") {
$blog = "main"; $blog = "main";
} else { } else {
$blog = $_GET['blog']; $blog = $getblog;
} }
?> ?>
<div class="main"> <div class="main">
@ -96,7 +107,7 @@ THE SOFTWARE.
<nobr><a href="./" class="title"><?php echo $blogtitle; ?></a></nobr> <nobr><a href="./" class="title"><?php echo $blogtitle; ?></a></nobr>
</div> </div>
<?php <?php
if(file_exists("blogs/$blog.md") && $_GET['article'] == "" && $blogintro == "yes" && $_GET['tag'] == ""){ if (file_exists("blogs/$blog.md") && $getarticle == "" && $blogintro == "yes" && $gettag == "") {
$file = file_get_contents("blogs/$blog.md"); $file = file_get_contents("blogs/$blog.md");
$file = $file . "\n"; $file = $file . "\n";
$file = substr($file, strpos($file, "\n")); $file = substr($file, strpos($file, "\n"));
@ -116,25 +127,25 @@ THE SOFTWARE.
} }
} }
$articlesdir = "./articles/$blog/"; $articlesdir = "./articles/$blog/";
if($_GET['tag'] != ""){ if ($gettag != "") {
$articles = scandir($articlesdir, 1); $articles = scandir($articlesdir, 1);
foreach ($articles as $article) { foreach ($articles as $article) {
$tags = ArticleGenerator::getTags($articlesdir, $article); $tags = ArticleGenerator::getTags($articlesdir, $article);
if(in_array($_GET['tag'], $tags)){ if (in_array($gettag, $tags)) {
if (strlen($article) >= 3 && substr($article, -3) == ".md") { if (strlen($article) >= 3 && substr($article, -3) == ".md") {
ArticleGenerator::newArticle($articlesdir, $article, $_GET['blog']); ArticleGenerator::newArticle($articlesdir, $article, $getblog);
} }
} }
} }
} else if($_GET['article'] == ""){ } else if ($getarticle == "") {
$articles = scandir($articlesdir, 1); $articles = scandir($articlesdir, 1);
foreach ($articles as $article) { foreach ($articles as $article) {
if (strlen($article) >= 3 && substr($article, -3) == ".md") { if (strlen($article) >= 3 && substr($article, -3) == ".md") {
ArticleGenerator::newArticle($articlesdir, $article, $_GET['blog']); ArticleGenerator::newArticle($articlesdir, $article, $getblog);
} }
} }
} else { } else {
ArticleGenerator::newArticle($articlesdir, $_GET['article'] . ".md", $_GET['blog']); ArticleGenerator::newArticle($articlesdir, $getarticle . ".md", $getblog);
include './res/php/SocialBar.php'; include './res/php/SocialBar.php';
include './res/php/Disqus.php'; include './res/php/Disqus.php';
} }
@ -144,22 +155,22 @@ THE SOFTWARE.
</div> </div>
<div class="fabmenu"> <div class="fabmenu">
<div class="subfab"> <div class="subfab">
<a href='mailto:?subject=<?php echo $blogtitle; ?>&body=Check out this blog: <?php echo "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>' target="blank"> <a href='mailto:?subject=<?php echo $blogtitle; ?>&body=Check out this blog: <?php echo $url; ?>' target="blank">
<img src="./res/img/email.svg" class="subfab-img" /> <img src="./res/img/email.svg" class="subfab-img" />
</a> </a>
</div> </div>
<div class="subfab"> <div class="subfab">
<a href='https://twitter.com/intent/tweet?text=Check out: <?php echo "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>&original_referer=' target="blank"> <a href='https://twitter.com/intent/tweet?text=Check out: <?php echo $url; ?>&original_referer=' target="blank">
<img src="./res/img/twitter.svg" class="subfab-img" /> <img src="./res/img/twitter.svg" class="subfab-img" />
</a> </a>
</div> </div>
<div class="subfab"> <div class="subfab">
<a href='https://plus.google.com/share?url=<?php echo "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>&hl=en-US' target="blank"> <a href='https://plus.google.com/share?url=<?php echo $url; ?>&hl=en-US' target="blank">
<img src="./res/img/gplus.svg" class="subfab-img" /> <img src="./res/img/gplus.svg" class="subfab-img" />
</a> </a>
</div> </div>
<div class="subfab"> <div class="subfab">
<a href='https://www.facebook.com/sharer/sharer.php?u=<?php echo "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>&t=<?php echo "echo $blogtitle"?>' target="blank"> <a href='https://www.facebook.com/sharer/sharer.php?u=<?php echo $url; ?>&t=<?php echo "echo $blogtitle" ?>' target="blank">
<img src="./res/img/facebook.svg" class="subfab-img" /> <img src="./res/img/facebook.svg" class="subfab-img" />
</a> </a>
</div> </div>

View file

@ -1,123 +0,0 @@
<?xml version='1.0' standalone='yes'?>
<posts>
<post>
<title>About the Future of pBlog</title>
<pubdate>29th March 2015</pubdate>
<content>
I figured out that there will be many changes in the engine which will require many changes in the files (especially the posts file) and in the filestructure. I can't say right now which things will change and what you have to change. Out of this reason I change the Version numbers and add an zero in front of them. So instead of 2.1 the latest version is now 0.2.1. The 0.2.x series is now on GitHub as an own branch and will recive bugfix updates. The series 0.3, 0.4, 0.5 and so own will be development releases which won't be compatible to the 0.2 series. I recommend current users to stay on 0.2.x - at least until the 1.0 release. I'm verry sorry for this and in case that there are requests I may write a small script that will help you switch to version 1.0.
</content>
</post>
<post>
<title>Version 2.1</title>
<pubdate>29th March 2015</pubdate>
<content>This version includes fixes for the article links. You only have to replace the hrefgenerator.php file in the res folder.</content>
</post>
<post>
<title>Version 2.0</title>
<pubdate>27th March 2015</pubdate>
<content>
This version introduces some very imporant features:
- **Own page for every article**
- Social **sharing buttons** (at the moment: google+, twitter, facebook but more will follow)
- **Disqus** integration
- Local **config file** -> no more editing the index file
pBlog 2.0 is only partially compatible with prior versions. You don't have to change anything in the posts or intro file (in case you have one), but to switch to version 2.0 you have to replace your index.php with the new one. With this step all your settings like the title will be lost and you have to set them in the new config.php file. For more questions write me a mail to marcelmichaelkapfer@yahoo.co.nz.
In the near future I will spend more time in writing a documentation about the blog engine and adding more comments (especially in the css file).
</content>
<mainurl>http://github.com/mmk2410/pBlog</mainurl>
<mainlink>GitHub</mainlink>
</post>
<post>
<title>Version 1.2</title>
<pubdate>8th March 2015</pubdate>
<content>
In this Version code is better designed so you can read and recognise it better.
This is a code example:
``scp -r * marcel-kapfer.de:``
</content>
</post>
<post>
<title>Version 1.1</title>
<pubdate>24th February 2015</pubdate>
<content>
After I published the Version 1.0 last sunday I realized some problems with german umlauts. Now I added a function that converts every umlaut (ü, Ü, ä, Ä, ö, Ö and ß) into the html code.
</content>
</post>
<post>
<title>Version 1.0</title>
<pubdate>22nd February 2015</pubdate>
<content>
Today I'm proud to announce the **Version 1.0** of the pBlog - a simple PHP, XML and Markdown based blogging engine
which is completly independent from any databases. Even if this is the version 1.0 it is still in a early state of
development.
Version 1.0 has the following features:
- Blog writing in XML
- Content in Markdown
- Static intro in Markdown
</content>
</post>
<post>
<title>Version 0.3</title>
<pubdate>20th February 2015</pubdate>
<content>This is the Version *0.3* of pBlog. It comes with the following changes:
- Complete Markdown Support
- Design fixes
- a mainlink is no longer required
</content>
</post>
<post>
<title>Version 0.2</title>
<pubdate>20th February 2015</pubdate>
<content>
The following things are new in this version:
- Design
- Better structur
- cleaned up
More will come when it is ready!
This is the version *0.2*.
</content>
<mainurl>index.php</mainurl>
<mainlink>Reload</mainlink>
<otherlinks>
<otherlb>
<otherurl>http://marcel-kapfer.de</otherurl>
<otherlink>marcel-kapfer.de</otherlink>
</otherlb>
<otherlb>
<otherurl>https://github.com/mmk2410/pblog</otherurl>
<otherlink>GitHub</otherlink>
</otherlb>
</otherlinks>
</post>
<post>
<title>Blog (Experimental)</title>
<pubdate>13th February 2015</pubdate>
<content>
This is a test version in a early state of the new **blog engine**. By now it supports following things:
- Markdown
- Mainlink and various other links
More will come when it is ready!
This is the version *0.1*.
</content>
<mainurl>index.php</mainurl>
<mainlink>Reload</mainlink>
<otherlinks>
<otherlb>
<otherurl>http://marcel-kapfer.de</otherurl>
<otherlink>marcel-kapfer.de</otherlink>
</otherlb>
<otherlb>
<otherurl>https://github.com</otherurl>
<otherlink>GitHub</otherlink>
</otherlb>
</otherlinks>
</post>
</posts>

View file

@ -2,7 +2,7 @@
<!-- <!--
The MIT License The MIT License
Copyright 2015 mmk. Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -37,7 +37,8 @@ THE SOFTWARE.
<section class="card"> <section class="card">
<div class="headline">Password Generator</div> <div class="headline">Password Generator</div>
<?php <?php
if ($_POST['passwd'] == "") { $passwd = filter_input(INPUT_POST, "passwd");
if (passwd == "") {
?> ?>
<form action="./" method="post"> <form action="./" method="post">
<p>New password:<br><br><input type="password" class="itextfield" name="passwd"/></p> <p>New password:<br><br><input type="password" class="itextfield" name="passwd"/></p>
@ -45,7 +46,7 @@ THE SOFTWARE.
</form> </form>
<?php <?php
} else { } else {
echo "<p style='word-wrap: break-word;'>" . password_hash($_POST['passwd'], PASSWORD_DEFAULT) . "</p>"; echo "<p style='word-wrap: break-word;'>" . password_hash($passwd, PASSWORD_DEFAULT) . "</p>";
} }
?> ?>
</section> </section>

View file

@ -2,7 +2,7 @@
<!-- <!--
The MIT License The MIT License
Copyright 2015 mmk. Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -36,8 +36,9 @@ THE SOFTWARE.
<div class="main"> <div class="main">
<?php <?php
include '../config.php'; include '../config.php';
$passwd = filter_input(INPUT_POST, "passwd");
if ($rcc == "yes") { if ($rcc == "yes") {
if ($_POST['passwd'] == "") { if ($passwd == "") {
?> ?>
<section class="card"> <section class="card">
<div class="headline">Log In</div> <div class="headline">Log In</div>
@ -51,7 +52,7 @@ THE SOFTWARE.
chmod("passwd.txt", 0644); chmod("passwd.txt", 0644);
$hash = file_get_contents("passwd.txt"); $hash = file_get_contents("passwd.txt");
chmod("passwd.txt", 0000); chmod("passwd.txt", 0000);
if (password_verify($_POST['passwd'], $hash)) { if (password_verify($passwd, $hash)) {
?> ?>
<section class="card"> <section class="card">
<div class="headline">File Upload</div> <div class="headline">File Upload</div>

View file

@ -2,7 +2,7 @@
<!-- <!--
The MIT License The MIT License
Copyright 2015 mmk. Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -40,7 +40,7 @@ THE SOFTWARE.
if ($_FILES['userfile']['name'] == "") { if ($_FILES['userfile']['name'] == "") {
echo "<p>You have to choose a file!</p>"; echo "<p>You have to choose a file!</p>";
} else { } else {
$blog = $_POST['blog']; $blog = filter_input(INPUT_POST, "blog");
$uploaddir = "../..//articles/$blog/"; $uploaddir = "../..//articles/$blog/";
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']); $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

42
res/css/no-nav.css Normal file
View file

@ -0,0 +1,42 @@
/*
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 18, 2015, 7:07:45 PM
Author : mmk2410
*/
.nav{
display: none;
}
@media screen and (min-width: 1440px) {
.header {
left: 0px;
}
.main{
margin-left: 0px;
width: 100%;
}
}

View file

@ -29,15 +29,11 @@ THE SOFTWARE.
/* BODY */ /* BODY */
body{ body{
font-family: "Roboto", sans-serif;
background: #f6f6f6;
color: #383838;
margin-top: 94px; margin-top: 94px;
} }
.main{ .main{
height: 100%; height: 100%;
width: 100% - 300px;
margin-left: 0px; margin-left: 0px;
} }
@ -54,14 +50,12 @@ body{
} }
/* HEADER */ /* HEADER */
.header{ .header{
background-color: #ff4415;
position: fixed;
top: 0px; top: 0px;
right: 0px; right: 0px;
left: 0px; left: 0px;
width: 100%; width: 100%;
height: 64px; height: 64px;
box-shadow: 2px 0px 2px 2px rgba(62, 62, 62, 0.45); position: absolute;
} }
.title{ .title{
@ -71,7 +65,6 @@ body{
line-height: 64px; line-height: 64px;
vertical-align: middle; vertical-align: middle;
left: 75px; left: 75px;
position: absolute;
} }
.nav-img{ .nav-img{
@ -88,15 +81,11 @@ body{
height: 100%; height: 100%;
top: 0px; top: 0px;
left: -300px; left: -300px;
background-color: #fff;
padding-top: 64px; padding-top: 64px;
border-right: 1px solid #e0e0e0;
transition: background-color 125ms ease-in-out 0ms;
z-index: 40; z-index: 40;
} }
.nav-item, .nav-item-static{ .nav-item, .nav-item-static{
color: #383838;
text-decoration: none; text-decoration: none;
text-indent: 0; text-indent: 0;
display: inline-block; display: inline-block;
@ -110,17 +99,11 @@ body{
} }
.nav-item{ .nav-item{
font-weight: 600;
cursor: pointer; cursor: pointer;
} }
.nav-item:active{
background-color: #e2e2e2;
}
.divider{ .divider{
width: 100%; width: 100%;
border-bottom: 1px solid #e0e0e0;
} }
/* MAIN */ /* MAIN */
@ -129,33 +112,22 @@ body{
margin-right: auto; margin-right: auto;
margin-left: auto; margin-left: auto;
width: 75%; width: 75%;
background: #fff;
border-radius: 2px;
padding: 24px; padding: 24px;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
margin-bottom: 40px; margin-bottom: 40px;
max-width: 1160px; max-width: 1160px;
} }
.card a{ .card a{
color: #ff4415;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
transition: border-bottom-color 150ms ease-in-out 100ms;
} }
.card a:hover{ .card a:hover{
border-bottom-color: #ff4415;
} }
.headline{ .headline{
font-size: 24px;
color: #383838!important;
text-decoration: none;
display: block; display: block;
padding-bottom: 8px; padding-bottom: 8px;
border-bottom: none!important;
} }
@ -165,21 +137,19 @@ body{
} }
.date{ .date{
font-size: 13px;
} }
.articletext{ .articletext{
font-size: 14px;
line-height: 24px;
} }
.author{ .author{
font-size: 13px;
display: block; display: block;
} }
.tag{ .tag{
font-size: 13px;
} }
/* FAB */ /* FAB */
@ -194,8 +164,6 @@ body{
height: 60px; height: 60px;
width: 60px; width: 60px;
border-radius: 30px; border-radius: 30px;
background-color: #ff4415;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
cursor: pointer; cursor: pointer;
} }
@ -211,8 +179,6 @@ body{
margin-right: auto; margin-right: auto;
margin-left: auto; margin-left: auto;
margin-bottom: 25px; margin-bottom: 25px;
background-color: #fff;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
display: none; display: none;
} }
@ -224,16 +190,11 @@ body{
/* FOOTER */ /* FOOTER */
.footer{ .footer{
font-size: 12px;
text-align: center;
} }
.footer a{ .footer a{
color: #383838;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
transition: border-bottom-color 150ms ease-in-out 100ms; transition: border-bottom-color 150ms ease-in-out 100ms;
} }

View file

@ -31,8 +31,7 @@
*/ */
class ArticleGenerator { class ArticleGenerator {
function newArticle($directory, $articlefile, $blog) function newArticle ($directory, $articlefile, $blog) {
{
$article = file_get_contents($directory . $articlefile); $article = file_get_contents($directory . $articlefile);
@ -81,7 +80,8 @@ class ArticleGenerator {
} }
foreach ($tags as $tag) { foreach ($tags as $tag) {
if($_GET['blog'] == ""){ $blogurl = filter_input(INPUT_GET, "blog");
if ($blogurl == "") {
echo "<a class='tag' href='./?tag=$tag'>$tag</a> "; echo "<a class='tag' href='./?tag=$tag'>$tag</a> ";
} else { } else {
echo "<a class='tag' href='./?blog=$blog&tag=$tag'>$tag</a> "; echo "<a class='tag' href='./?blog=$blog&tag=$tag'>$tag</a> ";
@ -89,7 +89,6 @@ class ArticleGenerator {
} }
echo "</section>" . "\n"; echo "</section>" . "\n";
} }
function getTags($directory, $articlefile) { function getTags($directory, $articlefile) {

View file

@ -3,7 +3,7 @@
/* /*
* The MIT License * The MIT License
* *
* Copyright 2015 mmk. * Copyright 2015 mmk2410.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -27,12 +27,11 @@
/** /**
* Description of BlogListGenerator * Description of BlogListGenerator
* *
* @author mmk * @author mmk2410 <marcelmichaelkapfer@yahoo.co.nz>
*/ */
class BlogListGenerator { class BlogListGenerator {
function listBlog($directory, $blogname, $blogmaintitle) function listBlog($directory, $blogname, $blogmaintitle) {
{
$blog = file_get_contents($directory . $blogname); $blog = file_get_contents($directory . $blogname);
$blog = $blog . "\n"; $blog = $blog . "\n";
if (substr($blog, 0, 6) == "%TITLE") { if (substr($blog, 0, 6) == "%TITLE") {
@ -44,7 +43,6 @@ class BlogListGenerator {
echo "<a class='nav-item' href='$link'>$blog</a>"; echo "<a class='nav-item' href='$link'>$blog</a>";
} }
} }
} }
} }

View file

@ -31,7 +31,9 @@ THE SOFTWARE.
/* * * DON'T EDIT BELOW THIS LINE * * */ /* * * DON'T EDIT BELOW THIS LINE * * */
(function () { (function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})(); })();

View file

@ -1,9 +1,8 @@
<?php <?php
/* /*
* The MIT License * The MIT License
* *
* Copyright 2015 mmk. * Copyright 2015 mmk2410.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -29,9 +28,16 @@ if($bloganalytics){
?> ?>
<script> <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (function (i, s, o, g, r, a, m) {
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), i['GoogleAnalyticsObject'] = r;
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments);
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', '<?php echo $bloganalytics; ?>', 'auto'); ga('create', '<?php echo $bloganalytics; ?>', 'auto');

149
themes/background-img.css Normal file
View file

@ -0,0 +1,149 @@
/*
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 18, 2015, 6:39:37 PM
Author : mmk2410
*/
body{
font-family: "Roboto", sans-serif;
background: #f6f6f6;
color: #383838;
background-image: url(http://marcel-kapfer.de/res/img/druck.png);
background-size: cover;
background-attachment: fixed;
background-position: top center;
background-repeat: no-repeat;
}
.header{
background-color: rgba(0, 0, 0, 0.45);
position: fixed;
}
.title{
color: #fff;
position: absolute;
}
.nav{
background-color: #fff;
border-right: 1px solid #e0e0e0;
}
.nav-item, .nav-item-static{
color: #383838;
}
.nav-item{
font-weight: 600;
}
.nav-item:active{
background-color: #e2e2e2;
}
.divider{
border-bottom: 1px solid #e0e0e0;
}
.card{
background: #fff;
border-radius: 2px;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.card a{
color: #ff4415;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
transition: border-bottom-color 150ms ease-in-out 100ms;
}
.card a:hover{
border-bottom-color: #ff4415;
}
.headline{
font-size: 24px;
color: #383838!important;
text-decoration: none;
border-bottom: none!important;
}
.date{
font-size: 13px;
}
.articletext{
font-size: 14px;
line-height: 24px;
}
.author{
font-size: 13px;
}
.tag{
font-size: 13px;
}
.fab{
background-color: #ff4415;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.subfab{
background-color: #fff;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.footer{
font-size: 12px;
text-align: center;
color: #fff;
text-shadow: 1px 1px rgba(55, 55, 55, 0.3);
}
.footer a{
color: #fff;
text-shadow: 1px 1px rgba(175, 175, 175, 0.3);
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
}
.footer a:hover{
border-bottom-color: #fff;
}
@media screen and (min-width: 1440px) {
.nav{
background-color: rgba(255, 255, 255, 0.8);
}
}

135
themes/material-dark.css Normal file
View file

@ -0,0 +1,135 @@
/*
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 18, 2015, 6:39:37 PM
Author : mmk2410
*/
body{
font-family: "Roboto", sans-serif;
background: #303030;
color: #fff;
}
.header{
background-color: #212121;
position: fixed;
box-shadow: 2px 0px 2px 2px rgba(32, 32, 32, 0.85);
}
.title{
color: #fff;
position: absolute;
}
.nav{
background-color: #424242;
border-right: 1px solid #1f1f1f;
}
.nav-item, .nav-item-static{
color: #fff;
}
.nav-item{
font-weight: 600;
}
.nav-item:active{
background-color: #383838;
}
.divider{
border-bottom: 1px solid #1f1f1f;
}
.card{
background: #424242;
border-radius: 2px;
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
}
.card a{
color: #ff4415;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
transition: border-bottom-color 150ms ease-in-out 100ms;
}
.card a:hover{
border-bottom-color: #ff4415;
}
.headline{
font-size: 24px;
color: #fff!important;
text-decoration: none;
border-bottom: none!important;
}
.date{
font-size: 13px;
}
.articletext{
font-size: 14px;
line-height: 24px;
}
.author{
font-size: 13px;
}
.tag{
font-size: 13px;
}
.fab{
background-color: #ff4415;
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
}
.subfab{
background-color: #424242;
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
}
.footer{
font-size: 12px;
text-align: center;
color: #fff;
}
.footer a{
color: #fff;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
}
.footer a:hover{
border-bottom-color: #fff;
}

134
themes/material-light.css Normal file
View file

@ -0,0 +1,134 @@
/*
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 18, 2015, 6:39:37 PM
Author : mmk2410
*/
body{
font-family: "Roboto", sans-serif;
background: #f6f6f6;
color: #383838;
}
.header{
background-color: #ff4415;
position: fixed;
box-shadow: 2px 0px 2px 2px rgba(62, 62, 62, 0.45);
}
.title{
color: #fff;
position: absolute;
}
.nav{
background-color: #fff;
border-right: 1px solid #e0e0e0;
}
.nav-item, .nav-item-static{
color: #383838;
}
.nav-item{
font-weight: 600;
}
.nav-item:active{
background-color: #e2e2e2;
}
.divider{
border-bottom: 1px solid #e0e0e0;
}
.card{
background: #fff;
border-radius: 2px;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.card a{
color: #ff4415;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
transition: border-bottom-color 150ms ease-in-out 100ms;
}
.card a:hover{
border-bottom-color: #ff4415;
}
.headline{
font-size: 24px;
color: #383838!important;
text-decoration: none;
border-bottom: none!important;
}
.date{
font-size: 13px;
}
.articletext{
font-size: 14px;
line-height: 24px;
}
.author{
font-size: 13px;
}
.tag{
font-size: 13px;
}
.fab{
background-color: #ff4415;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.subfab{
background-color: #fff;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.footer{
font-size: 12px;
text-align: center;
}
.footer a{
color: #383838;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
}
.footer a:hover{
border-bottom-color: #383838;
}