View Full Version : How can I insert and image in Ads?
Gloria Culver
04-10-2011, 03:44 PM
I have been wrestling with this one for a while. Tried searching but get errors. I hope someone can help. I would like to insert ads that consist of a banner sized image which is local to my server with a link to the customers website if available. I don't have customer code. Is this possible? Assistance would be much appreciated!
Frosty
04-10-2011, 03:48 PM
Where would you like it aligned?!
Gloria Culver
04-10-2011, 04:04 PM
Left or Center. Need to get it working then worry about the details.
Stefan118
04-10-2011, 08:48 PM
Just use the folowing HTML:
<center>
<a href="http://www.LinkToTheOtherWebsite.com"><img src="http://www.URLwhereYourBannerIsLocated.jpg" width="300" height="125" alt="Write here info about the advertiser"></a>
</center>
Gloria Culver
04-10-2011, 09:07 PM
Wow! Thank you! This is the most progress I have made in weeks. Both ads are displaying. Can you tell me what template they are in so perhaps I can get them to rotate instead of stack?
Your help is really appreciated!
Stefan118
04-10-2011, 10:06 PM
If you have multiple banners you want to show, and you want to show them random with every page refresh, you can use the next code.
This code is for 4 banners.
In this case your banners will be shown fully and will not be scaled, so you might have to scale them yourself.
Change the array into the amount of banners you have.
<center>
<script language="JavaScript">
images = new Array(4);
images[0] = "<a href = 'http://www.LinkToBannersWebsite.com target=_new><img src='http://www.PlaceWhereTheBannerIsStored.gif' alt='Hover text'></a>";
images[1] = "<a href = 'http://www.LinkToBannersWebsite.com target=_new><img src='http://www.PlaceWhereTheBannerIsStored.gif' alt='Hover text'></a>";
images[2] = "<a href = 'http://www.LinkToBannersWebsite.com target=_new><img src='http://www.PlaceWhereTheBannerIsStored.gif' alt='Hover text'></a>";
images[3] = "<a href = 'http://www.LinkToBannersWebsite.com target=_new><img src='http://www.PlaceWhereTheBannerIsStored.gif' alt='Hover text'></a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
</script>
</center>
Just put it in:
admincp --> Advertising --> Manage Ads --> Add new ad
Gloria Culver
04-10-2011, 11:18 PM
Again, thank you so very, very much!
--------------- Added 1302500002 at 1302500002 ---------------
Got some time this evening and substituted the rotating code for the static code. I must have something wrong because nothing is appearing. This is what I have:
<center>
<script language="JavaScript">
images = new Array(2);
images[0] = "<a href = 'http://www.LinkToBannersWebsite.com target=_new><img src='http://www.jouster.com/forums/images/banner/otis.gif' alt='Hover text'></a>";
images[1] = "<a href = 'http://www.LinkToBannersWebsite.com target=_new><img src='http://www.jouster.com/forums/images/banner/turnerslings.jpg'
alt='Hover text'></a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
</script>
</center>
Is it correct or do I have a boo-boo that I just can't see?
Thank you again!
martar
07-25-2011, 11:45 PM
[...]
Got some time this evening and substituted the rotating code for the static code. I must have something wrong because nothing is appearing. This is what I have:
<center>
<script language="JavaScript">
images = new Array(2);
images[0] = "<a href = 'http://www.LinkToBannersWebsite.com target=_new><img src='http://www.jouster.com/forums/images/banner/otis.gif' alt='Hover text'></a>";
images[1] = "<a href = 'http://www.LinkToBannersWebsite.com target=_new><img src='http://www.jouster.com/forums/images/banner/turnerslings.jpg'
alt='Hover text'></a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
</script>
</center>
Is it correct or do I have a boo-boo that I just can't see?
[...]
There are missing some single quotes.
The error was in this (here corrected line) :
images[0] = "<a href = 'http://www.LinkToBannersWebsiteA.com' target='_blank'><img src='http://www.PlaceWhereTheBannerIsStored_a.gif' alt='Funny hover text'></a>";
Complete and correct code is:
<center>
<script language="JavaScript">
images = new Array(4);
images[0] = "<a href = 'http://www.LinkToBannersWebsiteA.com' target='_blank'><img src='http://www.PlaceWhereTheBannerIsStored_a.gif' alt='Funny hover text A'></a>";
images[1] = "<a href = 'http://www.LinkToBannersWebsiteB.com' target='_blank'><img src='http://www.PlaceWhereTheBannerIsStored_b.gif' alt='Sad hover text B'></a>";
images[2] = "<a href = 'http://www.LinkToBannersWebsiteC.com' target='_blank'><img src='http://www.PlaceWhereTheBannerIsStored_c.gif' alt='Stupid hover text C'></a>";
images[3] = "<a href = 'http://www.LinkToBannersWebsiteD.com' target='_blank'><img src='http://www.PlaceWhereTheBannerIsStored_d.gif' alt='Intelligent hover text D'></a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
</script>
</center>
I also use target='_blank' instead of target='_new' but I don't know if this makes any difference, my programming days were somewhere back in the past...
I hope this helps somebody - at least to save some hours of searching the error. :D
Stefan118
09-20-2011, 09:08 PM
Thanks for correcting :up:
I could have seen that there was something wrong by the colors of the code, but havent noticed it!
mradlin
01-15-2012, 06:37 PM
Installed and working great!!
Thanks guys.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.