mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
31 lines
760 B
PHP
31 lines
760 B
PHP
<?php
|
|
//header("Content-type: text/xml");
|
|
header('Content-Type: application/json');
|
|
global $global, $config;
|
|
if (!isset($global['systemRootPath'])) {
|
|
require_once '../videos/configuration.php';
|
|
}
|
|
require_once $global['systemRootPath'] . 'objects/user.php';
|
|
require_once $global['systemRootPath'] . 'objects/category.php';
|
|
|
|
$obj = new stdClass();
|
|
$obj->error = true;
|
|
$obj->msg = '';
|
|
|
|
if (!Permissions::canGenerateSiteMap()) {
|
|
$obj->msg = __("Permission denied");
|
|
die(json_encode($obj));
|
|
}
|
|
$sitemap = siteMap();
|
|
|
|
if (empty($sitemap)) {
|
|
$obj->msg = "Sitemap content is empty";
|
|
die(json_encode($obj));
|
|
}
|
|
|
|
|
|
$name = "sitemap.xml";
|
|
ObjectYPT::setCache($name, $sitemap);
|
|
|
|
$obj->error = false;
|
|
die(json_encode($obj));
|