Looking for Something? Search Afriwap now!!!
Add to Flipboard Magazine. | |

How can I rotate local adverts on my smf forum

Author Topic: How can I rotate local adverts on my smf forum  (Read 4537 times)

0 Members and 1 Guest are viewing this topic.

Offline rioemmanuel

  • Newbie
  • *
  • Posts: 22
    • View Profile
How can I rotate local adverts on my smf forum
« on: November 16, 2016, 02:36:11 PM »


Good afternoon everyone, pls I got some local advert to display on my forum.

Please how do I go about it especially if I want it to display like nairaland.

The advert is from four different brand and they are chances I might get more brand to advertise.

Please how do I go about it. Thank you



« Last Edit: November 17, 2016, 12:20:22 PM by Timi Dapsin »



Offline Timi Dapsin

  • Administrator
  • Hero Member
  • *****
  • Posts: 2,504
  • Today is that tomorrow you worried about yesterday
    • View Profile
Re: How can I make local advert display on my smf forum
« Reply #1 on: November 17, 2016, 12:18:30 PM »
Firstly you can try Google DFP = Read About Google DFP here

Or you can try an external Ads script.

That will rotate the Ads for you

Or better still try the script below. 

First, place this where you want the banners to be seen:

<script type="text/javascript" src="js/ad-rotation.js"></script>
<noscript>JavaScript must be enabled to view this element</noscript>

Next, build a page called ad-rotation.js in a folder called "js", and in it place:

Code: [Select]
gfx0="http://www.yoursite.com/path/to/image.gif";
lnk0="http://www.advertiserswebsite.com/";
alt0="Advertisers Website";

gfx1="http://www.yoursite.com/path/to/image.gif";
lnk1="http://www.advertiserswebsite.com/";
alt1="Advertisers Website";

gfx2="http://www.yoursite.com/path/to/image.gif";
lnk2="http://www.advertiserswebsite.com/";
alt2="Advertisers Website";

gfx3="http://www.yoursite.com/path/to/image.gif";
lnk3="http://www.advertiserswebsite.com/";
alt3="Advertisers Website";

gfx4="http://www.yoursite.com/path/to/image.gif";
lnk4="http://www.advertiserswebsite.com/";
alt4="Advertisers Website";

gfx5="http://www.yoursite.com/path/to/image.gif";
lnk5="http://www.advertiserswebsite.com/";
alt5="Advertisers Website";

len=6; // Number of banners

today=new Date();
today=Math.round(today.getTime()/10);
rnd=today%len;

// Edit the below for specific banner size
document.writeln('<a href="'+eval("lnk"+rnd)+'" title="'+eval("alt"+rnd)+'" rel="external"><img src="'+eval("gfx"+rnd)+'" alt="'+eval("alt"+rnd)+'" width="468" height="60" /><br /></a>');

Offline rioemmanuel

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: How can I rotate local adverts on my smf forum
« Reply #2 on: November 18, 2016, 03:37:08 PM »
Will this make four different ads rotate

Offline Timi Dapsin

  • Administrator
  • Hero Member
  • *****
  • Posts: 2,504
  • Today is that tomorrow you worried about yesterday
    • View Profile
Re: How can I rotate local adverts on my smf forum
« Reply #3 on: November 18, 2016, 03:39:12 PM »
Will this make four different ads rotate
yes if done correctly.

 


Other Topics To Read

Powered by EzPortal