function _ad_weight_probability_node_load in Advertisement 6.2
Same name and namespace in other branches
- 5.2 weight/probability/ad_weight_probability.module \_ad_weight_probability_node_load()
- 6.3 weight/probability/ad_weight_probability.module \_ad_weight_probability_node_load()
- 7 weight/probability/ad_weight_probability.module \_ad_weight_probability_node_load()
Helper function, load the probability from the database.
2 calls to _ad_weight_probability_node_load()
- ad_weight_probability_form_alter in weight/
probability/ ad_weight_probability.module - Implementation of hook_form_alter(). Generate a form for assigning a weight to an advertisement.
- ad_weight_probability_nodeapi in weight/
probability/ ad_weight_probability.module - Implementation of hook_nodeapi().
File
- weight/
probability/ ad_weight_probability.module, line 106 - A plug in for the ad.module, allowing an admin to set the probability that a given advertisement will be displayed.
Code
function _ad_weight_probability_node_load($node) {
$probability = (int) db_result(db_query('SELECT probability FROM {ad_weight_probability} WHERE aid = %d', $node->nid));
$output['probability'] = $probability ? $probability : AD_PROBABILITY_DEFAULT;
return $output;
}