How to monetize the images from your site
I ran across that problem when a friend of mine asked me to help him with something. He has a number of successful blogs and he receives quite a large number of visitors from Google Images so he wanted a specific plugin to help him place ads around an image so everytime a visitor would click the “Show original picture” link, he would’t just see the image, but also some ads. I didn’t manage to complete a solution for that (yet) but I did manage to start off a little something…
Let’s say you have a thumbnail of a picture on your site. Everytime someone clicks on the thumbnail, he is redirected to the full-size image. But why not show that image surrounded by ads?
Here’s what you need to do…
First of all, make sure you have all your images (the full-sized ones) in the same folder. Than, simply link the thumbnail to yoursite.com/image.php?image=image-name.jpg
Now, I’ll show you how to make that image.php file. Here’s the code
<?php
$image_name=$_GET['image'];
$image_path=”imagefolder”;
$ads_top=’ ‘;
$ads_down=’ ‘;
$ads_left=’ ‘;
$ads_right=’ ‘;
echo ”
<html>
<head>
<title>Image “.$image_name.”</title>
</head>
<body style=\”margin-top:20px;\”>
<center>
“.$ads_top.”
<br>
<br>
<table border=\”0\” cellpadding=\”0\” cellspacing=\”0\” width=\”95%\”>
<tr>
<td width=\”180px\”>
“.$ads_left.”
</td>
<td>
<img src=\”".$image_path.”/”.$image_name.”\”>
</td>
<td width=\”180px\”>
“.$ads_right.”
</td>
</tr>
</table>
“.$ads_bottom.”
</center>
</body>
</html>
“;
?>
Now, let’s explain… $image_path must have the path to the folder with images. Im my case, they are in the “imagefolder” folder. And where you see the $ads variables, just paste there the ad code that you want to be displayed.
Note that this is just a starting point. I’m going to develop this into a real plugin, but it will take some time. Meanwhile… maybe someone here needs this small modification.