This is a great module, thanks! One thing I would like to see is the ability to inject a block at the end of an article, either right before or right after the links.

Comments

Oceria’s picture

Title: Inject at end of article? » Solution to that is quite simple

You can quite easily put the advertisement at the end of the text yourself.
First edit adsense_injector.module:

      if ($wordcount >= $minwords) {
        $node->content['body']['#value'] = "<!-- adsense_injector: node body wordcount is at least $wordcount, required=$minwords - insertion triggered. -->" 
          . variable_get('adsense_injector_body_ad_prefix', ADSENSE_INJECTOR_BODY_AD_PREFIX_DEFAULT)
          . adsense_display(
                            variable_get('adsense_injector_body_adsense_format', ADSENSE_INJECTOR_BODY_ADSENSE_FORMAT_DEFAULT), 
                            variable_get('adsense_injector_body_adsense_group', ADSENSE_INJECTOR_BODY_ADSENSE_GROUP_DEFAULT),
                            variable_get('adsense_injector_body_adsense_channel', ADSENSE_INJECTOR_BODY_ADSENSE_CHANNEL_DEFAULT))
          . variable_get('adsense_injector_body_ad_suffix', ADSENSE_INJECTOR_BODY_AD_SUFFIX_DEFAULT)
          . variable_get('adsense_injector_body_ad_body_suffix', ADSENSE_INJECTOR_BODY_AD_BODY_SUFFIX_DEFAULT);
          . $oldBody
      } else {

Go to line 95 and move that to line 87. The code becomes:

      if ($wordcount >= $minwords) {
        $node->content['body']['#value'] = "<!-- adsense_injector: node body wordcount is at least $wordcount, required=$minwords - insertion triggered. -->" 
          . $oldBody
          . variable_get('adsense_injector_body_ad_prefix', ADSENSE_INJECTOR_BODY_AD_PREFIX_DEFAULT)
          . adsense_display(
                            variable_get('adsense_injector_body_adsense_format', ADSENSE_INJECTOR_BODY_ADSENSE_FORMAT_DEFAULT), 
                            variable_get('adsense_injector_body_adsense_group', ADSENSE_INJECTOR_BODY_ADSENSE_GROUP_DEFAULT),
                            variable_get('adsense_injector_body_adsense_channel', ADSENSE_INJECTOR_BODY_ADSENSE_CHANNEL_DEFAULT))
          . variable_get('adsense_injector_body_ad_suffix', ADSENSE_INJECTOR_BODY_AD_SUFFIX_DEFAULT)
          . variable_get('adsense_injector_body_ad_body_suffix', ADSENSE_INJECTOR_BODY_AD_BODY_SUFFIX_DEFAULT);
      } else {

In other words: ". $oldBody" moves from the last line (inserting it after the ad) to the first line (inserting it in front of the ad).

Then edit your settings a bit. You might wanna remove the floating declaration. It works for me:
http://test.hetziekenhuis.net/extreme_makeover

mcurry’s picture

Title: Solution to that is quite simple » Inject at end of article?
Assigned: Unassigned » mcurry

Please don't change issue titles.

I will be committing a change to the drupal-5 version soon, that will allow injection at end as well as front. It's already committed to the Drupal-4-7 branch. Stay tuned.

mcurry’s picture

Status: Active » Fixed

I've committed modifications to CVS that provide this capability. Please try the 5.x-2.5 or later release, and please read the documentation for examples.

General: http://drupal.org/node/121883
Configuration: http://drupal.org/node/128759
Template tricks: http://drupal.org/node/128767

Anonymous’s picture

Status: Fixed » Closed (fixed)