jobberBase custom development and support


Code School

Cron to Deactivate Older Jobs

if you are using the cron maintenance job default on jobberBase, you will find out that the active jobs are actually not deleting from the system. and the reason for that is the cron job is only deleting temporary jobs (is_temp=1) and not the active jobs.

// delete temporary posts older than 2 days

To automatically delete older jobs using cron, just create another function in the class.Maintenance.php file with this:

// delete active posts older than 40 days
public function DeleteActiveJobs()
    global $db;
    $sql = 'DELETE FROM jobs WHERE DATEDIFF(NOW(), created_on) > 40 AND is_temp = 0 AND is_active = 1';

and add this function on the cron_maintenance.php file

// delete active posts older than 40 days

Check out my related post to automatically expire jobs with notification here.

Tagged as: , , , ,

Leave a Response