Date checking plugin
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 1, 2013 (RSS)
By Toledoh - February 28, 2013
Hi Guys,
You know my level of skill in these matters, so it may be easier to get you to build this, but;
I have a multi-record section called "notes" and each record has a "title" and date-field "due-date". I want to create a plugin that;
- Checks all "notes" records once a day (via the background tasks)
- Identifies any record where "due-date" is prior to current date, and puts them in an array
- Creates an email to admin with a list of all those records in the array. (title and link to record)
Can I do that, or is it something you guys would need to build for me?
Tim (toledoh.com.au)
By gregThomas - March 1, 2013
Hi Tim,
This would be a very simple plugin to create. I've written up some example code below:
<?php
/*
Plugin Name: Plugin Title goes here
Description: Plugin Description goes here
Version: 1.00
Requires at least: 2.50
*/
addCronJob('checkNotes_main', 'This will be displayed in the scheduled task activity area when the task runs','0 0 * * *');
function checkNotes_main() {
/*Code to check notes goes here*/
}
The addCronJob function has thee variables; the first is the function to run, the second description to appear in the scheduled tasks area, and the final is when it should run displayed using the standard cron structure.
So in this example, at midnight every day, the function checkNotes_main will run.
This is something we could build for you if you would like. If you send an e-mail to consulting@interactivetools.com, we can give you an estimate of the cost.
Thanks!
Greg
PHP Programmer - interactivetools.com