I believe 0.7 has the answers to all my problems.  I'm excited to see
it finally come out.  I've been tempted to start playing around with
the bleeding edge versions, but until now not tempted enough.  I see
in the release notes a bullet point that makes me giddy:
--Retrieving and ordering posts via post info is now supported.

Kudos to progress, and I'll start playing around with it to see if it
works.  If it does (and I can refine the code to make it more general)
I'd like to offer my plugin to the available plugins.  I'm pretty sure
there's plenty of use for it. The eventscontent plugin I based it on
was a decent learning tool, but was sorely missing the sorting by
event date functionality.  All told, I've seen it work once, if only
for a moment, and I'm delighted to learn that you folks have been
working to make Habari do this stuff for longer then I've been trying
to get my web site to do it.

Thanks all, and congrats on the upcoming release!
--dg

On Feb 7, 10:51 pm, ideamenDave <[email protected]> wrote:
> Hey there Michael.  Nope, that comma was the only error I could see,
> and really the only bit I changed in my version.  I also tried a
> handful of variations on the quote type and placement in the cast
> line, like
> array('cast(hipi1.value as integer) as order1'),
> array(cast('hipi1.value' as integer) as 'order1'),
> array(cast(hipi1.value as integer) as 'order1'),
> etc with varying error messages and results, some of which were
> promising, as the errors contained things like "post__info" and "hipi"
> and stuff about joining tables, which made me feel like I knew what I
> was doing, which I don't.
> If you need any other info or to gloss over my plugins/files in order
> to make sense of this, just holler and I'll make them available.
> Thanks for the quick reply and wiki fix,
> --dg
>
> On Feb 7, 10:18 pm, "Michael C. Harris" <[email protected]>
> wrote:
>
> > On 8 February 2011 14:49, ideamenDave <[email protected]> wrote:
>
> > > and also found 
> > > thathttp://wiki.habariproject.org/en/Dev:Retrieving_Posts#Ordering_by_pos...
> > > had been updated recently to include this code:
> > > public function theme_popular_posts($theme, $limit = 5)
> > > {
> > >  $theme->popular_posts = Posts::get(array(
> > >    'content_type' => 'entry',
> > >    'has:info' => 'views',
> > >    'add_select' => array("cast(hipi1.value as integer) as order1"),
> > >    'orderby' => 'order1 DESC'
> > >    'limit' => $limit
> > >  ));
> > >  return $theme->display( 'popular_posts' );
> > > }
>
> > > I really want to know how to use this.  The above code has syntax
> > > errors, and I have no idea what they are.
>
> > It may not fix your issue, but the syntax error was a missing comma at
> > the end of the orderby parameter. I've fixed the wiki.
>
> > --
> > Michael C. Harris, School of CS&IT, RMIT 
> > Universityhttp://twofishcreative.com/michael/blog
> > IRC: michaeltwofish #habari

-- 
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-users

Reply via email to