Skip to Content Skip to Menu

🐰 Happy Easter! Great Savings on Professional and Developer Memberships! Get 20% off now with code EASTER-2026!

Search Results (Searched for: Triggers:)

  • liaskas
08 Dec 2025 19:49 - 08 Dec 2025 20:03
Replied by liaskas on topic Questions about auto action and gallery
The problem is something deeper.

I have set everything in CB Activity > Parameters > Activity

Testing...
  1. User uploaded image. Nothing shows in activity (backend)
  2. Admin approves image.
  3. An activity (backend) a new activity is created with Asset -> "gallery..1" and as an owner it shows the admin. The activity is not published and the flair is in place.
The owner must not be the admin!
The Asset "gallery..1" i do not know where it came from!
The activity must be published.

Auto action settings:

Triggers: gallery_onAfterApproveGalleryItem
Type: CB Activity
User: Automatic
Access: Everybody

Conditions
1
Field:Value
Custom Value: [var1_asset]
Operator: Is REGEX
Value: /^profile\./
2
Field:Value
Custom Value: [var1_asset]
Operator: Is Not REGEX
Value: /\.uploads$/

Action
Mode: Activity
Method: Create
Stream: Profile Activity
Published: empty field
Asset: gallery.[var1_type].[var1_id]
Title: empty field
Message: empty field
Owner: [var1_user_id]
Flair: Adult
Cooments: Same as stream
Likes Asset: empty field
Dynamic Group Asset:  empty field
System:  empty field
Date:  empty field
Load By: By Asset Only
Group Asset: gallery.%

 
  • krileon
05 Dec 2025 16:14
That should be doable since the option selection is stored with the basket, the subscription, and POST data so it's possible to pull that value from either in CB Auto Actions. The main issue will be how you've defaults setup. You'd need to have admin approval enabled by default in CB > Configuration > Registration so that you're turning it off rather than on.

As for what trigger to act on. Probably best to do this the same way CBSubs does. Directly before registration is completed. So the onCPayBeforeUserRegistration trigger should work here. It has limited information in it as follows.
Code:
$_PLUGINS->trigger( 'onCPayBeforeUserRegistration', array( &$chosenPlans, $row ) );

Basically only have the array of plans selected in addition to the user being registered. So this is doable, but it will take PHP experience as you'll be overriding the registration behavior of CBSubs. For example the below will force the registration approved, but needs additional checks like checking the option selection from POST data.

Global
Triggers: onCPayBeforeUserRegistration
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
Code:
global $ueConfig; $ueConfig['reg_admin_approval'] = 0; return true;
Output
Display: return
  • liaskas
28 Nov 2025 17:08
Auto action conditions question was created by liaskas
Hello...

we need an auto action that will redirect guest users to a specific page if the article they try to access is not public.

So far we have...

Global
Triggers: onContentBeforeDisplay
Type: Redirect
User: Automatic
Access: All Non-Registered Users

Conditions
Condition 1: Here we need to set that the redirection is only for articles. Not all content.
Condition 2: Here we need to set that the redirection will happen only to articles that are not public

Action
URL: ARTICLE_URL_HERE

Can you please help me with the conditions?

Thank you in advance.
  • krileon
28 Nov 2025 14:59
Replied by krileon on topic Registration related question.
The only way to conditionally display content like that is with substitutions. You won't be able to do this from CB Content Module because it has no user to act on since they're not logged in.

The best I can suggest is to just replace the confirmation page entirely and redirect them away to language specific pages. That is doable with CB Auto Actions. The below should work.

Global
Triggers: onAfterUserConfirmation
Type: Redirect
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [confirmed]
Operator: Equal To
Value: 1
Condition 2
Field: Custom > Value
Custom Value: [cb_country]
Operator: Equal To
Value: DE
Condition 3
Field: Custom > Value
Custom Value: [cb_gender]
Operator: Equal To
Value: female
Action
URL: YOUR_ARTICLE_URL_HERE

Replace YOUR_ARTICLE_URL_HERE with your language specific article so you can display whatever language specific content you want. I don't know how you're handling age so I didn't add that condition so you'll need to add that yourself.

I suppose another option is to auto login after confirmation. CB Auto Actions includes a system action for this already, but it requires their account to be fully confirmed and approved before it'll auto login. Then you could display whatever you like since they'll be logged in.
  • krileon
26 Nov 2025 21:37
Replied by krileon on topic Registration related question.
Probably the easiest option is to just loop through the user messages and pass them through substitutions so you can just use substitutions in the language override. The below should work.

Global
Triggers: onAfterUserConfirmation
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
Code:
if ( ! $variables['var5'] ) { return; } foreach ( $variables['var5'] as $i => $msg ) { $variables['var5'][$i] = $autoaction->string( $user, $msg ); }
Parameters
Reference Variables: Variable 5

Now all you should need to do is user language overrides and add your substitutions to the confirmation message strings.
  • krileon
26 Sep 2025 14:11
There's a trigger for confirmations. onAfterUserConfirm and onAfterUserConfirmation are both usable. The first one fires for backend and frontend. The second one fires for frontend confirmation link only. So your usage would be something like the below.

Global
Triggers: onAfterUserConfirm
Type: CB Paid Subscriptions
User: Query
Access: All Registered Users
User
Code:
SELECT `user_id` FROM `#__comprofiler_plugin_invites` WHERE `user` = '[user_id]' OR `to` = '[email]' LIMIT 1
Conditions
Field: Custom > Value
Custom Value: [var2]
Operator: Equal To
Value: 1
Field: Custom > Query
Custom Query:
Code:
SELECT COUNT(*) FROM `#__comprofiler_plugin_invites` WHERE `user_id` = '[user_id]' AND `accepted` IS NOT NULL
Operator: Greater Than or Equal To
Value: 3
Action
Mode: Subscribe
Plans: YOUR_PLAN_HERE

This should find the user that invited the user being confirmed and set them into the auto actions user object. Next it checks [var2], which for this trigger is $state (should be noted under Global tab) and is the confirmation state. So it checks that confirmation state is set to 1 for confirmed. Finally we check how many accepted invites the user has (this will be the user that send the invite) by counting them and conditioning against the count. Finally add the subscription to the user who sent the invite.
  • krileon
19 Sep 2025 13:35

I still have the Like and Comment settings enabled under Activity > Article. Should I also move those to Auto Actions?

Do you need those activity? and do you need them to also have that flair?

I’m now realizing just how versatile Auto Actions is, but it has always seemed to have a steep learning curve. I remember you once said that creating detailed documentation isn’t possible, but that you’re ready to help prepare solutions — and I see you doing that in other threads too. Maybe collecting those ready-made solutions with some basic categorization in one place could help people like me better understand the tool and take advantage of its full potential?

The complexity in it is you need to have some understanding of what triggers you need and the variables those triggers provide. I've improved things a good bit as it now has a variable output for selected triggers just below the triggers parameter. Generally each persons usage is different from one another; especially conditions. I provide examples using the same format I did above so you're welcome to search our forums for them.

if article tags have the same names as flairs, could we automatically assign those corresponding flairs to the activity during its creation?

That might be doable. Will add a feature ticket and review when I have further time as I really need to get back to CB Gallery 3.0 or it's never going to get done, lol.

forge.joomlapolis.com/issues/9719

Since ActivityEntity has been extended with these features you can probably use the core activity logging functionality and instead just use CB Auto Action to extend those activity. This requires some PHP, but the below should probably work.

Global
Triggers: activity_onBeforeActivityEntitySave
Type: Code
User: Self
Access: Automatic
Action
Method: PHP
Code:
Code:
if ( ! preg_match( '/^article\.\d+/', $variables['var1']->getAsset() ) ) { return; } $variables['var1']->setFlair( [ COMMA_LIST_OF_FLAIR_IDS ] );

Replace COMMA_LIST_OF_FLAIR_IDS as the name implies with a comma list of flair ids. You can find flair id within CB Activity > Flair as the far right column. This would avoid you having to make your own create, comment, and like activity auto actions and would only need this.
  • krileon
18 Sep 2025 18:26
Ok, managed to get both done today. Below is an auto action for article create.

Global
Triggers: onContentAfterSave
Type: CB Activity
Access: Everybody
User: Automatic
Conditions
Field: Custom > Value
Custom Value: [var1]
Operator: Equal To
Value: com_content.article
Action
Mode: Activity
Method: Create
Published: [var2_state]
Asset: article.[var2_id]
Owner: [var2_created_by]
Comments: Articles
Likes Asset: article.[var2_id]
Date: [var2_created]
Load By: By Asset Only

That should work for when you save an article to save the same way the core activity does. Adjust the other features as needed. Once you've updated both CB Activity and CB Auto Actions you should have a new parameter there called Flair to select what flair you want applied. Short codes in the Message parameter are also functional and documented in its parameter description.

Be sure to turn off the parameter in CB Activity for logging article activity though since that won't be necessary now.
  • AlexRag
10 Sep 2025 19:42
Wonderful!   Words great.   I'm going to consolidate the steps below from earlier threads here for future reference:

AUTO ACTION TO DISPLAY A CUSTOM FIELD ENTRY ON USERS (MEMBERS) PROFILE IN GRID VIEW IN A GROUP

1. Create a text field and note the field name (eg, cb_myfieldname)

2. If you want to allow the user to add/edit themselves, configure it accordingly



3. Create this Auto Action

Global
Triggers: gj_onDisplayUser
Type: Code
User: Specific
User Ids: [var1_user_id]
Access: Everybody
Action
Method: PHP
Code:
Code:
$variables['var2'][]= '[cb_myfieldname]';

 
  • AlexRag
22 Aug 2025 22:52 - 22 Aug 2025 22:52
Just circling back you your advice about adding a field type to the footer of the members grid view in a group using Autio Actions, quoted below

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:
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.

If I wanted to replace the sample you mentioned, "Test" with a profile field,  what would I replace "Test" with in 
Code:
$variables['var2'] = 'Test';
.
For example, in their profile, I have a field type of "position" that I want to have appear of what they put in it

Thanks!
  • 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.
Displaying 16 - 30 out of 34 results.
Powered by Kunena Forum