$node ) { $numassets = 0; // Iterate through all of the fields in the node. foreach( $node as $fieldname => $field ) { // If this is a CCK field. if( strpos( $fieldname, 'field_' ) === 0 ) { // Get the assets. $assets = $field[0]["assets"]; // If the asset exists. if( $assets ) { // Iterate through all of the assets. foreach( $assets as $aindex => $asset ) { $is_image = _dashplayer_cdn2_is_image($asset["asset_fetch_url"]); // If the asset is not an image and is not in the presets array. if( $is_image || ($preset_count == 0) || in_array($asset["preset_name"], $presets) ) { $numassets++; if( $is_image ) { $nodes["nodes"][$index]->{$dash_image}[0]["value"] = $asset["asset_fetch_url"]; } else { $nodes["nodes"][$index]->{$dash_media}[0]["value"] = $asset["asset_fetch_url"]; } } } } } } if( ($preset_count > 0) && ($numassets == 0) ) { unset( $nodes["nodes"][$index] ); $nodes["total_rows"] = $nodes["total_rows"] - 1; } } // AMFPHP complains if the array values are not right. $nodes["nodes"] = array_values( $nodes["nodes"] ); } }