• : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function ereg() is deprecated in /home/dhuha/public_html/includes/file.inc on line 646.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.
  • : Function split() is deprecated in /home/dhuha/public_html/modules/filter/filter.module on line 1206.

Google Adsense Code in Drupal 6

I have another sites, www.erakomputer.com, and it was build using Drupal 6.2. I thought Drupal 6 must be better than the previous versions so I decided to use it. But that's wrong -- perhaps until right now,  we can't find contributed modules in Drupal 6 as much as in Drupal 5. For example adsense modules. Until today in Drupal site, adsense modules only available for drupal 4 and 5.

So, I decided to use a block and put manually my adsense code there.

Administrator >> Site building >> Blocks >> Add Block

Then activate the block. But it not working. The adsense code show as a text in a block.

After read some other user experience in Drupal forum who had same problem like me, I found an answer. Input format in Drupal 6 is a little bit different with Drupal 5. Default input format in Drupal 5 and 6 is Full HTML, but the difference is in Drupal 5 Full HTML mean PHP code also included, so if we use Drupal 5 and put adsense code using Full HTML format then it should be working. If we do that in Drupal 6 then it wont working. That's the difference.

To make adsense work on Drupal 6.2 :

1. First I have enabled PHP Filter module.

Administrator >> Site building >> Module >> PHP Filter

2. Create a block and paste my Google Adsense code in block body.

3. Select PHP code as Input Format not Full HTML.

4. Save and activate the block.

And now it work. You can see it here.

Note : We can use this method until adsense module for Drupal 6 are available.



Reply

The content of this field is kept private and will not be shown publicly.
If you have a Gravatar account, used to display your avatar.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
4 + 9 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.