You are here

function _ed_classified_purge in Classified Ads 6.2

Same name and namespace in other branches
  1. 5.2 ed_classified_delete.inc \_ed_classified_purge()
  2. 5 ed_classified_delete.inc \_ed_classified_purge()
  3. 7.2 ed_classified_delete.inc \_ed_classified_purge()

Purge old, expired classified ads

Purge ads that have expired anytime between the start of time, and nn days ago TODO: make this a manual process available under the admin/ed_classified menu, with confirmation

2 calls to _ed_classified_purge()
ed_classified_cron in ./ed_classified.module
Implements hook_cron().
_ed_classified_user_purge in ./ed_classified_delete.inc
User entry point to purge old, expired classified ads
1 string reference to '_ed_classified_purge'
ed_classified.module in ./ed_classified.module
Simple text-based classified ads module.

File

./ed_classified_delete.inc, line 46
Node deletion facilities.

Code

function _ed_classified_purge() {
  $purge_starttime = 0;

  // is there a better way to do this?
  $purge_endtime = REQUEST_TIME - _ed_classified_days_to_seconds(_ed_classified_variable_get('ad_expired_purge_age', EDI_CLASSIFIED_VAR_DEF_PURGE_AGE));
  _ed_classified_purge_ads($purge_starttime, $purge_endtime);

  // report # of ads purged?
  // echo 'Purged ads that expired before '.format_date($purge_endtime);
  return $purge_endtime;
}