You are here

function _ed_classified_purge in Classified Ads 7.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. 6.2 ed_classified_delete.inc \_ed_classified_purge()

Purge old, expired classified ads

2 calls to _ed_classified_purge()
ed_classified_cron in ./ed_classified.module
Implementation of 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. Michael Curry, Exodus Development, Inc. exodusdev@gmail.com for more information, please visit http://exodusdev.com/drupal/modules/classified.module Copyright (c) 2006, 2007 Exodus Development, Inc. All Rights…

File

./ed_classified_delete.inc, line 42
Node deletion facilities. Michael Curry, Exodus Development, Inc. exodusdev@gmail.com for more information, please visit http://exodusdev.com Copyright (c) 2006, 2007 Exodus Development, Inc. All Rights Reserved. Licensed under the terms of the GNU…

Code

function _ed_classified_purge() {

  /*
   * 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
   */
  $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;
}