Groupjive module

1 year 4 months ago - 1 year 4 months ago #331553 by galanopd
Replied by galanopd on topic Groupjive module
One more question on this
Is it possible to subtract 1 user from   .

I need this because the specific group is created by an AA and the owner is the Administrator, so I don't want it to count the Administrator as a user.
Attachments:

Please Log in to join the conversation.

1 year 4 months ago #331562 by krileon
Replied by krileon on topic Groupjive module
Yes, the user count is passed through the group object using a temporary variable so you should be able to modify it using CB Auto Actions. Below the below should work.

Global
Triggers: gj_onDisplayGroup
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
$usersCount = $variables['var1']->get( '_users', 0 );

$variables['var1']->set( '_users', ( $usersCount ? $usersCount - 1 : 0 ) );
Parameters
References: Variable 1


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

1 year 4 months ago #331569 by galanopd
Replied by galanopd on topic Groupjive module
I followed steps carefully but it is not deducting 1 user.
I though it was the Condition  
and I took the Condition out but it still shows the number of users with Admin included.
Attachments:

Please Log in to join the conversation.

1 year 4 months ago #331584 by krileon
Replied by krileon on topic Groupjive module
Be sure the reference is set under the Parameters tab. This may not work if users count is having to fallback to performing the count as a separate query though.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

1 year 4 months ago #331689 by galanopd
Replied by galanopd on topic Groupjive module

Be sure the reference is set under the Parameters tab. This may not work if users count is having to fallback to performing the count as a separate query though.

The reference is set to Parameters->References->Variable 1.
There is no query here.
What I have noticed is that it does work in community/groups where all the groups are visible. For instance, it shows in a group 2 users when in community/groups but when I click on this group and go to community/groups/1-mycategory/23-mygroup to view group's members then it shows 3 users.

I am also trying to narrow it down to specific category using

Conditions
Field -> Value
Custom Value ->[var2_category]
Operator -> Equal To
Value -> 1
 

Please Log in to join the conversation.

1 year 4 months ago #331694 by krileon
Replied by krileon on topic Groupjive module
Make a second auto action as follows and that should cover the group page as well.

Global
Triggers: gj_onBeforeDisplayGroup
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
$usersCount = $variables['var2']->get( '_users', 0 );

$variables['var2']->set( '_users', ( $usersCount ? $usersCount - 1 : 0 ) );
Parameters
References: Variable 2


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.220 seconds