Better code style

This commit is contained in:
Marcel Kapfer (mmk2410) 2016-08-03 17:19:59 +02:00
parent 1aa4b42c0c
commit c1a7ede3bc

View file

@ -193,7 +193,9 @@ if ($config["design"]["drawer"] == "on") {
if ($navblog != "main.md") { // excluding main blog if ($navblog != "main.md") { // excluding main blog
// creating navigation item // creating navigation item
BlogListGenerator::listBlog( BlogListGenerator::listBlog(
"./blogs/", $navblog, $config["blog"]["title"] "./blogs/",
$navblog,
$config["blog"]["title"]
); );
} }
} else { } else {
@ -202,7 +204,9 @@ if ($config["design"]["drawer"] == "on") {
if ($getblog . ".md" != $navblog) { if ($getblog . ".md" != $navblog) {
// creating navigation item // creating navigation item
BlogListGenerator::listBlog( BlogListGenerator::listBlog(
"./blogs/", $navblog, $blogmaintitle "./blogs/",
$navblog,
$blogmaintitle
); );
} }
} }
@ -318,7 +322,11 @@ if ($config["design"]["drawer"] == "on") {
if (strlen($article) >= 3 && substr($article, -3) == ".md") { if (strlen($article) >= 3 && substr($article, -3) == ".md") {
// generate the article // generate the article
ArticleGenerator::newArticle( ArticleGenerator::newArticle(
$articlesdir, $article, $getblog, $config["design"]["excerpt"], $BLOGLANG["Read More"] $articlesdir,
$article,
$getblog,
$config["design"]["excerpt"],
$BLOGLANG["Read More"]
); );
} }
} }
@ -336,12 +344,20 @@ if ($config["design"]["drawer"] == "on") {
if ($config["design"]["pagination"]) { if ($config["design"]["pagination"]) {
if ($posts_amount < $pag_max && $posts_amount >= $pag_min) { if ($posts_amount < $pag_max && $posts_amount >= $pag_min) {
ArticleGenerator::newArticle( ArticleGenerator::newArticle(
$articlesdir, $article, $getblog, $config["design"]["excerpt"], $BLOGLANG["Read More"] $articlesdir,
$article,
$getblog,
$config["design"]["excerpt"],
$BLOGLANG["Read More"]
); );
} }
} else { } else {
ArticleGenerator::newArticle( ArticleGenerator::newArticle(
$articlesdir, $article, $getblog, $config["design"]["excerpt"], $BLOGLANG["Read More"] $articlesdir,
$article,
$getblog,
$config["design"]["excerpt"],
$BLOGLANG["Read More"]
); );
} }
} }
@ -353,8 +369,11 @@ if ($config["design"]["drawer"] == "on") {
} elseif (isset($getarticle)) { // ARTICLE VIEW } elseif (isset($getarticle)) { // ARTICLE VIEW
// generate the requested article // generate the requested article
ArticleGenerator::newArticle( ArticleGenerator::newArticle(
$articlesdir, $getarticle . ".md", $getblog, $articlesdir,
'off', '' $getarticle . ".md",
$getblog,
'off',
$BLOGLANG["Read More"]
); );
include './res/php/Disqus.php'; // include disques include './res/php/Disqus.php'; // include disques
} else { // SOMETHING STRANGE: THIS SHOULDN'T HAPPEN } else { // SOMETHING STRANGE: THIS SHOULDN'T HAPPEN
@ -417,14 +436,14 @@ if ($config["design"]["drawer"] == "on") {
<script src="./res/js/app.js"></script> <!--include main javascript--> <script src="./res/js/app.js"></script> <!--include main javascript-->
<!-- JS extension support --> <!-- JS extension support -->
<?php <?php
if(file_exists("./extensions")) { if (file_exists("./extensions")) {
$extensions = scandir('./extensions'); $extensions = scandir('./extensions');
foreach ($extensions as $extension) { foreach ($extensions as $extension) {
if (substr($extension, -3) == ".js") { if (substr($extension, -3) == ".js") {
echo "<script src='./extensions/$extension'></script>"; echo "<script src='./extensions/$extension'></script>";
} }
} }
} }
?> ?>
<?php <?php
require './res/php/GoogleAnalytics.php'; // include google analytics require './res/php/GoogleAnalytics.php'; // include google analytics