You are here

function _ad_weight_probability_node_load in Advertisement 5.2

Same name and namespace in other branches
  1. 6.3 weight/probability/ad_weight_probability.module \_ad_weight_probability_node_load()
  2. 6.2 weight/probability/ad_weight_probability.module \_ad_weight_probability_node_load()
  3. 7 weight/probability/ad_weight_probability.module \_ad_weight_probability_node_load()

Helper function, load the probability from the database.

1 call to _ad_weight_probability_node_load()
ad_weight_probability_nodeapi in weight/probability/ad_weight_probability.module
Implementation of hook_nodeapi().

File

weight/probability/ad_weight_probability.module, line 86
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;
}