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
// 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.
// Make sure that every line ends with an semicolon (';').
@ -23,9 +24,11 @@ $blogdisqus = 'rangitaki';
// Google Analytics - Provide here your Google Analytics Tracking-ID. Leave empty if you don't want to use it.
$bloganalytics = '';
// Footer - set here the text for your footer (e.g. a copyright info). You can replace the whole text after the '=' with your own one.
$blogfooter = 'Rangitaki ' . date("Y") . ' <a href="https://github.com/mmk2410/Rangitaki" target="blank">github.com/mmk2410/Rangitaki</a>';
$blogfooter = 'Rangitaki ' . date("Y") . ' <a href="https://github.com/mmk2410/Rangitaki" target="blank">github.com/mmk2410/Rangitaki</a>';
// This enables the optional rangitaki control center. Please read the documentation before you enable it.
$rcc= 'no';
$rcc = 'no';
// Here you can disable and enable the navigation menu. Usefull if you have no subblogs and no home directory
$nav_drawer = 'yes';
// Set here the name of your theme. Read the documentation for more themes
$theme = 'material-light';
?>

185
index.php
View File

@ -25,141 +25,152 @@ THE SOFTWARE.
-->
<html>
<?php
<?php
include 'config.php';
require_once 'res/php/Parsedown.php';
require_once 'res/php/ArticleGenerator.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>
<title><?php echo $blogtitle; ?></title>
<!--Metatags-->
<meta name="author" content="<?php echo $blogauthor; ?>" />
<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' />
<!--CSS no change needed-->
<link rel="stylesheet" type="text/css" href="res/css/rangitaki.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="stylesheet" href="./res/css/github-gist.css">
<script src="./res/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<?php if($nav_drawer == "yes"){ ?>
<div class="overlay"></div>
<div class="nav">
<div class="divider"></div>
<head>
<title><?php echo $blogtitle; ?></title>
<!--Metatags-->
<meta name="author" content="<?php echo $blogauthor; ?>" />
<meta name="description" content="<?php echo $blogdescription; ?>" />
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<!--CSS no change needed-->
<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($_GET['article'] == ""){
echo "<section>";
echo "<div class='nav-item-static'>Blogs of $blogtitle:</div>";
$blogs = scandir("./blogs/");
foreach ($blogs as $blog){
if(strlen($blog) >= 3 && substr($blog, -3) == ".md"){
if($_GET['blog'] == ""){
if($blog != "main.md"){
BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle);
}
} else {
if($_GET['blog'] . ".md" != $blog){
BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle);
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 rel="shortcut icon" href="res/favicon.png">
<link rel="stylesheet" href="./res/css/github-gist.css">
<script src="./res/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<?php if ($nav_drawer == "yes") { ?>
<div class="overlay"></div>
<div class="nav">
<div class="divider"></div>
<?php
if ($getarticle == "") {
echo "<section>";
echo "<div class='nav-item-static'>Blogs of $blogtitle:</div>";
$blogs = scandir("./blogs/");
foreach ($blogs as $blog) {
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
if ($getblog == "") {
if ($blog != "main.md") {
BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle);
}
} else {
if ($getblog . ".md" != $blog) {
BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle);
}
}
}
}
echo "</section>";
} else {
?>
<a class="nav-item" onclick="goBack()">Go back</a>
<?php
}
echo "</section>";
} else {
?>
<a class="nav-item" onclick="goBack()">Go back</a>
<?php
}
?>
<div class="divider"></div>
<a class="nav-item" href="<?php echo $bloghomeurl; ?>"><?php echo $bloghomename; ?></a>
</div>
<?php
<div class="divider"></div>
<a class="nav-item" href="<?php echo $bloghomeurl; ?>"><?php echo $bloghomename; ?></a>
</div>
<?php
}
if($_GET['blog'] == ""){
if ($getblog == "") {
$blog = "main";
} else {
$blog = $_GET['blog'];
$blog = $getblog;
}
?>
<div class="main">
<div class="header">
<img src="./res/img/menu.svg" class="nav-img" />
<nobr><a href="./" class="title"><?php echo $blogtitle; ?></a></nobr>
</div>
<?php
if(file_exists("blogs/$blog.md") && $_GET['article'] == "" && $blogintro == "yes" && $_GET['tag'] == ""){
?>
<div class="main">
<div class="header">
<img src="./res/img/menu.svg" class="nav-img" />
<nobr><a href="./" class="title"><?php echo $blogtitle; ?></a></nobr>
</div>
<?php
if (file_exists("blogs/$blog.md") && $getarticle == "" && $blogintro == "yes" && $gettag == "") {
$file = file_get_contents("blogs/$blog.md");
$file = $file . "\n";
$file = substr($file, strpos($file, "\n"));
if($file != "" && $file != "\n" && $file != " "){
?>
<section class="card">
<div class="articletext">
<?php
$intro = Parsedown::instance()
->setBreaksEnabled(true)
->text($file);
echo $intro;
?>
</div>
</section>
<?php
if ($file != "" && $file != "\n" && $file != " ") {
?>
<section class="card">
<div class="articletext">
<?php
$intro = Parsedown::instance()
->setBreaksEnabled(true)
->text($file);
echo $intro;
?>
</div>
</section>
<?php
}
}
$articlesdir = "./articles/$blog/";
if($_GET['tag'] != ""){
if ($gettag != "") {
$articles = scandir($articlesdir, 1);
foreach ($articles as $article) {
$tags = ArticleGenerator::getTags($articlesdir, $article);
if(in_array($_GET['tag'], $tags)){
if(strlen($article) >= 3 && substr($article, -3) == ".md"){
ArticleGenerator::newArticle($articlesdir, $article, $_GET['blog']);
if (in_array($gettag, $tags)) {
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
ArticleGenerator::newArticle($articlesdir, $article, $getblog);
}
}
}
} else if($_GET['article'] == ""){
} else if ($getarticle == "") {
$articles = scandir($articlesdir, 1);
foreach ($articles as $article) {
if(strlen($article) >= 3 && substr($article, -3) == ".md"){
ArticleGenerator::newArticle($articlesdir, $article, $_GET['blog']);
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
ArticleGenerator::newArticle($articlesdir, $article, $getblog);
}
}
} else {
ArticleGenerator::newArticle($articlesdir, $_GET['article'] . ".md", $_GET['blog']);
ArticleGenerator::newArticle($articlesdir, $getarticle . ".md", $getblog);
include './res/php/SocialBar.php';
include './res/php/Disqus.php';
}
?>
?>
<div class="footer">
<?php echo $blogfooter; ?>
</div>
<div class="fabmenu">
<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" />
</a>
</div>
<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" />
</a>
</div>
<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" />
</a>
</div>
<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" />
</a>
</div>
@ -168,10 +179,10 @@ THE SOFTWARE.
</div>
</div>
</div>
<script src="./res/js/jquery-2.1.4.min.js"></script>
<script src="./res/js/app.js"></script>
<?php
<script src="./res/js/jquery-2.1.4.min.js"></script>
<script src="./res/js/app.js"></script>
<?php
include './res/php/GoogleAnalytics.php';
?>
?>
</body>
</html>

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
Copyright 2015 mmk.
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
@ -37,7 +37,8 @@ THE SOFTWARE.
<section class="card">
<div class="headline">Password Generator</div>
<?php
if ($_POST['passwd'] == "") {
$passwd = filter_input(INPUT_POST, "passwd");
if (passwd == "") {
?>
<form action="./" method="post">
<p>New password:<br><br><input type="password" class="itextfield" name="passwd"/></p>
@ -45,7 +46,7 @@ THE SOFTWARE.
</form>
<?php
} 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>

View File

@ -2,7 +2,7 @@
<!--
The MIT License
Copyright 2015 mmk.
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
@ -36,8 +36,9 @@ THE SOFTWARE.
<div class="main">
<?php
include '../config.php';
$passwd = filter_input(INPUT_POST, "passwd");
if ($rcc == "yes") {
if ($_POST['passwd'] == "") {
if ($passwd == "") {
?>
<section class="card">
<div class="headline">Log In</div>
@ -51,7 +52,7 @@ THE SOFTWARE.
chmod("passwd.txt", 0644);
$hash = file_get_contents("passwd.txt");
chmod("passwd.txt", 0000);
if (password_verify($_POST['passwd'], $hash)) {
if (password_verify($passwd, $hash)) {
?>
<section class="card">
<div class="headline">File Upload</div>

View File

@ -115,45 +115,45 @@ body{
/* BUTTON */
.button {
text-decoration: none;
color: #fff;
background-color: #ff4415;
line-height: 36px;
min-width: 64px;
text-align: center;
height: 36px;
padding: 8px;
border-width: 1px;
border-style: solid;
border-color: #ff4415;
box-shadow: 0.4px 1px 1.5px 1px #aaa;
-moz-box-shadow: 0.4px 1px 1.5px 1px #aaa;
-webkit-box-shadow: 0.4px 1px 1.5px 1px #aaa;
border-radius: 2px;
margin-top: 4px;
margin-bottom: 5px;
letter-spacing: 0.4px;
font-weight: 700;
font-size: 14px;
transition-property: box-shadow;
transition-delay: 50ms;
transition-duration: 125ms;
transition-timing-function: ease;
-moz-transition-property: box-shadow;
-moz-transition-delay: 50ms;
-moz-transition-duration: 125ms;
-moz-transition-timing-function: ease;
-webkit-transition-property: box-shadow;
-webkit-transition-delay: 50ms;
-webkit-transition-duration: 125ms;
-webkit-transition-timing-function: ease;
cursor: pointer;
text-decoration: none;
color: #fff;
background-color: #ff4415;
line-height: 36px;
min-width: 64px;
text-align: center;
height: 36px;
padding: 8px;
border-width: 1px;
border-style: solid;
border-color: #ff4415;
box-shadow: 0.4px 1px 1.5px 1px #aaa;
-moz-box-shadow: 0.4px 1px 1.5px 1px #aaa;
-webkit-box-shadow: 0.4px 1px 1.5px 1px #aaa;
border-radius: 2px;
margin-top: 4px;
margin-bottom: 5px;
letter-spacing: 0.4px;
font-weight: 700;
font-size: 14px;
transition-property: box-shadow;
transition-delay: 50ms;
transition-duration: 125ms;
transition-timing-function: ease;
-moz-transition-property: box-shadow;
-moz-transition-delay: 50ms;
-moz-transition-duration: 125ms;
-moz-transition-timing-function: ease;
-webkit-transition-property: box-shadow;
-webkit-transition-delay: 50ms;
-webkit-transition-duration: 125ms;
-webkit-transition-timing-function: ease;
cursor: pointer;
}
.button:hover, .button:hover {
box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa; }
box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa; }
input.button{
padding: 0px 8px;
@ -191,23 +191,23 @@ input.button{
form{
margin-top: 20px;
}
@media screen and (min-width: 1440px) {
.card{
width: 1160px;
}
}
@media screen and (max-width: 720px){
.card{
width: 82%;
}
.title{
left: 25px;
}
}

View File

@ -2,7 +2,7 @@
<!--
The MIT License
Copyright 2015 mmk.
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
@ -40,7 +40,7 @@ THE SOFTWARE.
if ($_FILES['userfile']['name'] == "") {
echo "<p>You have to choose a file!</p>";
} else {
$blog = $_POST['blog'];
$blog = filter_input(INPUT_POST, "blog");
$uploaddir = "../..//articles/$blog/";
$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{
font-family: "Roboto", sans-serif;
background: #f6f6f6;
color: #383838;
margin-top: 94px;
}
.main{
height: 100%;
width: 100% - 300px;
margin-left: 0px;
}
@ -54,14 +50,12 @@ body{
}
/* HEADER */
.header{
background-color: #ff4415;
position: fixed;
top: 0px;
right: 0px;
left: 0px;
width: 100%;
height: 64px;
box-shadow: 2px 0px 2px 2px rgba(62, 62, 62, 0.45);
position: absolute;
}
.title{
@ -71,7 +65,6 @@ body{
line-height: 64px;
vertical-align: middle;
left: 75px;
position: absolute;
}
.nav-img{
@ -88,15 +81,11 @@ body{
height: 100%;
top: 0px;
left: -300px;
background-color: #fff;
padding-top: 64px;
border-right: 1px solid #e0e0e0;
transition: background-color 125ms ease-in-out 0ms;
z-index: 40;
}
.nav-item, .nav-item-static{
color: #383838;
text-decoration: none;
text-indent: 0;
display: inline-block;
@ -110,17 +99,11 @@ body{
}
.nav-item{
font-weight: 600;
cursor: pointer;
}
.nav-item:active{
background-color: #e2e2e2;
}
.divider{
width: 100%;
border-bottom: 1px solid #e0e0e0;
}
/* MAIN */
@ -129,33 +112,22 @@ body{
margin-right: auto;
margin-left: auto;
width: 75%;
background: #fff;
border-radius: 2px;
padding: 24px;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
margin-bottom: 40px;
max-width: 1160px;
}
.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;
display: block;
padding-bottom: 8px;
border-bottom: none!important;
}
@ -165,21 +137,19 @@ body{
}
.date{
font-size: 13px;
}
.articletext{
font-size: 14px;
line-height: 24px;
}
.author{
font-size: 13px;
display: block;
}
.tag{
font-size: 13px;
}
/* FAB */
@ -194,8 +164,6 @@ body{
height: 60px;
width: 60px;
border-radius: 30px;
background-color: #ff4415;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
cursor: pointer;
}
@ -211,8 +179,6 @@ body{
margin-right: auto;
margin-left: auto;
margin-bottom: 25px;
background-color: #fff;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
display: none;
}
@ -224,49 +190,44 @@ body{
/* FOOTER */
.footer{
font-size: 12px;
text-align: center;
}
.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;
}
.footer a:hover{
border-bottom-color: #383838;
}
@media screen and (min-width: 1440px) {
.nav{
left: 0px;
}
.nav-img{
display: none;
}
.header{
left: 300px;
}
.main{
margin-left: 300px;
width: calc(100% - 300px);
}
}
@media screen and (max-width: 720px){
.card{
width: 82%;
}
}

View File

@ -22,11 +22,11 @@
* THE SOFTWARE.
*/
var main = function(){
var main = function () {
var fabActive = false;
$('.fabmenu').click(function(){
if(!(fabActive)){
$('.fabmenu').click(function () {
if (!(fabActive)) {
fabFadeIn();
fabActive = true;
} else {
@ -34,52 +34,52 @@ var main = function(){
fabActive = false;
}
});
var navOpen = false;
$('.nav-img, .overlay').click(function(){
if(!(navOpen)){
openNav();
navOpen = true;
} else {
closeNav();
navOpen = false;
}
$('.nav-img, .overlay').click(function () {
if (!(navOpen)) {
openNav();
navOpen = true;
} else {
closeNav();
navOpen = false;
}
});
};
$(document).ready(main);
function goBack(){
function goBack() {
history.go(-1);
}
function fabFadeIn(){
function fabFadeIn() {
$('.subfab').fadeIn(125);
$('.fab-img').fadeOut(60, function callback(){
$('.fab-img').attr("src", "http://c2/rangitaki/res/img/close.svg");
$('.fab-img').fadeOut(60, function callback() {
$('.fab-img').attr("src", "http://c2/rangitaki/res/img/close.svg");
});
$('.fab-img').fadeIn(60);
}
function fabFadeOut(){
$('.subfab').fadeOut(125);
$('.fab-img').fadeOut(60, function callback(){
$('.fab-img').attr("src", "http://c2/rangitaki/res/img/share.svg");
function fabFadeOut() {
$('.subfab').fadeOut(125);
$('.fab-img').fadeOut(60, function callback() {
$('.fab-img').attr("src", "http://c2/rangitaki/res/img/share.svg");
});
$('.fab-img').fadeIn(60);
}
function openNav(){
$('.nav').animate({"left":"0px"}, 125);
function openNav() {
$('.nav').animate({"left": "0px"}, 125);
$('.overlay').show();
$('.overlay').animate({"opacity":"0.4"}, 125);
$('.overlay').animate({"opacity": "0.4"}, 125);
}
function closeNav(){
$('.nav').animate({"left":"-300px"}, 125);
$('.overlay').animate({"opacity":"0.0"}, 125, function(){
function closeNav() {
$('.nav').animate({"left": "-300px"}, 125);
$('.overlay').animate({"opacity": "0.0"}, 125, function () {
$('.overlay').hide();
});
}

View File

@ -30,17 +30,16 @@
* @author mmk2410 <marcelmichaelkapfer@yahoo.co.nz>
*/
class ArticleGenerator {
function newArticle($directory, $articlefile, $blog)
{
function newArticle ($directory, $articlefile, $blog) {
$article = file_get_contents($directory . $articlefile);
echo "<section class='card'>";
if(substr($article, 0, 6) == "%TITLE"){
if (substr($article, 0, 6) == "%TITLE") {
$title = substr($article, 8, strpos($article, "\n") - 8);
if($blog == ""){
if ($blog == "") {
$link = "./?article=" . substr($articlefile, 0, -3);
} else {
$link = "./?blog=$blog&article=" . substr($articlefile, 0, -3);
@ -48,68 +47,68 @@ class ArticleGenerator {
echo "<a href='$link' class='headline'>$title</a>";
$article = substr($article, strpos($article, "\n") + 1);
}
if(substr($article, 0, 5) == "%DATE"){
if (substr($article, 0, 5) == "%DATE") {
$date = substr($article, 7, strpos($article, "\n") - 7);
echo "<span class='date'>$date</span>";
$article = substr($article, strpos($article, "\n") + 1);
}
if(substr($article, 0, 7) == "%AUTHOR"){
if (substr($article, 0, 7) == "%AUTHOR") {
$author = substr($article, 9, strpos($article, "\n") - 9);
$article = substr($article, strpos($article, "\n") + 1);
}
if(substr($article, 0, 5) == "%TAGS"){
if (substr($article, 0, 5) == "%TAGS") {
$tags = substr($article, 7, strpos($article, "\n") - 7);
$tags = explode(", ", $tags);
$article = substr($article, strpos($article, "\n") + 1);
}
//TODO Code detection
echo "<div class='articletext'>";
echo Parsedown::instance()
->setBreaksEnabled(true)
->text($article);
echo "</div>";
if($author != ""){
if ($author != "") {
echo "<span class='author'>$author</span>";
}
foreach ($tags as $tag) {
if($_GET['blog'] == ""){
$blogurl = filter_input(INPUT_GET, "blog");
if ($blogurl == "") {
echo "<a class='tag' href='./?tag=$tag'>$tag</a> ";
} else {
echo "<a class='tag' href='./?blog=$blog&tag=$tag'>$tag</a> ";
}
}
echo "</section>" . "\n";
}
function getTags($directory, $articlefile){
function getTags($directory, $articlefile) {
$article = file_get_contents($directory . $articlefile);
if(substr($article, 0, 6) == "%TITLE"){
if (substr($article, 0, 6) == "%TITLE") {
$article = substr($article, strpos($article, "\n") + 1);
}
if(substr($article, 0, 5) == "%DATE"){
if (substr($article, 0, 5) == "%DATE") {
$article = substr($article, strpos($article, "\n") + 1);
}
if(substr($article, 0, 7) == "%AUTHOR"){
if (substr($article, 0, 7) == "%AUTHOR") {
$article = substr($article, strpos($article, "\n") + 1);
}
if(substr($article, 0, 5) == "%TAGS"){
if (substr($article, 0, 5) == "%TAGS") {
$tags = substr($article, 7, strpos($article, "\n") - 7);
$tags = explode(", ", $tags);
}
return $tags;
}
}

View File

@ -3,7 +3,7 @@
/*
* The MIT License
*
* Copyright 2015 mmk.
* 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
@ -27,24 +27,22 @@
/**
* Description of BlogListGenerator
*
* @author mmk
* @author mmk2410 <marcelmichaelkapfer@yahoo.co.nz>
*/
class BlogListGenerator {
function listBlog($directory, $blogname, $blogmaintitle)
{
function listBlog($directory, $blogname, $blogmaintitle) {
$blog = file_get_contents($directory . $blogname);
$blog = $blog . "\n";
if(substr($blog, 0, 6) == "%TITLE"){
if (substr($blog, 0, 6) == "%TITLE") {
$blog = substr($blog, 8, strpos($blog, "\n") - 8);
if($blog == "main"){
if ($blog == "main") {
echo "<a class='nav-item' href='./'>$blogmaintitle</a>";
} else {
$link = "./?blog=" . substr($blogname, 0, -3);
echo "<a class='nav-item' href='$link'>$blog</a>";
}
}
}
}

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?php if($blogdisqus){ ?>
<?php if ($blogdisqus) { ?>
<section class="card">
<div id="disqus_thread"></div>
<script type="text/javascript">
@ -30,8 +30,10 @@ THE SOFTWARE.
var disqus_shortname = '<?php echo $blogdisqus; ?>';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
(function () {
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();

View File

@ -1,9 +1,8 @@
<?php
/*
/*
* The MIT License
*
* Copyright 2015 mmk.
* 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
@ -25,20 +24,27 @@
*/
if($bloganalytics){
?>
if ($bloganalytics) {
?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;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');
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
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');
ga('create', '<?php echo $bloganalytics; ?>', 'auto');
ga('send', 'pageview');
</script>
<?php
<?php
}
?>

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;
}