You are here

function _ed_classified_expire_ads in Classified Ads 6.2

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

expire old ads

1 call to _ed_classified_expire_ads()
ed_classified_cron in ./ed_classified.module
Implements hook_cron().

File

./ed_classified_utils.inc, line 227
Simple text-based classified ads module.

Code

function _ed_classified_expire_ads($time) {

  // mark ads matching criteria.  Set  $node->status=>unpublished,
  $query = _ed_classified_get_aged_ads(0, $time, 1);

  // get published but old ads
  while ($node = db_fetch_object($query)) {
    _ed_classified_unpublish_ad($node->nid);
    _ed_classified_notify_user_of_ad_expiration($node);
  }
}