Keyword

Multiple Feed Date/Time Overlap

  • jniebuhr
  • jniebuhr's Avatar Topic Author
  • Offline
  • New Member
More
13 years 7 months ago #39849 by jniebuhr
Multiple Feed Date/Time Overlap was created by jniebuhr
When a feed does not specify a unique date/time per record the records will over write. The following code is a cheap band aid that corrects by incrementing the minute to create a unique index. This date/time is used in the sorting of records and is not displayed.

Helper.php line 71
// Give each feed an index based on date
$itemDateIndex = $item->get_date('YmdHi');
while (isset($feedItemsArray[$itemDateIndex]) || array_key_exists($itemDateIndex, $feedItemsArray)) {  $itemDateIndex = date('YmdHi', strtotime($itemDateIndex.' '.'+ 1 minutes'));
}

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #39850 by merugo
Replied by merugo on topic Re: Multiple Feed Date/Time Overlap
I can't get that code to work in version 3.0

I try to use it on line 58, but it just breaks the site.

Does anyone have a fix for this in later versions?

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago - 11 years 3 months ago #39851 by merugo
Replied by merugo on topic Re: Multiple Feed Date/Time Overlap
Ops, my bad. Actually, I did get it to work now. I don't know what I did wrong before, but in version 3.0 you should make line 58 look like this:
$itemDateIndex = strftime('%Y%m%d%H%M',strtotime($item->pubDate)); while (isset($feedItemsArray[$itemDateIndex]) || array_key_exists($itemDateIndex, $feedItemsArray)) {  $itemDateIndex = date('YmdHi', strtotime($itemDateIndex.' '.'+ 1 minutes'));
}

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum