Script to Display Ads Next to Images Opened in New Window
Does anyone know if there's a script available to display ads next images opened in a new window.
The application I'm thinking of is a website with lots of image content were the images are set to open in a new window, as below.
<a target="_blank" href="http://www.website.com/images/picture.jpg" ><img src="http://www.website.com/images/thumb.jpg"></a>
Is there a script available that would allow addtional content (e.g. ads, special messages, etc) to be displayed next to the images opened in the new window?
Instead of linking to the image, create a web page containing the image and link to it. Then you can put whatever you like next to the image.
jedaisoul - thanks for the reply. That would be fine for a new site but I'm looking for an efficient solution for a site that already has thousands of images!
All the images are sitting in a subfolder /images/ and there's a huge amount of pageviews everyday that open in a new window. Just trying to see if there's a simple way to present some additional content alongside each image opened.
Then use PHP. Pass the image name as a URL variable. Then you only have to write ONE "wrapper" page to display any image and the added content. I.e.
Originally Posted by bougatsa
The calling page(s) (which can still be HTML) contain:
<a href="imagepage.php?image=picture.jpg" target="_blank"><img src="images/thumb.jpg"></a>
The image page, (which will be PHP) contains something like:
<img src="http://www.website.com/images/<?php echo $_GET['image']; ?>
Note: It could be possible to use global replace to substitute the call to the PHP page for the direct calls of the images. E.g.
Is that a viable solution?
P.S. Not sure why you are using absolute addressing for the images, but that is a separate issue.
jedaisoul - excellent! That's a great idea and very efficient.
The calling pages are blog posts (Wordpress) and the images are, as I said, in /images/ folder.
I'm sure there's a plugin available that allows you to make global changes to links within Wordpress. Otherwise, I'm sure there must be a quick way to make the necessary changes in MySQL database.
Nice one jedaisoul, very much appreciated
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)