Skip to Content Skip to Menu

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

[SOLVED] In what ways do Auto-action vs subs SQL action get fired

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
8 years 4 months ago - 8 years 4 months ago #282218 by timstohr
Hi,

I have two questions:

1) I have an auto action that inserts a new row into a table that is fired on First login

INSERTĀ INTO `munich_js_job_userroles` ( `uid`, `role`, `dated`) VALUES
([user_id], 2,CURDATE())

2) I have a plan that uses an SQL action:

update munich_js_job_userroles
set role = 1
where uid = [user_id]

I need for 1 to fire first, followed by 2 (in case the person subscribes to the plan).

If I set 1) to be fired "Before First login", will the user have a [user_id]?

Second question

I need the SQL action and the plan to be non-specific to the DB prefix (I have a multi-site environment that makes the distinction at the prefix level eg munich_ or saigon_) Can I use a wildcard for prefix?
Last edit: 8 years 4 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 4 months ago #282222 by krileon
Create 2 actions in whatever order you need with the same triggers. To condition 1 action based off plan status you need to enable content prepare under the parameters of your action then use the below usage to condition based off plan status.

[cbsubs:if plan="PLAN_ID_HERE" status="A"]ACTIVE[/cbsubs:if] Equal To ACTIVE

See the below regarding further CBSubs bot usage.

www.joomlapolis.com/news/18550-cbsubs-gpl-41-content-control-everywhere

I need the SQL action and the plan to be non-specific to the DB prefix (I have a multi-site environment that makes the distinction at the prefix level eg munich_ or saigon_) Can I use a wildcard for prefix?

Queries in CB Auto Actions and SQL Actions do not need to be prefix specific. Use #__ (yes the double underscore is necessary) instead of munich_js_.


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.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
8 years 4 months ago #282237 by timstohr
OK I think I got it. Get rid of MySQL udpate on plan and do it via Auto-actions (could really have thought of that myself :) )

Thanks

Tim

PS: The subs bot is not really well explained (It didnt make any sense to me at least and I am relatively well versed in CB... Maybe include the explanation for non-programmers like me in the documentation? a video may also be quite cool)

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 4 months ago #282246 by krileon
The usage of the CBSubs substitutions is directly in the description of the CBSubs system plugin as well as in the news article a linked above. There's no other way to explain it. Substitutions are not open to interpretation; they are used exactly as shown.


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.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
8 years 4 months ago #282247 by timstohr
Read it but where do you put them? The usage of it is fairly easy to understand but where do you put them to make a module appear on the precise time etc... That is the info missing... In the module manager (I use advanced module manager which does seem to do some of the same stuff but not precisely, will it interfere?)? Do you create a custom module, and then use the module ID to [CALL_IT]?. Or somewhere inside the plan (which I would also see as logic).
I thought it would be easier to understand on a use case ie you guys actually setting up an example Module that gets shown only to certain times depending on when the person subscribed.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 4 months ago #282248 by krileon
It's a content plugin. So you put them anywhere that supports content.prepare. This is basic Joomla usage and understanding. We are not going to explain Joomla. If you need further information on content plugins then please see Joomlas documentation.

If you need it in a module for example you make a Custom module which lets you supply whatever HTML you want then you enable content plugins for it.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum