1
playsome
rss feeds not displaying in date order, how to fix?
  • 2010/9/3 21:43

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


Hello all,

I am using the article 2.0RC module by PHPPP and I am having some trouble getting the articles to display by published date(most recent first).

In my live site the article order is all over the place see here in my local test site the article ordering seems to be most recent last.

Some rss readers to display the articles in order (e.g opera) but the source code always shows the articles in the wrong order.

In an effort to try and figure this out myself i am focusing on this piece of code within /article/xml.php

$criteria->add(new Criteria("art_time_publish"0">"));


Im not sure if this is the correct code to be looking but it looks like a good start.

I am struggling to understand though what this code is doing, I know xoops criteria class is for database searching the first value "art_time_publish" is the field in the DB but im not sure about the other two values according to xoops wiki they are $value and $op1 but i dont know what this means, why is 0 a value? a value of what? and the last one > does this mean greater than in this case or something different?

Thanks for your help, im slowly learning php, i just need a few hints now and again.

Cheers

2
ghia
Re: rss feeds not displaying in date order, how to fix?
  • 2010/9/3 22:24

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Yes, the criteria is looking for records that have a publishing date set (greater than zero).
Try by adding:
$criteria->setOrder('DESC');
        
$criteria->setSort('art_time_publish');

3
playsome
Re: rss feeds not displaying in date order, how to fix?
  • 2010/9/6 15:24

  • playsome

  • Not too shy to talk

  • Posts: 197

  • Since: 2009/4/15


ghia, thankyou.

Your suggestion has worked perfectly. items now display in order.

thankyou very much

Login

Who's Online

193 user(s) are online (55 user(s) are browsing Support Forums)


Members: 0


Guests: 193


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits