Problems when using ezcomments

Problems when using ezcomments

Tuesday 14 September 2010 5:45:12 am - 3 replies

Modified on Tuesday 14 September 2010 6:45:54 am by Lars Eirik R

Author Message

Chen Xiongjie

Tuesday 14 September 2010 1:08:22 pm

Hi, Lars,

The fetch functions were designed to be used in template, so it will be safe to use them in template.

But if you try to use fetchCommentListByContentObjectIDList in php, I think the problem is that the sortby field missing(which can be seen as a inconvenient issue :) ). So if you use fetchCommentListByContentObjectIDList(null,null,null,null,'modified',null,0,100,array()), it should work.

But still fetch function in template is recommended.

Documentation: http://ez.no/doc/extensions/ez_comments/setup_and_user_guide_1_1/template_fetch_functions/comment_list_by_content_list

Thanks.

Chen

eZ Comments: http://projects.ez.no/ezcomments
twitter: http://twitter.com/xiongjie

Lars Eirik R

Tuesday 14 September 2010 2:06:15 pm

Thanks for responding Chen!

I have not used the fetchCommentLIstByContentObjectIDList after encountering the problem of calling it from php.. Also i have successfully been using fetchLatestComments:)

I will try to use the other function just to test if it works with adding the sortby field:)

Once again, thanks

Bayron Guevara

Monday 27 September 2010 10:57:31 pm

Hello Lars,

As Jerom said, you can call a fetch function from PHP as easier as inside a template. Just make a call to eZFunctionHandler::execute with the appropiate parameters. In your case it would be something like:

eZFunctionHandler::execute('comment', 'comment_list_by_content_list', array(
  'sort_field' => 'modified',
  'sort_order' => 'desc'
));

Web Developer & Modern Philosopher
Visit http://www.laprensa.hn, http://www.diez.hn, http://www.estilo.hn

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.