Fix Guestbook RSS Feed
This commit is contained in:
parent
e76610d374
commit
51e63370a4
44
index.xml
44
index.xml
|
@ -1,18 +1,26 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?php
|
||||||
<rss version="2.0">
|
header( "Content-type: text/xml");
|
||||||
|
echo "<?xml version='1.0' encoding='UTF-8' ?>
|
||||||
<channel>
|
<rss version='2.0'>
|
||||||
<title>Fbi's Epic Guestbook RSS Feed</title>
|
<channel>
|
||||||
<link>https://www.w3schools.com</link>
|
<title>Fbi's Epic Guestbook RSS Feed</title>
|
||||||
<description>A cool Guestbook made by fbievan</description>
|
<link>https://www.w3schools.com</link>
|
||||||
<?php
|
<description>A cool Guestbook made by fbievan</description>";
|
||||||
$data = json_decode(file_get_contents('test.json'), true);
|
$data = json_decode(file_get_contents('test.json'), true);
|
||||||
?>
|
$id = 0;
|
||||||
<?php foreach($data as $post): ?>
|
foreach($data as $post) {
|
||||||
<item>
|
$id = $id + 1;
|
||||||
<title><?php echo $post["name"];?></title>
|
$description = htmlspecialchars($post["message"]);
|
||||||
<description><?php echo htmlspecialchars($post["message"]);?></description>
|
$title = $post["name"];
|
||||||
</item>
|
$link = "http://testing.fbievan.live/guestbook?link=$id";
|
||||||
<?php endforeach; ?>
|
echo "
|
||||||
</channel>
|
<item>
|
||||||
</rss>
|
<title>$title</title>
|
||||||
|
<description>$description</description>
|
||||||
|
<link>$link</link>
|
||||||
|
</item>";
|
||||||
|
};
|
||||||
|
echo "
|
||||||
|
</channel>
|
||||||
|
</rss>";
|
||||||
|
?>
|
||||||
|
|
Loading…
Reference in New Issue