function _ad_channel_get_container_channels in Advertisement 7
Same name and namespace in other branches
- 5.2 channel/ad_channel.module \_ad_channel_get_container_channels()
- 6.3 channel/ad_channel.module \_ad_channel_get_container_channels()
- 6.2 channel/ad_channel.module \_ad_channel_get_container_channels()
Load one or more channels, caching the results.
2 calls to _ad_channel_get_container_channels()
- ad_channel_admin_overview in channel/
ad_channel.module - Display containers and channels.
- 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.
File
- channel/
ad_channel.module, line 879 - Ad Channel module.
Code
function _ad_channel_get_container_channels($conid = 0) {
static $cache;
if (!isset($cache[$conid])) {
$channels = array();
$result = db_query('SELECT chid, name, description, weight, inventory FROM {ad_channel} WHERE conid = %d ORDER BY weight ASC', $conid);
while ($channel = $result
->fetch()) {
$channels[$channel->chid] = $channel;
}
$cache[$conid] = $channels;
}
return $cache[$conid];
}