Skip to main content
Home
The Baheyeldin Dynasty
The journey for wisdom starts with knowledge
  • Home
  • About
  • Site Map
  • Contact

How To Include Drupal Comments In Section Targeting

  1. Home
  2. Resources for using Google Adsense with Drupal

By Khalid on 2005/12/04 - 17:04, last updated 2005/12/04 - 17:13

In a recent article, I stated that the latest adsense.module has integrated section targeting.Today, I explain how to modify your theme so that section targeting applies to comments as well.I am assuming that you will be using a phptemplate based theme.What you need is  to modify the comment.tpl.php for your theme. This should look something like  this:  <div class="comment"> <?php if ($picture) : ?> <?php print $picture; ?> <?php endif; ?> <h3 class="title"><?php print $title; ?></h3> <?php if ($new != '') : ?> <span class="new"><?php print $new; ?></span> <?php endif; ?> <div class="submitted"><?php print $submitted; ?></div> <div class="content"><?php print $content; ?></div> <div class="links">&raquo; <?php print $links; ?></div></div> What you need to do is wrap the content part in the section tags, like so:  <div class="comment"> <?php if ($picture) : ?> <?php print $picture; ?> <?php endif; ?> <h3 class="title"><?php print $title; ?></h3> <?php if ($new != '') : ?> <span class="new"><?php print $new; ?></span> <?php endif; ?> <div class="submitted"><?php print $submitted; ?></div> <!-- google_ad_section_start --> <div class="content"><?php print $content; ?></div> <!-- google_ad_section_end --> <div class="links">&raquo; <?php print $links; ?></div></div> That is it, this is all you need to do. 

Contents: 
Drupal

Book Navigation

  • ‹ Drupal AdSense Module: Added Section Targeting
  • up
  • Add comment

Current

Pandemic

  • COVID-19
  • Coronavirus

Search

Site map

Contents

  • Family
    • Khalid
    • Ancestry
    • Extended
  • Friends
  • Nokat نكت
  • Writings
    • Cooking
    • Culture
    • Science
    • History
    • Linguistics
    • Media
    • Literature
    • Politics
    • Humor
    • Terrorism
    • Business
    • Philosophy
    • Religion
    • Children
  • Technology
    • Linux
    • Arabization
    • Drupal
      • Association
    • Software
    • Internet
    • Technology in Society
    • Digital Archeology
    • NCR History
    • MidEast Internet
    • Programming
    • Saudi ISPs
    • Miscellaneous
  • Places
    • Canada
      • Weather
    • Egypt
      • Cuisine
      • Alexandria
      • E.G.C.
    • USA
    • Saudi Arabia
  • Interests
    • Astronomy
    • Fishing
    • Photography
    • Snorkeling
    • Nature
    • Photomicroscopy
  • Miscellany

In Depth

  • al-Hakim bi Amr Allah: Fatimid Caliph of Egypt الحاكم بأمر الله
  • Alexandria, Egypt
  • Arabic on the Internet
  • Articles on the history of Muslims and Arabs in the Iberian Peninsula تاريخ المسلمين و العرب في الأند
  • DIY GOTO Telescope Controller With Autoguiding and Periodic Error Correction
  • E.G.C. English Girls College in Alexandria, Egypt
  • Egyptian Cuisine, Food and Recipes مأكولات مصرية
  • George Saliba: Seeking the Origins of Modern Science?
  • Internet Scams and Fraud
  • Mistaken for an Arab or Muslim: Absurdities of being a victim in the War on Terror
  • Mistaken Identity: How some people confuse my site for others
  • One People's Terrorist Is Another People's Freedom Fighter
  • Overview of Google's Technologies
  • Photomicroscopy
  • Pseudoscience: Lots of it around ...
  • Resources for using Google Adsense with Drupal
    • Drupal Module: Google AdSense
    • Drupal: Using flexiblock to show/hide AdSense
    • Links and Resources on Google Adsense
    • Using Drupal 4.7 regions to show/hide AdSense
    • Using Google AdSense with Drupal
    • Drupal AdSense Module: Added Section Targeting
    • How To Include Drupal Comments In Section Targeting
  • Rockwood Conservation Area, Southern Ontario
  • Selected Symbolic Novels And Movies
  • Snorkeling the Red Sea near Jeddah
  • Updates and Thoughts on the Egyptian Revolution of 2011

Recent Content

Most recent articles on the site.

  • Origin Of COVID-19: Natural Spillover, Lab Leak Or Biological Weapon?
  • Kamal Salibi and the "Israel from Yemen" theory
  • How To Upgrade HomeAssistant Core In A Python Venv Using uv
  • Ancestry - Paternal Side
  • Review of Wait Water Saver For Whole House Humidifiers
more

Most Comments

Most commented on articles ...

  • Another scam via Craigslist: offering more than asking price
  • Warning to female tourists thinking of marrying Egyptians
  • Craigslist classified for used car: Cheque fraud scam
  • Winning the lottery scam email: World Cup South African lottery
  • Email Scam: BMW 5 Series car and lottery winning
more

About Khalid

Various little bits of information ...

  • Khalid Baheyeldin: brief biography
  • Presentations and Talks
  • Youtube Videos
  • GitHub Projects
  • Drupal.org Profile
  • Astrophotography @ Flickr

Sponsored Links

Your Link Ad Here

Tags

Android Mobile Ubuntu Sony OnStep OpenWRT Router Ericsson COVID-19 Rogers Coronavirus Arabic Kubuntu Home Assistant GSM Telescope tablet Spectrum Scam Python 419 Laptop Firefox DIY CPU Conspiracy Comet Balkanization backup App
More

© Copyright 1999-2025 The Baheyeldin Dynasty. All rights reserved.
You can use our content under the Terms of Use.
Please read our privacy policy before you post any information on this site.
All posted articles and comments are copyright by their owner, and reflect their own views and opinions, which may not necessarily be consistent with the views and opinions of the owners of The Baheyeldin Dynasty.

Web site developed by 2bits.com Inc.