Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

CB auto action suggestion and field type question

  • mush22
  • mush22
  • OFFLINE
  • Posts: 32
  • Thanks: 2
  • Karma: 0
11 years 11 months ago #221462 by mush22
Hello,

I have two issues. The first one I think is really simple to solve: I have a field that used to be a textfield, I would like to transform it into a calendar field for user to pick a date. I am not able to edit the field type, I could do it from db but is it safe? What is the type name for calendar?

Second issue is more a suggestion I would like to receive. I am using CB_autoaction to automatically subscribe users to a user group according to their preference and for this I have no problems.

The problem comes if in a later stage the user goes and updates their profile to a new preference. I would like them to be excluded from the previous group and join the new one.

I saw there is the replace user group option but this does not work for me because some users are members of other user groups not in this selection and I don't want auto action to remove them from those.

I am playing around with 6 groups the best thing would be that on every save or update you are removed from all these 6 groups (even if not part of them) and readded just to the one that is chosen. This way all the other groups will not vary.

Is this solution doable? I would need the possibility of doing two user groups action is this possible? How are the action processed? I could tell the system to process the delete action before every other adding action. That I think will include a lot of useless repetitions.

What do you suggest?

Thanks a lot!

Mush

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48707
  • Thanks: 8319
  • Karma: 1447
11 years 10 months ago #221498 by krileon

I have a field that used to be a textfield, I would like to transform it into a calendar field for user to pick a date. I am not able to edit the field type, I could do it from db but is it safe? What is the type name for calendar?

Delete it and re-create it. The data between a text field and a date field basically isn't compatible. Alternative is to dig into _comprofiler_fields and edit the type to a date field then within _comprofiler change its column type to date.

Is this solution doable? I would need the possibility of doing two user groups action is this possible? How are the action processed? I could tell the system to process the delete action before every other adding action. That I think will include a lot of useless repetitions.

You'll need multiple actions to accomplish what you're wanting. They're executed in the order specified within the Actions list. So yes you could have it delete usergroups before adding new ones; simply order it before the others.


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.

  • mush22
  • mush22
  • OFFLINE
  • Posts: 32
  • Thanks: 2
  • Karma: 0
11 years 10 months ago #221507 by mush22
Hello Kyle, thanks a lot for the quick answer. I was able to solve both my problems.

I take advantage of your kindness to point out another issue. I would like to disable user login when that date is reached automatically. How would I do that with auto action? I need to create a variable for todays date and compare it with that date in the field. I imagine this is possible but can be a bit tricky. Could you please enlighten me?

I would also like to send an email notification when this date field is changed in the profile to a specific email address is this possible as well?

Thanks a lot for the support,

Mush

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48707
  • Thanks: 8319
  • Karma: 1447
11 years 10 months ago #221518 by krileon

I would like to disable user login when that date is reached automatically. How would I do that with auto action? I need to create a variable for todays date and compare it with that date in the field. I imagine this is possible but can be a bit tricky. Could you please enlighten me?

Create a date field to compare against. Then create a query action to update _users and set their block status to 1 to block their account. For the conditional you'd use the below for example.

strtotime([cb:date format="Y-m-d" /]) Greater Than strtotime([cb_mydatefield])

The above condition is for today's date being greater than the date field. See the description of Conditionals for further additional substitution and function usage. Also see the below tutorial regarding the date substitution.

www.allmysocials.com/directory/tutorials/item/233-substitution-usage

I would also like to send an email notification when this date field is changed in the profile to a specific email address is this possible as well?

Yes, simply condition [var1_cb_mydatefield] Not Equal To [var3_cb_mydatefield] to check that it changed on the after profile update trigger. You can use this with any action you want (e.g. Email action).


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