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

By benedict - September 19, 2008

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: [Dave] syndicate or RSS feeds

By pod9 - June 10, 2010

Hi, I have no idea how to create an rss feed. I have tried to follow the instructions on this page but with no luck. Is the page that we are trying to create here the one that I need to link to from the RSS button on the main pages? (The equivelent of this page http://www.ainscough.co.uk/artman2/publish/rss.xml ?)

I have created 2 pages with the following code:

<?php // Load record list
require_once "/home/fhlinux129/j/judgeandhoward.com/user/htdocs/cmsAdmin/lib/viewer_functions.php";
$options = array();
$options['tableName'] = 'blog';
$options['perPage'] = '10';
$options['pageNum'] = '1';

echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
?> [/#0000ff]

<rss version="2.0">
<channel>
<title>Judge and Howard</title>
<link>http://www.judgeandhoward.com/blog/</link>
<description>Judge & Howard is a fast-growing communications business with public relations at its core.</description>
<pubDate><?php echo date('r'); ?></pubDate>
<language>en-us</language>

<?php foreach ($listRows as $record): ?>
<item>
<title><?php echo $record['title'] ?></title>
<link>http://www.judgeandhoward.com/blog/<?php echo $record['_link'] ?></link>
<description><?php echo $record['summary'] ?></description>
<pubDate><?php echo date("jS M, Y", strtotime($record['date'])) ?></pubDate>
<guid isPermaLink="true">http://www.judgeandhoward.com/blog/<?php echo $record['_link'] ?></guid>
</item>
<?php endforeach ?>
</channel>
</rss>[/#0000ff]

One of the pages was saved and uploaded as http://www.judgeandhoward.com/blog/rss.php (and comes up with "Internet Explorer cannot display this feed")
The other page a saved as http://www.judgeandhoward.com/blog/rss.xml which comes up with a different error.[/#000000]

Please advise.[/#000000]
Pod9

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/