syndicate or RSS feeds

15 posts by 6 authors in: Forums > CMS Builder
Last Post: June 10, 2010   (RSS)

By Dave - March 13, 2008

I think I figured it out. It's the whitespace before the <?xml version=\"1.0\" ... tag.

Remove any spaces before your first <?php tag and view-source on the output and see if you can figure out what's causing the extra whitespace and remove it.

Let me know if that fixes it.
Dave Edis - Senior Developer
interactivetools.com

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.

Re: [benedict] syndicate or RSS feeds

By Dave - September 19, 2008

Hi benedict,

Anytime you have a closing PHP tag and another tag like this:

?>
<rss version="2.0">

Just remove the spaces or nextlines between then so it becomes this:

?><rss version="2.0">

Let me know if that helps or if there is still problems.
Dave Edis - Senior Developer
interactivetools.com

Re: [pod9] syndicate or RSS feeds

By Jason - June 10, 2010

Hi,

If you could email you FTP and CMS Login details to jason@interactivetools.com, I can take a closer look at it for you.

Please just email, don't post this information to the forum.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/