You are here

function ad_image_active_file in Advertisement 6.3

Same name and namespace in other branches
  1. 5.2 image/ad_image.module \ad_image_active_file()
  2. 5 image/ad_image.module \ad_image_active_file()
  3. 6 image/ad_image.module \ad_image_active_file()
  4. 6.2 image/ad_image.module \ad_image_active_file()
  5. 7 image/ad_image.module \ad_image_active_file()

Determine the currently active ad.

1 call to ad_image_active_file()
ad_image_adapi in image/ad_image.module
Implementation of hook_adapi().

File

image/ad_image.module, line 367
Enhances the ad module to support banner ads.

Code

function ad_image_active_file($files = array()) {
  if (is_array($files)) {
    foreach ($files as $fid => $data) {
      if (is_array($data)) {
        if ($data['list'] && !$data['remove']) {
          return $fid;
        }
      }
      else {
        if ($data->list && !isset($data->remove)) {
          return $fid;
        }
      }
    }
  }
  return 0;
}