You are here

function _ed_classified_purge_ads in Classified Ads 7.2

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

purge old ads (must have been expired - IOW, unpublished - first.)

1 call to _ed_classified_purge_ads()
_ed_classified_purge in ./ed_classified_delete.inc
Purge old, expired classified ads

File

./ed_classified_delete.inc, line 60
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_ads($time_start, $time_end) {
  $query = _ed_classified_get_aged_ads($time_start, $time_end, 0);

  // get unpublished ads whose time has come
  $count = 0;
  while ($node = db_fetch_object($query)) {
    _ed_classified_purge_ad($node);
    $count++;
  }
  if ($count > 0) {
    _edi_wd(sprintf(t('Purged %d ads expired between %s and %s'), $count, _edi_safe_date_fmt($time_start), _edi_safe_date_fmt($time_end)));
  }
}