function ad_image_load_image in Advertisement 6
Same name and namespace in other branches
- 5.2 image/ad_image.module \ad_image_load_image()
- 5 image/ad_image.module \ad_image_load_image()
- 6.3 image/ad_image.module \ad_image_load_image()
- 6.2 image/ad_image.module \ad_image_load_image()
- 7 image/ad_image.module \ad_image_load_image()
Returns image object from given ad node.
1 call to ad_image_load_image()
- ad_image_adapi in image/
ad_image.module - Implementation of hook_adapi().
File
- image/
ad_image.module, line 401 - Enhances the ad module to support banner ads.
Code
function ad_image_load_image($node) {
if (is_array($node->files)) {
foreach ($node->files as $file) {
if (is_array($file)) {
if ($file['list'] && file_exists($file['filepath'])) {
$image = ad_image_validate_size((object) $file, $node->nid);
if ($image !== FALSE) {
$image->fid = $file['fid'];
return $image;
}
}
}
else {
if ($file->list && file_exists($file->filepath)) {
$image = ad_image_validate_size($file, $node->nid);
if ($image !== FALSE) {
$image->fid = $file->fid;
return $image;
}
}
}
}
}
return FALSE;
}