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:
@@ -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>editor@xxx.org.za (Editors)</managingEditor>'."\n";
|
||||
echo '<webMaster>webmaster@xxx.org.za (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";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user