You are here

function _ad_channel_get_channels in Advertisement 5.2

Same name and namespace in other branches
  1. 6.3 channel/ad_channel.module \_ad_channel_get_channels()
  2. 6.2 channel/ad_channel.module \_ad_channel_get_channels()
  3. 7 channel/ad_channel.module \_ad_channel_get_channels()

Load one or more channels.

4 calls to _ad_channel_get_channels()
ad_channel_admin_channel in channel/ad_channel.module
Administrative page for creating or editing channels.
ad_channel_admin_confirm_delete_channel in channel/ad_channel.module
Confirm whether or not to delete container, and the contained channels.
ad_channel_admin_confirm_delete_channel_submit in channel/ad_channel.module
Delete a channel.
_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 451
Ad Channel

Code

function _ad_channel_get_channels($chid = 0) {
  if ($chid) {
    return db_fetch_object(db_query('SELECT * FROM {ad_channel} WHERE chid = %d', $chid));
  }
  else {
    $channels = array();
    $result = db_query('SELECT chid, name, description FROM {ad_channel}');
    while ($channel = db_fetch_object($result)) {
      $channels[$channel->chid] = $channel;
    }
    return $channels;
  }
}