You are here

function _ed_classified_get_aged_ads in Classified Ads 7.2

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

Get a query result with any ads that have expired prior to a given date, and having a specific publish status

2 calls to _ed_classified_get_aged_ads()
_ed_classified_expire_ads in ./ed_classified_utils.inc
expire old ads
_ed_classified_purge_ads in ./ed_classified_delete.inc
purge old ads (must have been expired - IOW, unpublished - first.)

File

./ed_classified_utils.inc, line 245
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…

Code

function _ed_classified_get_aged_ads($expire_time_start, $expire_time_end, $status = 1) {
  return db_query("SELECT * FROM {node} n, {edi_classified_nodes} ec WHERE n.type='ed_classified' AND n.vid = ec.vid  AND n.status = %d AND (ec.expires_on >= %d AND ec.expires_on <= %d)", $status, $expire_time_start, $expire_time_end);
}