function _ad_channel_load_node in Advertisement 5.2
Same name and namespace in other branches
- 6.3 channel/ad_channel.module \_ad_channel_load_node()
- 6.2 channel/ad_channel.module \_ad_channel_load_node()
- 7 channel/ad_channel.module \_ad_channel_load_node()
Load channels associated with specified node.
1 call to _ad_channel_load_node()
- ad_channel_nodeapi in channel/
ad_channel.module - Implementation of hook_nodeapi().
File
- channel/
ad_channel.module, line 266 - Ad Channel
Code
function _ad_channel_load_node($node) {
$result = db_query('SELECT chid FROM {ad_channel_node} WHERE nid = %d', $node->nid);
$output['channel'] = array();
while ($chid = db_fetch_object($result)) {
$output['channel'][$chid->chid] = $chid->chid;
}
// currently 0 or 1, with one being a 'premiere' advertisement.
$output['premiere'] = (int) db_result(db_query('SELECT priority FROM {ad_priority} WHERE aid = %d', $node->nid));
return $output;
}