* @license MIT https://opensource.org/licenses/MIT * @link https://marcel-kapfer.de/rangitaki */ // Getting necessary php files date_default_timezone_set('UTC'); require 'config.php'; // Config file (this must be the first line) require './lang/' . $language . ".php"; // Language file require_once 'res/php/Parsedown.php'; // The soul of the beast: Parsedown require_once 'res/php/ArticleGenerator.php'; // The article generator require_once './res/php/BlogListGenerator.php'; // and the blog list generator // Getting some variables ($_GET and $_SERVER) $getblog = filter_input(INPUT_GET, "blog"); // getting the blog variable $getarticle = filter_input(INPUT_GET, "article"); // getting the article variable $gettag = filter_input(INPUT_GET, "tag"); // getting the tag variable $url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") . filter_input(INPUT_SERVER, "REQUEST_URI"); // getting the url (used for sharing) ?> <?php echo $blogtitle; // Setting the blog article?> skip it if ($nav_drawer == "yes") { ?>
">
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."; } ?>
Share