Need to modify code so I can insert a Google Adsense Box and one for Amazon on another page?

Is there a place to do this?

Comments

celticess’s picture

There are modules to do that though I've not personally used them to know if they go on each page or what.

http://drupal.org/project/adsense
http://drupal.org/node/18842
http://drupal.org/project/amazon_items
http://drupal.org/node/14952

green monkey’s picture

it seems you haven't found all the 3rd party modules yet. Might I suggest you click on the downloads link above and have a browse through the modules offered.

you remind me of me when I first got here, i was running so fast I forgot to read and research - whats' available for tools and whats is not.

you need to visit Downloads and Read the Drupal Handbook, it will save you hours in the long run :-)

Drupal Webmasters: Possunt quia posse videntur.

celticess’s picture

modules. I wasn't sure which all he'd need of the amazon ones. I've not used either personally to know how those all function.

jsolochek’s picture

I tried downloading the Adsense download but my unzip program didn't recognize it.After downloading what do I use to open the file that was downloaded?
I don't mean to seem so ignorant

Jeffrey A. Solochek
www.tipsonhowtosavemoney.com
www.tipsonsavingmoney.com
954-972-5853

celticess’s picture

You can get it at tucows.com for free it's adware though. One of the programs in windows that deals with tar.gz's or bz's I think has a problem and maybe one browser too. Right click and chose save link as or save target as. Then open them with the other program. They will in ultimate zip open 2x. One is to pull it out of the compressed mode and the second is out of an archive. In the end you'll be left with a folder.

tar.gz, bz2, and bz are common unix compression formats. It bundles the files together in a tar I think then compresses them into the other format. Hence when you look at it in a file program it will show you another archieve in it. Most windows users for years have used zip. Before that they used lha and I forget what the other was called. Linux can create zip files just by habbit I guess most of us use tar.gz or tar.bz2

mike3k’s picture

For Google AdSense, I simply use a normal PHP block (so it doesn't reformat the HTML or add any extra line breaks) and paste in the AdSense code. On another site, I put the AdSense code in the secondary links for the theme settings.

There's an amazon items module which lets you add related items from Amazon to any node.

I also use the following block to display a random Amazon item from a directory containing images of amazon items with their ASIN as the file name:

<?php $amazon_id = "your_affiliate_id";

mt_srand((double)microtime()*1000000);
$imgs = dir('amazon');
while ($file = $imgs->read()) {
    if (eregi("gif", $file) || eregi("jpg", $file)) {
	$imglist .= "$file ";
    }
}
closedir($imgs->handle);
$imglist = explode(" ", $imglist);
$a = sizeof($imglist)-2;
$random = mt_rand(0, $a);
$image = $imglist[$random];
$asin = explode(".", $image);
$content = "<br><center><a href=\"http://www.amazon.com/exec/obidos/ASIN/$asin[0]/$amazon_id\" target=\"_blank\">";
$content .= "<img src=\"amazon/$image\" border=\"0\" alt=\"\"></a><br></center>";

print $content; ?>

--
Mike Cohen, http://www.mcdevzone.com/