Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

CB Auto Actions

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
10 years 11 months ago - 10 years 11 months ago #236748 by krileon
Replied by krileon on topic CB Auto Actions
If not even null is output then your action probably isn't firing. It also depends on the trigger used. Trying to output in the middle of a operation is going to do nothing (for example if you try to output during login, it will never be seen). Try an on after profile display trigger or some other display based trigger that can actually show something.

1. How am I supposed to access a variable from a triggers function? I want to access it, manipulate it and return it.

You can't modify a trigger variable by reference. You can substitute in a trigger variable using [var1-10] as explained in the description and above.

2. How am I supposed to use substitutions within PHP code?

I've already explained this. Please read my above replies carefully. You use them as strings.

You can see this usage working perfectly fine below.

Action:

Result:


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.
Attachments:
Last edit: 10 years 11 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • KatoKalin
  • KatoKalin
  • OFFLINE
  • Posts: 265
  • Thanks: 11
  • Karma: -5
  • Add-ons
10 years 11 months ago #236816 by KatoKalin
Replied by KatoKalin on topic CB Auto Actions

krileon wrote: If not even null is output then your action probably isn't firing. It also depends on the trigger used. Trying to output in the middle of a operation is going to do nothing (for example if you try to output during login, it will never be seen). Try an on after profile display trigger or some other display based trigger that can actually show something.

1. How am I supposed to access a variable from a triggers function? I want to access it, manipulate it and return it.

You can't modify a trigger variable by reference. You can substitute in a trigger variable using [var1-10] as explained in the description and above.

2. How am I supposed to use substitutions within PHP code?

I've already explained this. Please read my above replies carefully. You use them as strings.

You can see this usage working perfectly fine below.

Action:

Result:


Actually I am using the onBeforeDisplayUsersList trigger. And I have set it up exactly like in your picture.
However the output I get is: Code Action: [username]

So it is still not working. As code I have:
Code:
return 'Code Action: [username]';

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
10 years 11 months ago #236838 by krileon
Replied by krileon on topic CB Auto Actions
I don't know what to tell you then. It works fine in all my tests. Maybe you've something conflicting. Enable debug mode and maximum error reporting in Joomla global configuration and see if any fatal errors are occurring during your test. Try double quotes instead of single quotes and see if that makes any difference (shouldn't).


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 or Create an account to join the conversation.

  • KatoKalin
  • KatoKalin
  • OFFLINE
  • Posts: 265
  • Thanks: 11
  • Karma: -5
  • Add-ons
10 years 11 months ago - 10 years 11 months ago #236886 by KatoKalin
Replied by KatoKalin on topic CB Auto Actions
And here is my output on a fresh Joomla 2.14. installation witb CB 1.9. Something is not right.







You can see that the user is logged in and still it does not display his name by using substitution.
Attachments:
Last edit: 10 years 11 months ago by KatoKalin.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
10 years 11 months ago #236913 by krileon
Replied by krileon on topic CB Auto Actions
This entire time I though you were using the same trigger as me, which displays on profile and not userlist. Sorry for the confusion!

That's working entirely as expected for that trigger. That trigger does not have a user object. Set "User" to "User" and it'll work as it'll force the user object to the viewing user.


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 or Create an account to join the conversation.

  • KatoKalin
  • KatoKalin
  • OFFLINE
  • Posts: 265
  • Thanks: 11
  • Karma: -5
  • Add-ons
10 years 11 months ago #236937 by KatoKalin
Replied by KatoKalin on topic CB Auto Actions
But when I am using [var4] as substitution it is not working either. When I put [var4] instead of [username] isn´t it supposed to output the variable?

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum