You are here

function _ad_channel_get_container_channels in Advertisement 6.2

Same name and namespace in other branches
  1. 5.2 channel/ad_channel.module \_ad_channel_get_container_channels()
  2. 6.3 channel/ad_channel.module \_ad_channel_get_container_channels()
  3. 7 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 890
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 = db_fetch_object($result)) {
      $channels[$channel->chid] = $channel;
    }
    $cache[$conid] = $channels;
  }
  return $cache[$conid];
}