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