Problems with object_count_by_user_id

Author Message

Eivind Marienborg

Sunday 15 August 2004 6:55:25 am

I'm trying to use the object_count_by_user_id to show the number of forum-posts done by each user. I've inserted the following code in my forum_topic.tpl:

                        {let objcount=fetch( 'content', 'object_count_by_user_id',
                        hash( 'class_id', 45,
                        'user_id', $owner.main_node_id ) )}
                        {$owner.main_node_id}
                        <p>{$objcount} posts</p>
                        {/let}

It returns "0 posts" for all users, no matter how many posts they've actually done.. Any ideas as to why this doesn't work?

Paul Forsyth

Sunday 15 August 2004 1:50:05 pm

Check the permissions for the user making this request. It might not be allowed to access other users information. If you are the anonymous user then maybe you need to changes its permissions.

paul

--
http://www.visionwt.com

Eivind Marienborg

Sunday 15 August 2004 3:23:50 pm

It returns 0 when I'm logged in as Administrator User (with all rights) too, so it's got to be something else..

Paul Forsyth

Monday 16 August 2004 1:56:32 am

I tried this and it works for me.

I think your input to the function is wrong. You use $owner.main_node_id but i think it should be $owner.id.

paul

--
http://www.visionwt.com

Eivind Marienborg

Monday 16 August 2004 2:16:50 am

uuuh, that works great! Thanks! :D

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