The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Alternating Banner Code?

3 posters

Go down

Alternating Banner Code? Empty Alternating Banner Code?

Post by DaSportsGuy34STC October 13th 2008, 3:28 am

Is their a code we can use to get our banners to alternate?
avatar
DaSportsGuy34STC
Forumember

Male Posts : 29
Reputation : 0
Language : English

http://sportstalkcentral.forumotion.com/portal.htm

Back to top Go down

Alternating Banner Code? Empty Re: Alternating Banner Code?

Post by DaSportsGuy34STC October 15th 2008, 4:27 am

DaSportsGuy34STC wrote:Is their a code we can use to get our banners to alternate?
Anyone?
avatar
DaSportsGuy34STC
Forumember

Male Posts : 29
Reputation : 0
Language : English

http://sportstalkcentral.forumotion.com/portal.htm

Back to top Go down

Alternating Banner Code? Empty Re: Alternating Banner Code?

Post by DaSportsGuy34STC October 17th 2008, 9:57 pm

...
avatar
DaSportsGuy34STC
Forumember

Male Posts : 29
Reputation : 0
Language : English

http://sportstalkcentral.forumotion.com/portal.htm

Back to top Go down

Alternating Banner Code? Empty Rotating Banner Example

Post by automax January 11th 2009, 5:32 am

Easiest way I've found to implement a rotating banner is via php:
Heres a quick tutorial I've read and modified to make it simpler.

1) Create a php file
example (ads.php)

2)Insert this code
Code:
<?php
 $bannerAd[1] = 'your code here';
 $bannerAd[2] = 'your code here';
 $bannerAd[3] = 'your code here';

 $adCount = count($bannerAd);
 $randomAdNumber = mt_rand(1, $adCount);
 echo $bannerAd[$randomAdNumber];
?>

3) Replace 'your code here' with your 'adsense' code or banners.
example
Code:

$bannerAd[1] = '<a href="http://www.automax.tv/" target="_blank"><img src="../../images/logo.gif"  border="0"></a>';
$bannerAd[2] = '<a href="http://www.automax.tv/" target="_blank"><img src="../../images/logo.png"  border="0"></a>';
4) Finished example
http://www.automax.tv/templates/frontend/ads3.php


Thats it, however I've hit a stumbling block, on my software, I've got an adblock that doesnt allow php.
So I've tried to include this via,
Code:

 <div>
<?php require_once "http://automax.tv/templates/frontend/ads3.php" ?>
  </div>
but no luck, any suggestions?

My website is http://automax.tv you can see the banner on any of the video pages.
i.e http://www.automax.tv/Ford_Fiesta_XR4_WQ.html
avatar
automax
New Member

Male Posts : 1
Reputation : 0
Language : english

Back to top Go down

Alternating Banner Code? Empty Re: Alternating Banner Code?

Post by Punk101 January 11th 2009, 12:24 pm

Hey Guy's I posted a Solution to this question a couple weeks back, i solved it by writing a script with JS that will work on Forumotion's forums.
I have a working example of the banner changing script on the right side of my website. Almost every time you refresh the page a new picture will be in it's place.
If you end up using my script, please leave the Copyright and Comments intact.
If you have any problems you can contact me through my website.

Check out the Script Here:
Banner Changing Script.... (It's on the Forumotion Board)
Punk101
Punk101
Forumember

Male Posts : 36
Reputation : 0
Language : English, Icelandic, French, PHP, Java, JS, CSS, Web Design, Logo Design, Flash Websites,
Location : Canada Eh!

http://punk101.hightoxic.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum