Fix Guestbook RSS Feed
This commit is contained in:
parent
e76610d374
commit
51e63370a4
32
index.xml
32
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' ?>
|
||||||
|
<rss version='2.0'>
|
||||||
<channel>
|
<channel>
|
||||||
<title>Fbi's Epic Guestbook RSS Feed</title>
|
<title>Fbi's Epic Guestbook RSS Feed</title>
|
||||||
<link>https://www.w3schools.com</link>
|
<link>https://www.w3schools.com</link>
|
||||||
<description>A cool Guestbook made by fbievan</description>
|
<description>A cool Guestbook made by fbievan</description>";
|
||||||
<?php
|
|
||||||
$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) {
|
||||||
|
$id = $id + 1;
|
||||||
|
$description = htmlspecialchars($post["message"]);
|
||||||
|
$title = $post["name"];
|
||||||
|
$link = "http://testing.fbievan.live/guestbook?link=$id";
|
||||||
|
echo "
|
||||||
<item>
|
<item>
|
||||||
<title><?php echo $post["name"];?></title>
|
<title>$title</title>
|
||||||
<description><?php echo htmlspecialchars($post["message"]);?></description>
|
<description>$description</description>
|
||||||
</item>
|
<link>$link</link>
|
||||||
<?php endforeach; ?>
|
</item>";
|
||||||
|
};
|
||||||
|
echo "
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>";
|
||||||
|
?>
|
||||||
|
|
Loading…
Reference in New Issue