The supported ad formats do not include the 5 link variants of the link unit ads. These may be implemented by appending '_s' to the 'code' key in the adsense_ad_formats array function.

Is there a reason why these were left out?

If not, I'll work up a patch.

Comments

mcurry’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

Here's a very simple patch that allows selection of 5-link link ad units. Please review and comment.

Part of the difficulty is that the array that holds the ad formats uses, as a key, the dimensions of the ad. This value is used to determine the ad format when constructing the ad code. So, adding any text to the array key is a no-no, unless you also fix any other code that depends on the key always being in the format 'widthxheight' - as I have done in this patch (_adsense_get_dimensions($format)).

So, this patch might break other dependent code (anything that depends on the formats array key always being in the 'widthxheight' format.)

The only way around this, it seems to me, would be to alter the format of the adsense_ad_formats() array - add another element to the map's array that contains the dimensions, and use that where needed, rather than the primary map key as the dimensions.

Comments?

mcurry’s picture

StatusFileSize
new2.67 KB

Oops, sorry. Ignore the last patch (I hit submit too soon). It's for an older adsense module issue.

Here's the correct patch.

nicholasthompson’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.69 KB

Here is the 5.x equivalent patch too... Worked fine for me when doing exactly what the patch was doing for 4.7 to my 5.1 install.

kbahey’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev

This is not against the latest 5.x. Please download 5.x-1.5 and reroll the patch against.

Also this code $height = (int)$height; is hackish. Need a cleaner way for that.

jcnventura’s picture

Status: Reviewed & tested by the community » Fixed

5-link variants are now supported by the 5.x-3.x branch

João

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.