* @license MIT https://opensource.org/licenses/MIT * @link https://marcel-kapfer.de/rangitaki */ // Getting necessary php files date_default_timezone_set('UTC'); require __DIR__ . '/vendor/autoload.php'; // loading composer libs require 'config.php'; // Config file (this must be the first line) require './lang/' . $language . ".php"; // Language file 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"); // get the blog variable $getarticle = filter_input(INPUT_GET, "article"); // get 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"); // get the url (used for sharing) $pagenumber = filter_input(INPUT_GET, "page"); // get the pagenumber // Pagination algorithm if ($pagination == 0) { $pagination = false; } else { // pag_max: the newest post to show on a page $pag_max = $pagination * ( $pagenumber + 1 ); // pag_min: the oldest post to show on a page $pag_min = $pag_max - $pagination; if ($pagenumber > 0) { // Disable the blog intro if not on first page $blogintro = "no"; } } // Fetching necessary information about the current article // Set blog to "main" if on main blog, else to $getblog. // This variable is needed later if ($getblog == "") { $blog = "main"; } else { $blog = $getblog; } // generate a variable with the articles directory $articlesdir = "./articles/$blog/"; // Fetching the articles title if (isset($getarticle)) { $articletitle = ArticleGenerator::getTitle($articlesdir, $getarticle . '.md'); } // Make sure that the entry has a title, because main.md hasn't one if (empty($blogmainname)) { $blogmaintitle = $blogtitle; } else { $blogmaintitle = $blogmainname; } if (isset($getblog)) { $subblogtitle = BlogListGenerator::getName('./blogs/' . $getblog . '.md'); } else { $subblogtitle = $blogmaintitle; } // Generate title for the html head if (isset($getarticle)) { $hd_subblog_title = $articletitle . ' - ' . $subblogtitle; } else { $hd_subblog_title = $subblogtitle; } // url of the feed $feedurl = $blogurl . "/feed/" . $blog . ".atom"; ?>