I have written a simple ad module for injecting ad code into nodes and pages, such as the script code provided by Adsense or Amazon. In the past i was hacking theme code to put the ad code in directly. i found the advertising modules available were more complex than I needed so i hacked this up (from Service Links actually). it accepts any number of ads as HTML, and places them top of node, bottom of node, embedded in the text of the node, in a block only for some node types, in a block on all pages, or even as a link in the node links.

I don't have time to take on supporting a module sorry (I know, i know...) but the 5.1 source is here, unsupported, for anyone who wants it http://www.twohills.co.nz/public/simple_ad. By all means make it into a project and fame and fortune are yours :-D

See it here http://www.itskeptic.org or http://www.ttjasi.com.

Comments

kbahey’s picture

There is already an adsense injector module available for download from drupal.org.

Here http://drupal.org/project/adsense_injector
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

twohills’s picture

yes I know, I have it and it looks great. the Adsense module has cool features such as click tracking but I didn't need them. the Adsense Injector is a separate module that didn't have as many options as I wanted. (Obviously I'm hard to please).

But they are specific to adsense, and code is hard-wired, so new adsense features require a new version of the Adsense module. I'm also not entirely comfortable about generating code. One mistake and they have you classified as a Black Hat: "Any AdSense code must be pasted directly into web pages without modification. " https://www.google.com/adsense/support/bin/answer.py?answer=48182&source...

Advertising code from other sources such as Amazon is not supported at all.

The Simple Ad injector takes any piece of code provided from any source and inserts it unmodified in a range of places (which i hope to expand). I'm sure the Adsense modules are a better fit for some applications, and Simple Ad for others.

One major advantage of the Adsense module is that it is a supported Druapl project from one of the leading Drupal developers :-D

twohills’s picture

I've posted an updated version that allows ads to be disabled, by ad, for logged in users. Fixed a few bugs too.