adlerka.top/index.php

32 lines
749 B
PHP
Raw Normal View History

2024-02-03 16:46:09 +01:00
<?php
2024-02-06 16:24:57 +01:00
/** @noinspection PhpIncludeInspection */
2024-02-03 16:54:04 +01:00
require_once 'secrets/config.php';
require_once 'lib/config.php';
require_once 'lib/navigation.php';
require_once 'lib/router.php';
require_once 'lib/page.php';
require_once 'lib/endpoint.php';
require_once 'lib/account.php';
2024-02-06 16:24:57 +01:00
$routerConfig = loadRouterConfig();
2024-02-03 16:54:04 +01:00
2024-02-06 16:24:57 +01:00
$routerRequest = initRouter();
2024-02-03 16:54:04 +01:00
2024-02-06 16:24:57 +01:00
session_start();
2024-02-03 16:54:04 +01:00
2024-02-06 16:24:57 +01:00
if (!isLoggedIn()) {
setDefaultSessionData();
}
2024-02-03 16:54:04 +01:00
2024-02-15 10:17:09 +01:00
if($routerRequest["site_name"] == "sitemap.xml") {
require "lib/sitemap.php";
2024-02-15 10:41:48 +01:00
generateSitemap();
2024-02-15 10:19:52 +01:00
exit();
2024-02-15 10:17:09 +01:00
}
2024-02-06 16:24:57 +01:00
if ($routerRequest["type"] == "api") {
2024-02-06 16:34:53 +01:00
echo getEndpoint($routerRequest["site_name"]);
2024-02-03 16:54:04 +01:00
2024-02-06 16:24:57 +01:00
} elseif ($routerRequest["type"] == "page") {
echo getPage($routerRequest["site_name"], $routerRequest["page_name"]);
2024-02-03 16:46:09 +01:00
}