forked from Adleraci/adlerka.top
Create sitemap
This commit is contained in:
parent
92c470aade
commit
23b96a3942
@ -20,7 +20,8 @@ if (!isLoggedIn()) {
|
|||||||
|
|
||||||
if($routerRequest["site_name"] == "sitemap.xml") {
|
if($routerRequest["site_name"] == "sitemap.xml") {
|
||||||
require "lib/sitemap.php";
|
require "lib/sitemap.php";
|
||||||
return generateSitemap();
|
echo generateSitemap();
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($routerRequest["type"] == "api") {
|
if ($routerRequest["type"] == "api") {
|
||||||
|
@ -12,15 +12,16 @@ function initRouter(): array
|
|||||||
|
|
||||||
$request_uri = array_slice($request_uri, -3, 3);
|
$request_uri = array_slice($request_uri, -3, 3);
|
||||||
|
|
||||||
$routerRequest["site_name"] = basename($request_uri[1]);
|
|
||||||
$routerRequest["page_name"] = basename($request_uri[2]);
|
|
||||||
|
|
||||||
if (empty($routerRequest["site_name"])) {
|
$routerRequest["site_name"] = $routerConfig["default_site"];
|
||||||
$routerRequest["site_name"] = $routerConfig["default_site"];
|
$routerRequest["page_name"] = $routerConfig["default_page"];
|
||||||
|
|
||||||
|
if(count($request_uri > 2)){
|
||||||
|
$routerRequest["page_name"] = basename($request_uri[2]);
|
||||||
}
|
}
|
||||||
|
if(count($request_uri) > 1){
|
||||||
|
$routerRequest["site_name"] = basename($request_uri[1]);
|
||||||
|
|
||||||
if (empty($routerRequest["page_name"])) {
|
|
||||||
$routerRequest["page_name"] = $routerConfig["default_page"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_SERVER["REQUEST_METHOD"] == "POST"){
|
if($_SERVER["REQUEST_METHOD"] == "POST"){
|
||||||
|
Loading…
Reference in New Issue
Block a user