Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sorting pubDate in PHP
#1
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.
Reply
#2
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/
Reply
#3
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...)
Reply
#4
@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!!
Reply
#5
But what do you want to achieve?

And what is that posts.xml file you say? Some plugin file?
Reply
#6
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.
Reply




Users browsing this thread: 1 Guest(s)