-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsitemap.php
45 lines (40 loc) · 1.18 KB
/
sitemap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
include_once 'scripts/lang.php';
$language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$deviceLang = substr($language, 0, 2);
session_start();
$lang = isset($_SESSION['lang']) ? $_SESSION['lang'] : $deviceLang;
?>
<!DOCTYPE html>
<html lang="<?php echo $lang; ?>">
<head>
<title><?php getValueFromJson('title'); ?></title>
<?php include 'components/head.php'; ?>
</head>
<body>
<?php include ('components/scrollToTop.php'); ?>
<header>
<?php include ('components/header.php'); ?>
</header>
<main>
<h1><?php getValueFromJson('description') ?></h1>
<?php
$sitemap = simplexml_load_file('sitemap.xml');
foreach ($sitemap->url as $url) {
echo '<h3>';
echo '<a style="color: black;" href="'. explode('/', $url->loc)[1] .'">';
$locParts = explode('/', $url->loc);
$lastPart = end($locParts);
$lastPart = pathinfo($lastPart, PATHINFO_FILENAME);
echo $lastPart;
echo '</a>';
echo '</h3>';
}
?>
</main>
<footer>
<?php include ('components/footer.php'); ?>
</footer>
</body>
</html>
<!-- © AIMA DEVELOPPEMENT 2024 -->