Re: [Dave] syndicate or RSS feeds
Hi Dave,
I am at exactly this point. I can get it to validate if I manually remove the single whitespace before <?xml version="1.0"...
Problem is, I can't get rid of it. Would you have any ideas?
Although probably not required, my code is here:
<?php
header('Content-type: application/xml; charset=utf-8');
require_once "/home/jsticksd/public_html/cmsAdmin/lib/viewer_functions.php";
$options = array();
$options['tableName'] = 'press_releases';
$options['titleField'] = 'title';
$options['viewerUrl'] = 'http://www.2sticksdigital.com.au/pressreleasedetail.php';
$options['perPage'] = '10';
$options['orderBy'] = 'date DESC, title';
$options['pageNum'] = '1';
list($listRows, $listDetails) = getListRows($options);
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
?>
<rss version="2.0">
<channel>
<title>2 Sticks Digital Marketing</title>
<link>http://www.2sticksdigital.com.au</link>
<description>Full Digital Marketing Agency</description>
<pubDate><?php echo date('r'); ?></pubDate>
<language>en-us</language>
<?php foreach ($listRows as $record): ?>
<item>
<title><?php echo htmlspecialchars($record['title']) ?></title>
<link><?php echo $record['_link'] ?></link>
<description><?php echo htmlspecialchars($record['summary']); ?></description>
<pubDate><?php echo date("r", strtotime($record['date'])) ?></pubDate>
<guid isPermaLink="true"><?php echo $record['_link'] ?></guid>
</item>
<?php endforeach ?>
</channel>
</rss>
The page above is at http://www.2sticksdigital.com.au/pressreleaselist.php
And the rss page is at http://www.2sticksdigital.com.au/articlerss.php
Thanks.