Take the site address from SITE_URL.

The feed links, the notification email, the webmaster address and the cookie domain now use it.
This commit is contained in:
tim
2026-09-26 15:27:51 +02:00
parent 52f4855850
commit 5d657d7e45
11 changed files with 75 additions and 30 deletions
+11 -9
View File
@@ -10,6 +10,8 @@ $show = get_show_num();
$table = "xxx";
header("Content-Type: application/rss+xml");
$site = xml_text(site_url());
// Set up a RSS "header"
$query = "SELECT MAX(`date`) FROM $table;";
@@ -21,19 +23,19 @@ echo '<?xml version="1.0"?>'."\n";
echo '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">'."\n";
echo '<channel>'."\n";
echo '<title>x.x.x</title>'."\n";
echo '<link>http://xxx.org.za/</link>'."\n";
echo '<description>Most recent articles from xxx.org.za</description>'."\n";
echo '<link>'.$site.'/</link>'."\n";
echo '<description>Most recent articles from '.xml_text(site_host()).'</description>'."\n";
echo '<language>en-za</language>'."\n";
echo '<pubDate>'.$now.'</pubDate>'."\n";
echo '<lastBuildDate>'.date("D, d M Y H:i:s O", strtotime($most_recent[0])).'</lastBuildDate>'."\n";
echo '<managingEditor>&#101;&#100;&#105;&#116;&#111;&#114;&#64;&#120;&#120;&#120;&#46;&#111;&#114;&#103;&#46;&#122;&#97; (Editors)</managingEditor>'."\n";
echo '<webMaster>&#119;&#101;&#98;&#109;&#97;&#115;&#116;&#101;&#114;&#64;&#120;&#120;&#120;&#46;&#111;&#114;&#103;&#46;&#122;&#97; (Webmasters)</webMaster>'."\n";
echo '<atom:link href="http://xxx.org.za/feed" rel="self" type="application/rss+xml" />'."\n";
echo '<managingEditor>'.hidden_email(site_email('editor')).' (Editors)</managingEditor>'."\n";
echo '<webMaster>'.hidden_email(site_email('webmaster')).' (Webmasters)</webMaster>'."\n";
echo '<atom:link href="'.$site.'/feed" rel="self" type="application/rss+xml" />'."\n";
echo '<item>'."\n";
echo '<title>Front Page</title>'."\n";
echo '<link>http://xxx.org.za/</link>'."\n";
echo '<link>'.$site.'/</link>'."\n";
echo '<pubDate>'.date("D, d M Y H:i:s O", strtotime($most_recent[0])).'</pubDate>'."\n";
echo '<guid>http://xxx.org.za/</guid>'."\n";
echo '<guid>'.$site.'/</guid>'."\n";
echo '</item>'."\n";
/*
@@ -52,14 +54,14 @@ foreach ($result as $entry) {
$id = (int)$entry['id'];
echo '<item>'."\n";
echo '<title>'.xml_text($entry['title']).'</title>'."\n";
echo '<link>http://xxx.org.za/article?id='.$id.'</link>'."\n";
echo '<link>'.$site.'/article?id='.$id.'</link>'."\n";
echo '<pubDate>'.date("D, d M Y H:i:s O", strtotime($entry['date'])).'</pubDate>'."\n";
if ($entry['img'])
echo '<description>Image: '.xml_text($entry['title']).'</description>'."\n";
else
echo '<description>'.xml_text(strip_tags($entry['story'])).'</description>'."\n";
echo '<dc:creator>'.xml_text($entry['author']).'</dc:creator>'."\n";
echo '<guid>http://xxx.org.za/article?id='.$id.'</guid>'."\n";
echo '<guid>'.$site.'/article?id='.$id.'</guid>'."\n";
echo '</item>'."\n";
}