3) { // Checking if not in article or tag view and if there are more the one blog. The 3 is for these three array entries: 'main.md', '.', '..'
echo "
";
echo "" . $BLOGLANG['Blogs on'] . " $blogtitle:
"; // 1. Set localized string 2. Set blogtitle
foreach ($blogs as $blog) { // iterating through the blogs/ directory
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") { // check if filename is larger than three chars and if the file ends with ".md"
if ($getblog == "") { // Run when on main blog
if ($blog != "main.md") { // excluding main blog
BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle); // creating navigation item
}
} else {
if ($getblog . ".md" != $blog) { // Check if $blog is current blog -> this blog will be excluded
// Make sure that the entry has a title, because main.md hasn't one
if (empty($blogmainname)) {
$blogmaintitle = $blogtitle;
} else {
$blogmaintitle = $blogmainname;
}
BlogListGenerator::listBlog("./blogs/", $blog, $blogmaintitle); // creating navigation item
}
}
}
}
echo "";
} elseif (isset($getarticle) || isset($gettag)) { // If viewing a blog or a tag
?>
Go back
3) { // if there is no content, don't show the intro
?>
setBreaksEnabled(true) // with linebreaks
->text($file);
echo $intro; // PRINTS THE SH****
?>
tag view
$articles = scandir($articlesdir, 1); // save the content of the directory in the articles variable
foreach ($articles as $article) { // iterate through all articles
$tags = ArticleGenerator::getTags($articlesdir, $article); // get the article tags
if (in_array($gettag, $tags)) { // if the article has the requested tag
if (strlen($article) >= 3 && substr($article, -3) == ".md") { // check if the file is a article file
ArticleGenerator::newArticle($articlesdir, $article, $getblog); // generate the article
}
}
}
} elseif ($getarticle == "") { // NORMAL VIEW if there's no article request -> normal view
$articles = scandir($articlesdir, 1); // save the content of the directory in the articles variable
foreach ($articles as $article) { // iterate through this variable
if (strlen($article) >= 3 && substr($article, -3) == ".md") { // check if the file is a article file
ArticleGenerator::newArticle($articlesdir, $article, $getblog); // generate the article
}
}
} elseif (isset($getarticle)) { // ARTICLE VIEW
ArticleGenerator::newArticle($articlesdir, $getarticle . ".md", $getblog); // generate the requested article
include './res/php/Disqus.php'; // include disques
} else { // SOMETHING STRANGE: THIS SHOULDN'T HAPPEN
echo "Some error occured, please go back.";
}
?>