You are here

function _ad_channel_get_channel_active_ad_count in Advertisement 6.3

Same name and namespace in other branches
  1. 6.2 channel/ad_channel.module \_ad_channel_get_channel_active_ad_count()
  2. 7 channel/ad_channel.module \_ad_channel_get_channel_active_ad_count()
1 call to _ad_channel_get_channel_active_ad_count()
_ad_channel_validate_nodes in channel/ad_channel.module
Be sure that the enabled channels actually can be enabled.

File

channel/ad_channel.module, line 1330
Ad Channel module.

Code

function _ad_channel_get_channel_active_ad_count($chid) {
  if ($chid) {
    $count = db_result(db_query("SELECT COUNT(nid) AS count FROM {ad_channel_node} acn LEFT JOIN {ads} a ON acn.nid = a.aid WHERE acn.chid = %d AND a.adstatus = 'active'", $chid));
  }
  return $count;
}