Fix sitemap
Most importantly, make it work globally.
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
function directoryToArray($directory, $recursive) {
|
||||
$array_items = [];
|
||||
if ($handle = opendir($directory)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (is_dir($directory . '/' . $file)) {
|
||||
if ($recursive) {
|
||||
$array_items = array_merge($array_items, directoryToArray($directory . '/' . $file, $recursive));
|
||||
}
|
||||
$file = $directory . '/' . $file;
|
||||
} else {
|
||||
$file = $directory . '/' . $file;
|
||||
$array_items[] = preg_replace("/\/\//si", '/', $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
return $array_items;
|
||||
}
|
||||
$files = directoryToArray('./pages', true);
|
||||
foreach ($files as $file) {
|
||||
if (substr($file, -3) == '.pg' and (substr($file, 0, 17) != './pages/cs/error/' and substr($file, 0, 17) != './pages/en/error/' and substr($file, 0, 17) != './pages/de/error/')) {
|
||||
$list .= substr($file, 0, -3) . "\n";
|
||||
}
|
||||
}
|
||||
echo str_replace('./pages', 'http://' . $_SERVER['HTTP_HOST'], $list);
|
||||
Reference in New Issue
Block a user