getRSS only retreives the oldest ten items[solved]

Solutions for other advanced phplisters

getRSS only retreives the oldest ten items[solved]

Postby RTWolf » 6:08pm, Wed 31 Mar, 2010

EDIT: Turns out my issue was the rss items out of order issue. Issue and fix are here: viewtopic.php?f=15&t=24458&p=74116#p74116

Hello,

I'm testing PHPlist with RSS to email blog posts from wordpress and I'm getting an odd error. When I hit getRSS, it always says ten items, no new ones, even though there's more than ten items. In the view RSS items section the first item is the oldest item on the feed. This is a new change since yesterday, when it did have the newest item first. I can't navigate past the first page that displays five items, the buttons do nothing (I don't recall exactly but I don't think this problem existed yesterday either).

The only thing I've done since yesterday to my feed at least, is to switch Feedburner over to the Google account (apparently feedburner was bought by google). If I go to the feed page, http://feeds.feedburner.com/HhFilmBoard, it shows the right order with the latest item first. My guess was that for some reason onyx may be parsing the feed by oldest first, which may because it's being served up that way by the feedburner changeover, or somin. So I did the simplepie mod, here: http://whereelsetoputit.com/blog/2007/u ... simplepie/. No joy.

Any thoughts? Do you think the issue is with the feedburner thing? I'm going to try switching the feedburner plugin off and find an original URL from the site and see if that works better, but any other thoughts would be much appreciated. Update: Odd. I turned off the plugin, but all my feed URLs still go there. Here's one: http://www.hhfilmboard.com/wordpress/feed/rss/

Help?
Last edited by RTWolf on 5:40pm, Sat 03 Apr, 2010, edited 2 times in total.
RTWolf
PL Nut
 
Posts: 24
Joined: 2:42pm, Wed 31 Mar, 2010

Re: getRSS only retreives the oldest ten items

Postby H2B2 » 9:48pm, Wed 31 Mar, 2010

I haven't been using the RSS feature, so can't help much to solve this. Just wondering whether it might be related to a caching issue. This post by kerberos briefly mentions where to change the RSS cache time (in Onyx): [how to] Setting up cron and RSS to auto-generate newsletter

See also: viewtopic.php?f=6&t=4468
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: getRSS only retreives the oldest ten items

Postby RTWolf » 1:48am, Thu 01 Apr, 2010

Thanks for the help. I forgot to mention I did that already, cause I thought that might be an issue.

I'll try with a fresh install of phplist in a few days, because I've added a few patches to the code which may have broken functionality.
RTWolf
PL Nut
 
Posts: 24
Joined: 2:42pm, Wed 31 Mar, 2010

Re: getRSS only retreives the oldest ten items

Postby RTWolf » 4:53pm, Fri 02 Apr, 2010

After a bit of experimenting with two new installs, the problem seems to arise if I change the RSS feed URL after it's been entered by entering a different one. Even if I purgeRSS, it only collects the oldest items. All my feed URLs pointed to the same feed, so I can't tell you whether the problem may not have occured if the new URL was to a different feed.

Solution: Don't edit RSS URL after entering it the first time. If you need to change the RSS URL for subscribers, I think you can create a new list and move your old members over, and that may work. I haven't tested this, though, cause I'm tired, but it should work!
RTWolf
PL Nut
 
Posts: 24
Joined: 2:42pm, Wed 31 Mar, 2010

Re: getRSS only retreives the oldest ten items

Postby H2B2 » 7:48pm, Fri 02 Apr, 2010

RTWolf wrote:the problem seems to arise if I change the RSS feed URL after it's been entered by entering a different one. Even if I purgeRSS, it only collects the oldest items. All my feed URLs pointed to the same fee

I wonder, did you apply this bug fix for v2.10.10? viewtopic.php?p=67474#p67474

You'll notice that the second part of that fix resolves an issue with RSS preferences not being saved.
See also note 5067 (by tipichris) in http://mantis.phplist.com/view.php?id=15285
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: getRSS only retreives the oldest ten items

Postby RTWolf » 12:28am, Sat 03 Apr, 2010

Yep, I had to do that because it wasn't saving my RSS prefs on subscribe page. Subscription settings were all right (I verified by checking the users manually). It still had this issue.

The current install seems to be working fine. I'm just waiting till tomorrow to send another email newsletter and add another test blog item to the RSS. Then, I'll setup some cron stuff and test it out and then make it live.

I thank you for your help, H2B2.
RTWolf
PL Nut
 
Posts: 24
Joined: 2:42pm, Wed 31 Mar, 2010

Re: getRSS only retreives the oldest ten items

Postby RTWolf » 2:35am, Sat 03 Apr, 2010

Hmm, I've been doing a bit more playing around and I'm not sure that there was an issue, just the illusion of an issue.

PHPList pulled in TEN items only because the rss feed actually only contains ten items, always. And it wasn't the ten oldest items. The reason I thought that was because phplist seems to pull in the items and organize them in an arbitrary order (not by pubdate), and I saw the oldest items at the top both in my test emails and in viewRSS and didn't really investigate further. It seems to organize in an arbitrary order if you do a purgerss-getrss, such as when I put in a different feed address. That's why I thought it might be cause of different feed URLs. For some reason pagination in viewrss didn't work, so I wasn't able to investigate further beyond the first five items. In the emails, though, I just checked, all the right items were there, but out of order.

I'm working on a solution to the out-of-order thing and I've found the query that works for me:

SELECT id, title, link, source, list, added, processed, astext, ashtml FROM `phplist_rssitem`, `phplist_rssitem_data` WHERE phplist_rssitem.id = phplist_rssitem_data.itemid AND tag ='pubdate' ORDER BY STR_TO_DATE(data, "%a, %d %b %Y %H:%i:%s +0000") DESC

This is not the whole solution yet, just the SQL query that does what I want. It needs to be rewritten to PHP and then edited into rsslib.php. I will post a full solution process later. It won't be the easiest thing, but it should work.

Basically, the above SQL query needs to be rewritten and replace this line (around 66) in rsslib.php:
$itemreq = Sql_Query("select {$tables["rssitem"]}.*
from {$tables["rssitem"]} where {$tables["rssitem"]}.list in ($liststosend) order by added desc, list,title limit $max");

Also need to make sure that the "%a, %d %b %Y %H:%i:%s +0000" bit is the right format for pubdate tags in RSS feeds. Mine, from Wordpress, for example, are in the format "Sat, 03 Apr 2010 00:43:49 +0000". So, if your pubdate doesn't match that format, you'll need to use this table to rewrite the format string: http://dev.mysql.com/doc/refman/5.1/en/ ... ate-format

I'll finish this and write up some instructions later.
RTWolf
PL Nut
 
Posts: 24
Joined: 2:42pm, Wed 31 Mar, 2010

Re: getRSS only retreives the oldest ten items

Postby RTWolf » 7:40am, Sat 03 Apr, 2010

Found out some other stuff, will post tomorrow. Immediately, though, to fix viewRSS pagination not working, find these lines and add the bolded one in admin/viewrss.php:

$req = Sql_query("SELECT count(*) FROM $querytables $subselect");
$total_req = Sql_Fetch_Row($req);
$total = $total_req[0];
$start = $_GET["start"];
if (isset($start) && $start > 0) {

I haven't seen any mention of this issue elsewhere, should I create a bug report in mantis and the fix?
RTWolf
PL Nut
 
Posts: 24
Joined: 2:42pm, Wed 31 Mar, 2010


Return to Advanced Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests