function _ad_channel_get_channels in Advertisement 6.2
Same name and namespace in other branches
- 5.2 channel/ad_channel.module \_ad_channel_get_channels()
- 6.3 channel/ad_channel.module \_ad_channel_get_channels()
- 7 channel/ad_channel.module \_ad_channel_get_channels()
Load one or more channels.
7 calls to _ad_channel_get_channels()
- ad_channel_adapi in channel/
ad_channel.module - Implement hook _adapi.
- ad_channel_admin_channel in channel/
ad_channel.module - Administrative page for creating or editing channels.
- ad_channel_admin_confirm_delete_channel_submit in channel/
ad_channel.module - Delete a channel.
- ad_channel_adreport in channel/
ad_channel.module - Filter reports by selected channel.
- 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 906 - Ad Channel module.
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;
}
}