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
Displaying 31 - 36 out of 36 results.
Powered by Kunena Forum