You are here

function _ed_classified_purge_ad in Classified Ads 7.2

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

"purge" an expired ad (This will delete a classified ad that has been 'expired' and is older than the threshold)

1 call to _ed_classified_purge_ad()
_ed_classified_purge_ads in ./ed_classified_delete.inc
purge old ads (must have been expired - IOW, unpublished - first.)

File

./ed_classified_delete.inc, line 76
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_ad($node) {
  if (_ed_classified_variable_get('log_deletions', FALSE)) {
    $expired = _ed_classified_get_ending_date_string($node->expires_on);
    _edi_wd(t('Purging ad @title (nid=!nid) which @expired', array(
      '@title' => $node->title,
      '!nid' => $node->nid,
      '@expired' => $expired,
    )));
  }
  _ed_classified_delete($node->nid);
}