Posts: 44
Threads: 8
Joined: Feb 2012
How can I sort pages with pubDate in php?
I tried something like this...
Code:
array_multisort($childmenusortarray,SORT_STRING,$childmenuarray);
... But it doesn't work.
Posts: 3,491
Threads: 106
Joined: Mar 2010
2012-02-10, 02:43:01
(This post was last modified: 2012-02-10, 03:07:37 by fotothink.)
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/
Posts: 3,491
Threads: 106
Joined: Mar 2010
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...)
Posts: 44
Threads: 8
Joined: Feb 2012
@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!!
Posts: 3,491
Threads: 106
Joined: Mar 2010
But what do you want to achieve?
And what is that posts.xml file you say? Some plugin file?
Posts: 44
Threads: 8
Joined: Feb 2012
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.