Jump to content

RSS help


KevinM1

Recommended Posts

I have a script that creates an RSS feed for one of the sites I have.  It was working fine, but now it's parsing the info wrong and I'm not sure why.  All it's supposed to do is return a message board post.  Below is the code that creates the link:

[code]
<?php //just to turn on the pretty colors

<link>".$base."forum/viewthread.php?".$rstart."forum_id=".$row['forum_id']."&amp;thread_id=".$row['thread_id']."#post_".$row['post_id']."</link>\n

?>
[/code]

The problem lies at the forum_id - &amp; segment of the code.  Instead of returning something like:
website.com/forum/viewthread.php?rowstart=20[b]forum_id[/b]=4[b]&[/b]thread_id=25#post_66

I get:
website.com/forum/viewthread.php?rowstart=20=4thread_id=25#post_66

Any ideas on why this is screwing up?  And I haven't changed the code in months, so it's not as though I screwed it up by tweaking it myself.
Link to comment
https://forums.phpfreaks.com/topic/23856-rss-help/
Share on other sites

The $rstart variable is fine...all it does is specify which table row to start on for pagination.

I put an ampersand before the forum_id, but I'm not sure if it worked yet.  I use Google for reading my feeds, and sometimes it takes a while for any changes to become apparent.
Link to comment
https://forums.phpfreaks.com/topic/23856-rss-help/#findComment-108425
Share on other sites

I fixed it.  My problem wasn't with creating the feed.  The feed came as part of PHP-Fusion.  The problem came from the pre-existing code using & instead of its HTML entity equivalent whenever the post appeared on any page but the first.  My original tweak (swapping & for its entity), months ago, worked on posts that were on the first page so I thought it would work for all posts, and I didn't notice that $rstart would contain the &.  Oops. :blush:
Link to comment
https://forums.phpfreaks.com/topic/23856-rss-help/#findComment-108498
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.