Page 1 of 2

Table Advertisements

Posted: Fri Feb 06, 2009 5:47 pm
by cuervo5150
Greetings,

I would like to ask for some assistance in setting up the ads on my tables. I have a folder on my desktop named "poker ads" with 10 different jpg's in it. I would like a new ad to be randomly chosen and be displayed on the table every 5 minutes. Is this possible and if so, can someone please help me with the code. I am a total rookie with html, and can find no example to help get me started.

Thank you,

Chris

Re: Table Advertisements

Posted: Fri Feb 06, 2009 7:09 pm
by Kent Briggs
Try this:

Code: Select all

<a id="adLink" href="" target="_blank"><img id="adImage" border="0" src=""/></a>

<script>
adImages = []
adImages[0] = "banner1.jpg";
adImages[1] = "banner2.jpg";
adImages[2] = "banner3.jpg";

adLinks = []
adLinks[0] = "http://www.domain1.com"; 
adLinks[1] = "http://www.domain2.com";
adLinks[2] = "http://www.domain3.com";

AdNum = 0;

function nextAd()
{
  document.getElementById("adImage").src = adImages[AdNum];
  document.getElementById("adLink").href = adLinks[AdNum]; 
  AdNum++;
  if (AdNum == adImages.length) AdNum = 0;
  window.setTimeout("nextAd()",10000);
}

nextAd();
</script>
Edit the list of AdImages[] and corresponding AdLinks[] arrays with as many items as you want, starting with element [0]. So 10 ads would be numbered 0 to 9. Also notice the "10000" number near the end. That's the delay in milliseconds (10000) between ads. Set that to 300000 if you want 5 minutes. Copy and paste all of the above into one of the HTML fields (e.g., Top ad HTML) in the server console Ad Settings group. Set the appropriate size (e.g., Top ad size = 60, etc.) and then specify the Ad Folder where you've stored all your JPG images (unless they're external).

Re: Table Advertisements

Posted: Fri Feb 06, 2009 8:10 pm
by Kent Briggs
The previous javascript code just displayed all the ads in a sequential loop. If you prefer a random display then use this instead:

Code: Select all

<a id="adLink" href="" target="_blank"><img id="adImage" border="0" src=""/></a>

<script>
adImages = []
adImages[0] = "banner1.jpg";
adImages[1] = "banner2.jpg";
adImages[2] = "banner3.jpg";

adLinks = []
adLinks[0] = "http://www.domain1.com"; 
adLinks[1] = "http://www.domain2.com";
adLinks[2] = "http://www.domain3.com";

function nextAd()
{
  AdNum = Math.floor(Math.random() * adImages.length);
  document.getElementById("adImage").src = adImages[AdNum];
  document.getElementById("adLink").href = adLinks[AdNum]; 
  window.setTimeout("nextAd()",10000);
}

nextAd();
</script>

Re: Table Advertisements

Posted: Fri Feb 06, 2009 8:31 pm
by cuervo5150
Thank you for such a quick reply. Where do I stick the path to the files?

C:\Documents and Settings\Administrator\Desktop\poker_ads\pepsi.gif

Your expertise is much appreciated!

Re: Table Advertisements

Posted: Fri Feb 06, 2009 8:52 pm
by Brad Berard
You put the root folder path in the "Ad Folder" option at the bottom of the system tab.

Image

Re: Table Advertisements

Posted: Fri Feb 06, 2009 9:36 pm
by cuervo5150
Hahaha, I totally did not see that field on the bottom!

Thanx.

Also, the ads only show up on the loading screen, not on the actual table, correct? If I want any advertising on the table I would have to manually include it onto the background graphic?

Re: Table Advertisements

Posted: Fri Feb 06, 2009 10:11 pm
by Kent Briggs
cuervo5150 wrote:Also, the ads only show up on the loading screen, not on the actual table, correct? If I want any advertising on the table I would have to manually include it onto the background graphic?
Yes, that's correct. Or the table logo. But nothing there is clickable, however.

Re: Table Advertisements

Posted: Fri Mar 06, 2009 9:31 pm
by cuervo5150
Yep, it's me again.

I've read, copied/pasted all your html examples, but am still having issues with the ads on the loading screen. If I activate more than 1 ad, the banners start to stack on each other at the top. Also, the ad banners overlap the tables, instead of the tables floating above the banners. Am I doing something wrong?

Thank you

Chris
http://www.5150poker.com

Re: Table Advertisements

Posted: Fri Mar 06, 2009 11:05 pm
by Kent Briggs
cuervo5150 wrote:I've read, copied/pasted all your html examples, but am still having issues with the ads on the loading screen. If I activate more than 1 ad, the banners start to stack on each other at the top. Also, the ad banners overlap the tables, instead of the tables floating above the banners. Am I doing something wrong?
Did you set a size (e.g., "Top ad size" for "Top ad HTML", etc) to allocate enough space for the ad? You can send me the HTML you are using and I'll take a look.

Re: Table Advertisements

Posted: Sat Mar 07, 2009 2:06 am
by cuervo5150
Ok, my L/R banners are 161 and T/B are 90 pixels.

The html is....

<a id="adLink" href="" target="_blank"><img id="adImage" border="0" src=""/></a>

<script type="text/javascript">
adDelay = 10000; // milliseconds to display each ad

adImages = []
adImages[0] = "Top-B.gif";
adImages[1] = "Top-G.gif";
adImages[2] = "Top-Y.gif";

adLinks = []
adLinks[0] = "http://www.5150poker.com";
adLinks[1] = "http://www.5150poker.com";
adLinks[2] = "http://www.5150poker.com";

function nextAd()
{
AdNum = Math.floor(Math.random() * adImages.length);
document.getElementById("adImage").src = adImages[AdNum];
document.getElementById("adLink").href = adLinks[AdNum];
window.setTimeout("nextAd()",adDelay);
}

nextAd();
</script>