Skip to Content Skip to Menu

Search Results (Searched for: Triggers:)

  • krileon
05 Aug 2025 14:34
There's a trigger for that view so yes that's possible to add more information there using CB Auto Actions. Specifically the below trigger.
Code:
$_PLUGINS->trigger( 'gj_onDisplayUser', array( &$row, &$counters, &$content, &$menu, $group, $user ) );

$row = gj group user object
$counters = array of content displayed in the footer (where Member is)
$content = custom content displayed below the footer
$menu = custom links for the dropdown menu
$group = gj group object
$user = cb user object

So the below for example should work to output whatever profile fields you like.

Global
Triggers: gj_onDisplayUser
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
Code:
$variables['var2'][] = 'Test';
Parameters
Reference Variables: Variable 2

With the above you should see "Test" output in the footer now. Replace that with substitutions or with whatever custom PHP you want. Add more to that array to output more as it'll split them into containers for the footer.
  • AlexRag
22 Jul 2025 04:47 - 22 Jul 2025 04:49
My ask here is similar to my use case in this post:   www.joomlapolis.com/forum/developer-members-support/247045-automatically-moving-members-from-one-group-to-another-on-expiration#339232 , where I wanted expiring members to be moved from a "Paid Member" usergroup to a "Free Member" usergroup (instead of just the standard Joomla "registered" one, which CBSubs does by default).   The solution is an AutoAction as described below:

Global
Triggers: onCPayUserStateChange
Type: Usergroup
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Not Equal To
Value: A
Action
Action 1
Mode: Remove Usergroups
Usergroups: REMOVE_USERGROUP_HERE
Action 2
Mode: Add Usergroups
Usergroups: ADD_USERGROUP_HERE

Replace PLAN_ID_HERE with your plans id. That auto action should then fire when their plan expires. If you know they'll only have those 2 usergroups you can just use the Replace Usergroups mode.

I am looking to do something that is, in a way, the reverse.

This new use-case came about because I discovered that when "Free Plan" members who are in a Free Plan usergroup upgrade to a Paid Plan, they are not only added to the "Paid Plan" usergroup but also kept in the "Free Plan usergroup. 

I'd like the ability to remove a user from the "Free Member" usergroup when they upgrade, and wondering if I should use the same trigger "onCPayUserStateChange"

The reason this has become a problem is that I have some AutoActions that limit access to certain things to Free Members based on which user group they are in.    That being said, I may be able to revise these autoActions since there is now a "Subscriptions" condition instead of currently using the "usergroups" condition.

Regardless, I think it will be too confusing to have members in two user groups (It also makes it harder to filter searches in the backend).  Could I get some advice on how best to remove users from a usergroup upon a plan change that is an upgrade or renewal?
  • AlexRag
21 Jul 2025 19:11
Thanks, I will give this a try!

Does this look correct?

Global
Triggers: onCPayDisplayBasketResult
Type: Redirect
User: Self
Access: Everybody

Condition #1
Field: Custom > Value
Custom Value: [var1_payment_status]
Operator: Equal To
Value: Completed

Condition#2
Field:  Subscriptions
User: Action User
Operator: Has
Plans: Special Plan
Status: Active

Action
URL: (Whichever URL on the site I want to redirect to)
Message: [var2]

Sorry, I have just thought of a couple of follow-up questions/comments:

1. What is the message of [var2], and does it appear just before the redirect?  (I am guessing it's what appears as part of the "completed basket payment" page?     
2. I have forgotten where I would be able to customize that message if possible.   I am thinking it may be easier just to add the URL there in the message for them to follow instead of the Auto Action.
  • krileon
18 Jul 2025 13:15 - 18 Jul 2025 13:20
The below should do the trick using CB Auto Actions.

Global
Triggers: onCPayDisplayBasketResult
Type: Redirect
User: Self
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var1_payment_status]
Operator: Equal To
Value: Completed
Action
URL: index.php
Message: [var2]

This should redirect to your homepage after a completed basket payment and display the thank you message or any messages the payment process would normally display as a Joomla message.

This currently will redirect on any payment. To redirect only for a specific plan you'll need to add the following condition.

Type: Code
Code:
Code:
$plans = []; foreach ( $variables['var1']->getSubscriptions() as $sub ) {     $plans[] = $sub->get( 'plan_id', 0 ); } return $plans;

Operator: Does Contain
Value: YOUR_PLAN_ID_HERE
  • krileon
14 Jul 2025 16:20
Replied by krileon on topic enable notification in CB activity
All notifications within CB Activity are configured in CB Activity > Parameters > Notifications > Notify.

However the notification you're asking for doesn't exist. You'd need to create that notification yourself using CB Auto Actions. The below should help get you started.

Global
Triggers: activity_onAfterCreateStreamActivity
Type: Email
User: Self
Access: All Moderators
Conditions
Field: Custom > Value
Custom Value: [var3_asset]
Operator: Starts With
Value: profile.
Action
To: query
To Query:
Code:
SELECT `email` FROM `#__users` WHERE `block` = 0
Subject: YOUR_EMAIL_SUBJECT_HERE
Body: YOUR_EMAIL_MESSAGE_HERE

The condition ensures it only applies to profile activity posts made by moderators. If you need it to apply to other activity streams adjust the condition. If you need it to apply to all activity streams simply remove the condition. The query is just a database query to determine recipients of the email. You can freely adjust it with whatever database query conditions you'd like. My example above emails everyone.

This however could be useful and have added a feature ticket to review adding support for toggling on such a notification being built into CB Activity as could be good for things like moderator announcements.

forge.joomlapolis.com/issues/9681
forge.joomlapolis.com/issues/9682

Also made a ticket for system post notifications.
  • krileon
02 Jul 2025 16:19
Replied by krileon on topic User registration mail to admin
The below should work for sending a custom email when they complete registration.

Global
Triggers: onAfterSaveUserRegistration
Type: Email
User: Automatic
Access: Everybody
Action
To: Input the email addresses you want to email here
Subject: Whatever substitution supported email subject you like
Body: Whatever substitution supported email body you like

The substitutions will be from the registering users profile. So you can freely include whatever details about their profile that you'd like. If you want it to just send the exact same email that moderators receive then the below should work.

With User Approval:
Subject: UE_REG_ADMIN_PA_SUB
Body: UE_REG_ADMIN_PA_MSG

Without User Approval:
Subject: UE_REG_ADMIN_SUB
Body: UE_REG_ADMIN_MSG
  • krileon
24 Jun 2025 14:38
Ok, the solution is a bit silly, but gets the job done. There's no trigger for directly handling the array of tabs. Instead we need to remove the tabs HTML from the return response which would be the display of the group. The below will do this. It will remove every tab except the About tab if the viewing user is not a member of the group and is not a CB Moderator.

Global
Triggers: gj_onAfterDisplayGroup
Type: Code
User: Self
Access: All Non-Moderators
Action
Method: PHP
Code:
Code:
if ( ! in_array( $variables['var2']->getInt( 'type', 0 ), [ 2, 5 ], true ) ) { // the group isn't an invite or approval group so skip removing tabs return; } if ( $user->getInt( 'id', 0 ) === $variables['var2']->getInt( 'user_id', 0 ) ) { // viewing user is the owner of the group so skip removing tabs return; } if ( \CB\Plugin\GroupJive\CBGroupJive::getGroupStatus( $user, $variables['var2'] ) >= 1 ) { // viewing user is an active member of the group so skip removing tabs return; } // run some regexp to remove the tabs original html before it has been processed by javascript from the output buffer $variables['var1'] = preg_replace( '%<div class="cbTabPane tab-pane cbTabPaneMenu" id="cbtabpanegrouptab(?:activity|wall|photo|video|file|events|users)"><h2 class="cbTabNav cbNavBarItem nav-item" id="cbtabnavgrouptab(?:activity|wall|photo|video|file|events|users)"><a href="#cbtabpanegrouptab(?:activity|wall|photo|video|file|events|users)" class="cbTabNavLink cbNavBarLink nav-link">.+</a></h2><div class="cb_tab_content cb_tab_menu" id="cb_tabid_grouptab(?:activity|wall|photo|video|file|events|users)">.+</div></div>%is', '', $variables['var1'] );
Parameters
Reference Variables: Variable 1

I've tested the above and confirmed it works. This will also only apply to Approval and Invite group types. All other types are left alone. I've added comments for reach step so its a little understood what's going on in the code. Note this can result in groups basically having an empty tab bar if the group didn't supply any About content.
  • krileon
16 May 2025 15:01
Replied by krileon on topic Display of moderation rights
The below should work for filtering that list to specific users.

Global
Triggers: onBeforePendingApprovalUsersFormDisplay
Type: Code
User: Self
Access: Everybody
Action
Method: PHP
Code:
Code:
foreach ( $variables['var1] as $i => $pendingUser ) { $denied = cbCheckIfUserCanPerformUserTask( $pendingUser->getInt( 'id', 0 ), 'allowModeratorsUserEdit' ); if ( $denied === null ) { $denied = checkCBpermissions( [ $pendingUser->getInt( 'id', 0 ) ] ), 'edit', true ); } if ( $denied ) { unset( $variables['var1][$i] ); } }
Parameters
Reference Variables: Variable 1

It should apply the same permissions checking as profile edit to handle who to filter out. Note the above was not tested and is just an example, but should work.
  • krileon
14 Apr 2025 16:14
So you need to send that file as an attachment to the email? Believe that should be doable. Below should send an email after a user registers.

Global
Triggers: onAfterUserRegistration
Type: Email
Conditions
Field: SELECT_FILE_FIELD_HERE
Operator: Not Empty
Action
To: YOUR_EMAIL_ADDRESS_HERE
Subject: Registration Verification
Body: [username] is attempting to register and requires verification.
Attachment: images/comprofiler/plug_cbfilefield/[user_id]/[var1_FILE_FIELD_NAME_HERE]

Replace FILE_FIELD_NAME_HERE with the name of your field. Once you've this confirmed working for you we can move on to trying to delete it after the email is sent.
  • krileon
27 Mar 2025 18:13
Replied by krileon on topic CbSubs urgent issue

So if these fields are filled, then we do not need mandatory or not-mandatory activation right?

Correct, it should still calculate tax based off location as long as cb_subs_inv_address_country is filled. There's no internal checks that I can see that mandate the invoice address to be enabled. It's just entirely checking those profile fields directly. So how those fields get filled can be entirely up to you. You could for example completely turn off the invoice address fields and populate cb_subs_inv_address_country from your own field using CB Core Fields Ajax.

Can you please advise regarding the creation of auto action?

Is onCPayBeforeDrawSubscription a good trigger for this?

I'd probably just do them during registration and profile edit to synchronize them when necessary. For existing users you can just run a 1 time database query to synchronize them and then future profile edits/registrations will always synchronize. The below should work fine for this.

Global
Triggers: onAfterUpdateUser, onAfterUserUpdate, onAfterUserRegistration, onAfterNewUser
Type: Field
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var1_YOUR_FIELD_HERE]
Operator: Not Equal To
Value: [var3_YOUR_FIELD_HERE]
Action
Field: cb_subs_inv_address_country
Operator: Set
Value: [YOUR_FIELD_HERE]

Replace YOUR_FIELD_HERE with the name of your country field (e.g. cb_country). The condition is to ensure it only synchronizes when that field changes as you don't want to do saves when not necessary. The above covers both frontend and backend registrations and user edits.

As for the query to quickly 1 time synchronize everyone the below should work. Be sure to replace PREFIX_ with whatever your database table prefix is.
Code:
UPDATE `PREFIX_comprofiler` SET `cb_subs_inv_address_country` = `YOUR_FIELD_HERE`

Now just turn off invoice address entirely and you're done. You won't have to bother your users for that during payments as it'll just use their profile field for it. If you need to synchronize more than country let me know and can provide adjustments to the above auto action to cover multiple fields, but in short you'd add OR conditions for those other fields to check for value changes then under Action add more field rows for them.
  • krileon
28 Feb 2025 17:42
Replied by krileon on topic email notifications
Ok, this is now available in latest CB Activity build release. It's now possible to act on an existing notification getting new recipients. This behavior is common with grouped notifications like profile.%.login notifications for example. Below is the usage I'd recommend.

Global
Triggers: activity_onAfterNotificationEntityStore, activity_onAfterNotificationEntityUpdate
Type: Email
User: Code
Access: Everybody
User
Code:
if ( ! $variables['var2']->getPublished() ) { return; } if ( $variables['var3'] === false ) { return; } if ( $variables['var3'] === true ) { return $variables['var2']->getRecipients(); } if ( is_array( $variables['var3'] ) ) { return $variables['var3']; }

The rest of your auto action should be able to remain the same. Added some logic for var3 since for Store it's going to be TRUE for a new notification otherwise FALSE if the notification itself was modified. For Update var3 will always be a recipient diff so you'll only send emails for new recipients.
  • krileon
24 Feb 2025 18:37
Replied by krileon on topic Questions on CBSubs -Gateway and AcyMailing
Awesome, glad to hear it! If you do end up needing to use CB Auto Actions for custom subscription status behavior the below will get you started.

Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Equal To
Value: A

Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Not Equal To
Value: A

Simply replace PLAN_ID_HERE with the ID of the plan you want to act on and you're good to go. You can do pretty much whatever you like from here. Run custom queries, run custom PHP, use any of the many included action types, etc.. We've very few hard limits throughout our plugins as we provide A LOT of triggers to act on for inserting custom logic cleanly.
  • krileon
24 Feb 2025 18:26
You can have users conditionally auto join groups using CB Auto Actions. The below should work fine for this.

Global
Triggers: onAfterUserRegistration
Type: CB GroupJive
User: Automatic
Access: Everybody
Conditions
Supply whatever conditions you like here!
Action
Mode: Join Groups
Groups: SUPPLY_GROUPS_HERE
Status: Member

That's all you should need to do. Now when a user registers that matches your conditions they'll be placed in the supplied groups. If you need this to act on a CBSubs plan subscription status change then you can use the following.

Global
Triggers: onCPayUserStateChange
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Equal To
Value: A

Replace PLAN_ID_HERE with the ID of the plan you want this to condition off of and any additional conditions you like.

As a general FYI you can use the below in CB Auto Actions to run ANY custom behavior you like on subscription status changes. These are the same triggers and behavior the CBSubs integrations are using. This provides effectively unlimited potential for subscription driven logic.

Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Equal To
Value: A

Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Not Equal To
Value: A
  • krileon
19 Feb 2025 16:13 - 19 Feb 2025 16:13
That's doable. The below should work in CB Auto Actions. It's basically your standard "do something when a field value changes" auto action except with a CB Activity action to generate an activity entry.

Global
Triggers: onAfterUserUpdate
Type: CB Activity
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: FIELD_HERE
Operator: Not Equal To
Value: Pending
Condition 2
Field: Custom > Value
Custom Value: [var1_FIELD_NAME_HERE]
Operator: Not Equal To
Value: [var3_FIELD_NAME_HERE]
Action
Mode: Activity
Method: Create
Published: 1
Stream: Profile Activity
Asset: profile.[user_id]
Title:
Code:
toggled FIELD_TITLE_HERE to [cb:userfield field="FIELD_NAME_HERE" /]

Load By: None

For FIELD_HERE be sure to select your field. Replace FIELD_NAME_HERE with the name of the field you want to condition for. This ensures the auto action only processes when the field changes and only if that value isn't set to your default Pending value.

All the other parameters can be left at their default empty values. You can freely adjust them however needed though. The title/message displayed is just an example and can be whatever you like. I went with title as it's not changeably by the user like Message is and it'll show directly next to their name as an action performed.

The end result of all of this would be the following.

 
  • krileon
13 Feb 2025 17:54
Replied by krileon on topic User Limitation
Ah, I suppose I misunderstood as your original post had me thinking this was related to subscription limits. Yes, it's possible to block joining groups based off a custom limit and doing whatever behavior you like during that process. The gj_onBeforeJoinGroup trigger is fired before a group join. The below should block users from joining the group if the group already has 500 members and will send an email.

Global
Triggers: gj_onBeforeJoinGroup
Type: Email
User: Automatic
Access: Everybody
Conditions
Field: Custom > Query
Query:
Code:
SELECT COUNT(*) FROM `#__groupjive_users` WHERE `group` = '[var2_id]'
Operator: Equal To
Value: 499
Action
CONFIGURE_MEAIL_AS_NEEDED

Global
Triggers: gj_onBeforeJoinGroup
Type: Code
User: Automatic
Access: Everybody
Conditions
Field: Custom > Query
Query:
Code:
SELECT COUNT(*) FROM `#__groupjive_users` WHERE `group` = '[var2_id]'
Operator: Greater Than Or Equal To
Value: 500
Action
Method: PHP
Code:
Code:
$variables['var1']->setError( 'This group has reached its limit.' );
Parameters
Reference Variables: Variable 1

The above will send an email when the 500th member joins. If anyone over the 500th member attempts to join it will block the join and output an error message as to why.
Displaying 1 - 15 out of 31 results.
Powered by Kunena Forum