The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Keeping track of which feed items are shown(using Simplepie)

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #31538

    Hey guys,

    it’s my first time i am posting in the forum.I need your help. I am trying to make a mix of articles from different feeds. The feeds are stored in a database and i am using a random function in order to grab the feeds from the database. Every time a feed is grabbed, its url is passed to the SimplePie object, is parsed and using the set_item_limit(1) article per feed is shown. I do the above process as many times as the articles number I want in the screen finally.

    The problem is that every time a feed is grabbed by the random function from the db, the first article that Simplepie finds is presented on the screen and the next time the same feed is selected the first article again is presented on the screen instead of the second item of that feed and as a result I am receiving many times the same article.

    Can I keep track of the articles that are shown in order not to have the same articles every time the random function selects a feed according to the current structure of my code? Is something wrong in my code?

    Here is my code:

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.