Forums / Developer / Problems when using ezcomments

Problems when using ezcomments

Author Message

Lars Eirik R

Tuesday 14 September 2010 5:45:12 am

Hi.

I need to present the latest comments which have been added to the system. I would not like to sort results based on contentobjectids and this should all be possible by using ezcomFunctionCollection::fetchCommentListByContentObjectIDList(null,null,null,null,null,null,0,100,array());

When I do this however i only get an empty result back.

it also produces an sql query error.

Is anyone able to reproduce this?

I am running ezcomments v 1.1 (the function was not available in preveious releases.)

Update 1: I managed to get the fetch function to work, but only when used as a template fetch on my 4.4beta3 installation of eZPublish.

I now made the extension work for ezPublish 4.2 as well:)

Any one who can help me out with an example of calling the fetchCommentListByContentObjectIDList which fetches all comments regardless of user or contentobjectid?

Update 2: I tried to use the fetchLatestComments instead as a funciton in php and this seems to work as i was hoping:)

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

eZ debug

Timing: Jan 29 2025 13:45:05
Script start
Timing: Jan 29 2025 13:45:05
Module start 'content'
Timing: Jan 29 2025 13:45:05
Module end 'content'
Timing: Jan 29 2025 13:45:06
Script end

Main resources:

Total runtime0.1792 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 587.9297180.8359
Module start 'content' 0.00790.0065 768.765697.8984
Module end 'content' 0.01430.1648 866.6641526.7734
Script end 0.1792  1,393.4375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.9354200.0002
Check MTime0.00140.7602200.0001
Mysql Total
Database connection0.00110.619310.0011
Mysqli_queries0.131873.54391410.0009
Looping result0.00130.71091390.0000
Template Total0.164491.710.1644
Template load0.00080.441410.0008
Template processing0.163691.292510.1636
Override
Cache load0.00050.289610.0005
Sytem overhead
Fetch class attribute can translate value0.00100.576910.0010
XML
Image XML parsing0.00030.142310.0003
General
dbfile0.00744.1010200.0004
String conversion0.00000.005130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs