function _ad_channel_get_channel_active_ad_count in Advertisement 7
Same name and namespace in other branches
- 6.3 channel/ad_channel.module \_ad_channel_get_channel_active_ad_count()
- 6.2 channel/ad_channel.module \_ad_channel_get_channel_active_ad_count()
2 calls to _ad_channel_get_channel_active_ad_count()
- ad_channel_form_alter in channel/
ad_channel.module - Implementation of hook_form_alter(). Generate a form for selecting channels to associate with an advertisement.
- _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 1319 - Ad Channel module.
Code
function _ad_channel_get_channel_active_ad_count($chid) {
if ($chid) {
$count = 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)
->fetchField();
}
return $count;
}