+ Reply to Thread
Results 1 to 8 of 8

Thread: How to insert ads in Drupal?

  1. #1
    John is offline Administrator John has disabled reputation
    Join Date
    Sep 2005
    Posts
    504

    Default How to insert ads in Drupal?

    This tutorial focuses on the default skin "garland" for Drupal CMS.

    1. Either log into your ftp or have a Drupal installation file on your computer.
    2. Browse to "themes/garland" and open up node.tpl.php
    3. Locate
    <div class="content">
    4. After add our ad code "728x90". You can pick black or white background depending on your site design.

    5. For footer, look up
    <?php print $content ?>
    6. After add the footer code
    5. Save the file and upload it back to "themes/garland"

    You can see the demo here - Cheap Domain Name For Your Website | Drupal

  2. #2
    z7online is offline Junior Member z7online is on a distinguished road
    Join Date
    Dec 2007
    Posts
    5

    Default

    This is my code (original code, non edited)
    <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
    <?php if ($picture) {
    print $picture;
    }?>
    <?php if ($page == 0) { ?>
    <h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2>
    <?php }; ?>
    <span class="submitted"><?php print $submitted?></span> <span class="taxonomy"><?php print $terms?></span>
    <div class="content"><?php print $content?></div>
    <?php if ($links) { ?>
    <div class="links">&raquo; <?php print $links?></div>
    <?php }; ?>
    </div>
    I tried inserting as you said, but the ads failed to come up. I think i'm doing something wrong, so could u give me back the ready code.

    Thanx
    Div

  3. #3
    John is offline Administrator John has disabled reputation
    Join Date
    Sep 2005
    Posts
    504

    Default

    Well i'll place the locations on the code where you need to place our ad code. This way you will know where to edit in the future. If you are still confused, please reply here.

    <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
    <?php if ($picture) {
    print $picture;
    }?>
    <?php if ($page == 0) { ?>
    <h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2>
    <?php }; ?>
    <span class="submitted"><?php print $submitted?></span> <span class="taxonomy"><?php print $terms?></span>
    <div class="content">728x90 AD CODE GOES HERE<?php print $content?>FOOTER CODE GOES HERE</div>
    <?php if ($links) { ?>
    <div class="links">&raquo; <?php print $links?></div>
    <?php }; ?>
    </div>

  4. #4
    z7online is offline Junior Member z7online is on a distinguished road
    Join Date
    Dec 2007
    Posts
    5

    Default

    I inserted the code exactly the way you have stated, but no ads seem to come up.
    Even in the Demo, there are no ads anywhere...
    So wats the problem?
    I dont think i'm doing anything wrong this time, hopefully....

  5. #5
    John is offline Administrator John has disabled reputation
    Join Date
    Sep 2005
    Posts
    504

    Default

    please give me url of your drupal installation. I just checked the demo url and I am able to see the ad and footer without any problems. What kind of browser are you using? Are you sure you have javascript enabled?

  6. #6
    z7online is offline Junior Member z7online is on a distinguished road
    Join Date
    Dec 2007
    Posts
    5

    Default

    Ya, my javascript is enabled.
    URL: Z7 Online HOME | Z7 Online (still developing it)
    I havent changed the theme yet, coz i have only edited one theme till now.
    I use netscape navigator (9.x)
    I tried on other browsers and on my frenz computer elsewhere. It didnt work there either. my site and the demo site...both showed no ads.

  7. #7
    z7online is offline Junior Member z7online is on a distinguished road
    Join Date
    Dec 2007
    Posts
    5

    Default

    Ads for the demo site work on IE, so now i'll be checking for my site...
    But i think, something should be done so that they also appear in netscape, to increase exposure of the ads.

  8. #8
    z7online is offline Junior Member z7online is on a distinguished road
    Join Date
    Dec 2007
    Posts
    5

    Default I found an easier and safer way....

    1) Go to the Drupal Admin Page
    2) Click “Blocks”
    3) Click “Add block”
    4) For “Block description:” type in “xxxxx(wat da admins here think is best)”
    5) In “Block body: Paste an appropriate code
    6) Click “Input format” and select “Full HTML”
    7) Click “Save Block”
    8) Find “xxxxx” in the list of blocks
    9) Click the drop down box next to it and select “(One of the locations the admin think is appropriate)”
    10) Click “Save Blocks”

    Hope its cool!
    Cheerz

+ Reply to Thread

Similar Threads

  1. I need some Drupal help with Users!?
    By Fiftysixpercent in forum Programming / Scripting / Coding Forum
    Replies: 0
    Last Post: 01-29-2010, 10:33 PM
  2. Anyone know Drupal well?
    By mikenorton23 in forum Programming / Scripting / Coding Forum
    Replies: 0
    Last Post: 01-13-2010, 08:19 AM
  3. How do you use MSSQL in Drupal?
    By Scarred Star in forum Programming / Scripting / Coding Forum
    Replies: 1
    Last Post: 12-30-2009, 07:20 AM
  4. Need help with cakePHP / Drupal 6?
    By quayman0001 in forum Programming / Scripting / Coding Forum
    Replies: 0
    Last Post: 11-08-2009, 06:05 PM
  5. Replies: 1
    Last Post: 07-14-2008, 05:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts