Images Next to Adsense
->
My friend did ask about how to have images next to Adsense. It quite easy to do that for static image, but I’m going to show here how webmasters can have random images next to Adsense.
This can be done easily with these steps;
1. Have some gif files, name them as 1.gif, 2.gif, 3.gif etc. Number of files can be 2 or more.
2. Put them in a folder, say “icons”.
3. Have this PHP file name as index.php
<?php
header("content-type: image/gif\ncache-control: no-store\n");
$dh = opendir(".");
$contains = array();
while ($content = readdir($dh)) {
if (ereg('.gif',$content)) {
array_push($contains,$content);
}
}
srand((double)microtime()*1000000);
$which = rand() % (count($contains)-1);
$fh = fopen("$contains[$which]","r");
$data = fread($fh,250000);
print ($data)
?>
4. Put index.php in “icons” folder.
5. Upload “icons” folder with it’s content to your root directory as your wordpress files.
Okay, that’s for the settings. Now follow this little coding. We are going to wrap the random images and Google ads in a table.
This is a sample code:
</p>
<table>
<tr>
<td><img src="http://yourdomain.com/icons/"></td>
<td>Your Google Code Here</td>
</tr>
</table>
It’s that simple.
If you are using MightyAdsense, just put the above code (with your ads of course) in the configuration set.



September 16th, 2006 at 10:30 am
[…] Original post by mightyhitter.com. To read the full article visit: mightyhitter.com […]
September 17th, 2006 at 5:25 pm
heh.. simple but berkesan.
September 18th, 2006 at 4:13 am
[…] Lets have another try here. I still want to exhibit the simple code from my last post (and want to edit it in the future if necessary - that’s what rich editor incapable of); […]
September 29th, 2006 at 1:56 pm
Easy yet also illegal by Adsense standards…. they have shutdown a few sites in the recent moths for having images next to adsense links…
September 29th, 2006 at 9:11 pm
having the images is not illegal, but trying to give extra attention to the ads using the images is not allowed. for eg; using image of arrow showing to the image ..it’s not allowed.
however, the best policy is to email the google team and ask them about your site.
October 4th, 2006 at 7:08 am
Not working for me
October 4th, 2006 at 6:19 pm
hi Bloggero,
take note that sample code should be:
src=”http://yourdomain.com/icons/”
not
xsrc=”http://yourdomain.com/icons/”
as per described before.
October 18th, 2006 at 4:19 pm
Mightyhitter -
Great, great plugin. I really dig it. I’m trying to put images next to my ads but I’m getting an error: [18-Oct-2006 17:09:57] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/test/index.php:2) in /home/user/public_html/test/index.php on line 3
[18-Oct-2006 17:10:39] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/test/index.php:2) in /home/user/public_html/test/index.php on line 3
I put the index.php and images in a folder/directory called “test”.
October 19th, 2006 at 12:00 pm
mike, be sure you write nothing before <?php tag. there should be no empty lines whatsoever, else the browser will output the lines or character thus triggering the error that you got there.
October 20th, 2006 at 4:25 am
That did it, mh. You are the man. Thanks for your help.
October 28th, 2006 at 9:44 pm
Looks great. Im going to put it on my site http://hghlook.com to see how it goes.
December 5th, 2006 at 2:24 am
Hey Guru,
Great plug-in and tips man. Must come to this blog often to learn from you gurus. Me…hmmmmm a newbie in wordpress blogging.
cheers,
December 10th, 2006 at 5:55 pm
Looks great. I’m going to put it on my site http://weightlosshd.com Please tell me what you think. Thanks
January 18th, 2007 at 6:36 pm
[…] I wrote an article on how to have random images next to Google before. However I read somewhere on the net that Google now has changed it’s policy about that, but I can’t find where the article is coming from. However thanks Joel Comm for sending me an email about this. […]
January 27th, 2007 at 4:50 am
Thanks for the great tips. It blends AdSense more into the blog