Skip to Content Skip to Menu

[SOLVED] question about lastupdatedate field

  • ThePiston
  • ThePiston
  • OFFLINE
  • Posts: 334
  • Thanks: 26
  • Karma: 1
12 years 2 weeks ago - 12 years 1 week ago #212044 by ThePiston
Does this field not get updated when an admin saves the profile in the backend? It seems that it it only updated when the user saves profile in frontend.

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X
Last edit: 12 years 1 week ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48449
  • Thanks: 8280
  • Karma: 1443
12 years 2 weeks ago #212049 by krileon
Replied by krileon on topic Re: question about lastupdatedate field
It's only updated when the user themselves updates their own profile.


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.

  • ThePiston
  • ThePiston
  • OFFLINE
  • Posts: 334
  • Thanks: 26
  • Karma: 1
12 years 2 weeks ago - 12 years 2 weeks ago #212053 by ThePiston
Replied by ThePiston on topic Re: question about lastupdatedate field
I have a geocode php file that runs when someone saves profile. Since I don't want to geocode all users, just the ones who recently changed profile, how could I add a field to use so that the query knows who just changed profile? I was using this:
Code:
WHERE $searchfield = 'Yes' and DATE_SUB(NOW(), INTERVAL 1 min) < lastupdatedate

but this won't work if an admin updates address in backend

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X
Last edit: 12 years 2 weeks ago by ThePiston.

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

  • ThePiston
  • ThePiston
  • OFFLINE
  • Posts: 334
  • Thanks: 26
  • Karma: 1
12 years 2 weeks ago #212080 by ThePiston
Replied by ThePiston on topic Re: question about lastupdatedate field
I think I've found a way: using auto actions I can set up a new field "cb_changed" that increments every time someone saves profile from frontend or backend. Then on my custom php script that geocodes it'll look for cb_changed>0. Then after geocoding the script will update the table and set cb_changed==0 again.

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48449
  • Thanks: 8280
  • Karma: 1443
12 years 2 weeks ago #212129 by krileon
Replied by krileon on topic Re: question about lastupdatedate field
You should be able to just add a condition to check that the user being saved is the user viewing. This is done with the below.

[user_id] Equal To [cb:userdata field="user_id" user="#me" /]

You'll want to use the onAfterUserUpdate trigger (is frontend only as well).


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.

  • ThePiston
  • ThePiston
  • OFFLINE
  • Posts: 334
  • Thanks: 26
  • Karma: 1
12 years 1 week ago #212361 by ThePiston
Replied by ThePiston on topic Re: question about lastupdatedate field
well I want the php file to run for anyone that saves the profile. The php file needs to be able to filter the person that just saved their profile so it doesn't geocoede everyone. For that I need a field to use. I can't use lastupdatedate since it only changes from frontend.

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X

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

Moderators: beatnantkrileon
Powered by Kunena Forum