Table Advertisements

For discussion of the Poker Mavens server module and other administration topics

Table Advertisements

Postby cuervo5150 » Fri Feb 06, 2009 5:47 pm

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
cuervo5150
 
Posts: 97
Joined: Fri Feb 06, 2009 3:13 pm
Location: California

Re: Table Advertisements

Postby Kent Briggs » Fri Feb 06, 2009 7:09 pm

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).
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3802
Joined: Wed Mar 19, 2008 8:47 pm

Re: Table Advertisements

Postby Kent Briggs » Fri Feb 06, 2009 8:10 pm

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>
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3802
Joined: Wed Mar 19, 2008 8:47 pm

Re: Table Advertisements

Postby cuervo5150 » Fri Feb 06, 2009 8:31 pm

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!
cuervo5150
 
Posts: 97
Joined: Fri Feb 06, 2009 3:13 pm
Location: California

Re: Table Advertisements

Postby Brad Berard » Fri Feb 06, 2009 8:52 pm

You put the root folder path in the "Ad Folder" option at the bottom of the system tab.

Image
Brad Berard
 
Posts: 8
Joined: Thu Mar 20, 2008 6:42 pm

Re: Table Advertisements

Postby cuervo5150 » Fri Feb 06, 2009 9:36 pm

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?
cuervo5150
 
Posts: 97
Joined: Fri Feb 06, 2009 3:13 pm
Location: California

Re: Table Advertisements

Postby Kent Briggs » Fri Feb 06, 2009 10:11 pm

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.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3802
Joined: Wed Mar 19, 2008 8:47 pm

Re: Table Advertisements

Postby cuervo5150 » Fri Mar 06, 2009 9:31 pm

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
cuervo5150
 
Posts: 97
Joined: Fri Feb 06, 2009 3:13 pm
Location: California

Re: Table Advertisements

Postby Kent Briggs » Fri Mar 06, 2009 11:05 pm

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.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3802
Joined: Wed Mar 19, 2008 8:47 pm

Re: Table Advertisements

Postby cuervo5150 » Sat Mar 07, 2009 2:06 am

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>
cuervo5150
 
Posts: 97
Joined: Fri Feb 06, 2009 3:13 pm
Location: California

Next

Return to Site Administration

Who is online

Users browsing this forum: No registered users and 2 guests

cron