On 8 February 2011 14:49, ideamenDave <[email protected]> wrote:
>
> and also found that 
> http://wiki.habariproject.org/en/Dev:Retrieving_Posts#Ordering_by_post_info
> 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 University
http://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