Topic: Sorting pubDate in PHP

How can I sort pages with pubDate in php?

I tried something like this...

array_multisort($childmenusortarray,SORT_STRING,$childmenuarray);

... But it doesn't work.

2 (edited by Carlos 2012-02-09 13:07:37)

Re: Sorting pubDate in PHP

Take a look at my -very simple- recent pages plugin's source code...

(edit) I also played with pubDate sorting in this 'trick' (a core patch):
http://get-simple.info/forum/topic/2056 … anagement/

Re: Sorting pubDate in PHP

Depending on what you want to do, an easy solution for displaying a list of pages sorted by pubDate would be using the I18N Search plugin.

(Its source code might be interesting for you, too...)

Re: Sorting pubDate in PHP

@Carlos Thank you, but I'm not a good coder, so I can't do it. I'm trying for like an hour. Could you take the code I posted and do it for me, please?

Also - to not open a new thread - how can I, using the posts.xml file, take the title and the post, sort it by date and then post them in a page using exec-php?

I would really appreciate your help!!

Re: Sorting pubDate in PHP

But what do you want to achieve?

And what is that posts.xml file you say? Some plugin file?

Re: Sorting pubDate in PHP

Carlos wrote:

But what do you want to achieve?

And what is that posts.xml file you say? Some plugin file?

I found the "Recent Pages" plugin that does this job.

pages.xml is under /data/other/. contains information about the pages.