Skip to Content Skip to Menu

[SOLVED] Cb Activity - Clean automaticaly a field every x days ?

  • Julien04
  • Julien04
  • OFFLINE
  • Posts: 234
  • Thanks: 35
  • Karma: 7
4 years 5 months ago #319233 by Julien04
Hello !

Suite integration of your new code without the ";" the error message has disappeared but the content of the wall remains present :blush:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
4 years 5 months ago #319246 by krileon
It's the same code as the built in clean up process except with an additional filter on asset. Tested locally and seams to work so my guess is your asset isn't correct. The $asset variable is currently set to profile.%.field.138. This should be profile.%.field.FIELD_ID where FIELD_ID is the id of the field (found in CB > Field Management) of your activity field. If you changed that activity fields Asset parameter then the asset for activity stored in that field won't be profile.%.field.FIELD_ID. It will be whatever you set the Asset parameter to.


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.
The following user(s) said Thank You: Julien04

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

  • Julien04
  • Julien04
  • OFFLINE
  • Posts: 234
  • Thanks: 35
  • Karma: 7
4 years 5 months ago - 4 years 5 months ago #319266 by Julien04
Thank you from the heart !

The script works perfectly. I have duplicate it for all walls that i need.

I was a bit lost with the $duration system.

I set out to create cron jobs.

Gratitude for your precious help and teaching !

Julien
Last edit: 4 years 5 months ago by Julien04.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
4 years 5 months ago #319273 by krileon

I was a bit lost with the $duration system.

You set $duration to how far back you want to allow entries to remain. It's currently set to -3 DAYS in my example. This means any post older than 3 days will be deleted. If you need 5 days for example you'd set it to -5 DAYS. This is using PHP DateTime object API. See the below documentation on how to use relative formats as there's a lot of flexibility in it.

www.php.net/manual/en/datetime.formats.relative.php


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.
The following user(s) said Thank You: Julien04

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

  • Julien04
  • Julien04
  • OFFLINE
  • Posts: 234
  • Thanks: 35
  • Karma: 7
4 years 4 months ago #319445 by Julien04
Thanks you for your feedback and link !

Julien

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

Moderators: beatnantkrileon
Powered by Kunena Forum