Section targeting is a great feature, but it should also define the ignore flag as a constant to be available to other modules for theming. I also suggest moving these section defines to the beginning of the module file, like this:

define(ADSENSE_START, "<!-- google_ad_section_start -->\n");
define(ADSENSE_IGNORE, "<!-- google_ad_section_start(weight=ignore) -->\n");
define(ADSENSE_END,   "<!-- google_ad_section_end -->\n");

Comments

kbahey’s picture

Can you please submit a patch for this?

dkruglyak’s picture

Do not know how to make a patch...

You can simply include the above pasted code at the end of constant definition section in adsense.module and then remove these defines from adsense_nodeapi function...

kbahey’s picture

Title: Improve AdSense section targeting » Make section targeting constants global for use in other modules
Status: Active » Fixed

Committed to HEAD and 5.

Thanks

dkruglyak’s picture

Status: Fixed » Reviewed & tested by the community

How about 4-7 too?

kbahey’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 4.7 as well.

dkruglyak’s picture

Status: Fixed » Closed (fixed)

Works like a charm