From 489e4cf84bb924b36213b3007526631f7b36c46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beausoleil?= Date: Thu, 15 Jul 2010 11:57:41 -0400 Subject: [PATCH] Don't bother the user with formats they can't use --- adgear-ad-manager/admin.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/adgear-ad-manager/admin.php b/adgear-ad-manager/admin.php index a0cc33f..fa55964 100644 --- a/adgear-ad-manager/admin.php +++ b/adgear-ad-manager/admin.php @@ -37,6 +37,17 @@ function adgear_update_formats_csv($old_value, $new_value) { $formats = adgear_get_service_data( 'list_formats' ); $rows = array(); foreach( $formats["formats"] as $format ) { + /* Only keep formats which are good for Standard ads. That filters out Mobile App ad formats. */ + $accepted = FALSE; + foreach( $format["accepted_families"] as $family ) { + if ( $family["name"] == "Standard" ) { + $accepted = TRUE; + break; + } + } + + if ( ! $accepted ) continue; + $id = $format["id"]; $name = $format["name"]; $width = $format["width"];