It would be nice if someone would post a quick fix to $time_ago = intval((time()-strtotime($post->pubdate))/86400)
that would save me from writing the theme functions again. On Sun, Sep 21, 2008 at 10:14 PM, Blake Johnson <[EMAIL PROTECTED]>wrote: > > On Sep 17, 8:11 pm, "Stanley FONG" <[EMAIL PROTECTED]> wrote: > > A quick lesson to me please, not capable of having my own sql query nor > to > > use API yet I'm. > > > > I wrote a little theme function to display posts either 1, 2 or 3 years > ago > > (with parameters such as a time window, e.g. display posts between 1 year > > less 2 weeks to 1 year ...etc). How do I use the lastest API to do the > > same thing? > > Hi Stanley, > > Posts::get() accepts 'before' and 'after' parameters. So you can do > > $begin_date = HabariDateTime::date_create( foo ); > $posts = Posts::get( array( 'before' => $begin_date, 'after' => > $begin_date->modify( '+2 weeks' ) ) ); > > --Blake > > > -- See me at http://am.notsowise.net --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/habari-dev -~----------~----~----~----~------~----~------~--~---
