You are here

function ed_classified_get_adcount_for_time_range in Classified Ads 5

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

Get ad count for time range

1 call to ed_classified_get_adcount_for_time_range()
theme_ed_classified_ads_stats in ./ed_classified_themefuncs.inc

File

./ed_classified_utils.inc, line 189
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_adcount_for_time_range($start_time, $end_time, $only_published) {
  $status = '';
  if ($only_published) {
    $status = 'status=1 AND';
  }
  $qr = db_query("SELECT COUNT(nid) as c FROM {node} WHERE " . $status . " type='ed_classified' AND created >= %d AND created <=%d;", $start_time, $end_time);
  $o = db_fetch_object($qr);
  return $o->c;
}