You are here

function ad_image_format_load in Advertisement 7

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

Loads image format object from DB.

1 call to ad_image_format_load()
ad_image_validate_size in image/ad_image.module
Validate that the size of the uploaded image is within the defined limits.

File

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

Code

function ad_image_format_load($gid) {
  static $format;
  if (isset($format[$gid])) {
    return $format[$gid];
  }
  $format[$gid] = db_query('SELECT min_width, max_width, min_height, max_height, max_size FROM {ad_image_format} WHERE gid = :gid', array(
    ':gid' => $gid,
  ))
    ->fetchObject();
  return $format[$gid];
}