You are here

function ad_weight_probability_nodeapi in Advertisement 5.2

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

Implementation of hook_nodeapi().

File

weight/probability/ad_weight_probability.module, line 43
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_nodeapi($node, $op, $arg = 0) {
  switch ($op) {
    case 'load':
      return _ad_weight_probability_node_load($node);
    case 'insert':
    case 'update':
      if (user_access('configure ad probability')) {
        return _ad_weight_probability_node_save($node, $op);
      }
    case 'delete':
      return _ad_weight_probability_node_delete($node);
  }
}