Mercurial > defr > drupal > ad
diff image/ad_image.module @ 7:6aeff3329e01 ad
maj module ad 2.1rc1
author | piotre |
---|---|
date | Mon, 20 Jul 2009 13:54:40 +0000 |
parents | e5584a19768b |
children |
line wrap: on
line diff
--- a/image/ad_image.module Thu May 28 14:53:07 2009 +0000 +++ b/image/ad_image.module Mon Jul 20 13:54:40 2009 +0000 @@ -1,5 +1,5 @@ <?php -// $Id: ad_image.module,v 1.2.2.13.2.40.2.11.2.6 2009/04/02 15:48:29 jeremy Exp $ +// $Id: ad_image.module,v 1.2.2.13.2.40.2.11.2.7 2009/05/15 13:27:23 jeremy Exp $ /** * @file @@ -281,7 +281,10 @@ db_query("UPDATE {ad_image} SET fid = %d, url = '%s', tooltip = '%s', remote_image = '%s', width = %d, height = %d WHERE aid = %d", $fid, $node->url, $node->tooltip, $node->remote_image, isset($node->width) ? $node->width : 0, isset($node->height) ? $node->height : 0, $node->nid); } // No valid image has been uploaded, don't allow ad to be 'active'. - if ($image === FALSE || !ad_image_active_file(($node->files))) { + if (($node->remote_image && $image === FALSE) || + (!$node->remote_image && + ($image === FALSE || !ad_image_active_file(($node->files))) + )) { db_query("UPDATE {ads} SET adstatus = '%s' WHERE aid = %d AND adstatus = '%s'", t('pending'), $node->nid, t('active')); if (db_affected_rows()) { drupal_set_message(t('Image validation failed, unable to mark ad as %active. Setting ad as %pending.', array('%active' => t('active'), '%pending' => t('pending'))), 'error');