Kullanım tekniği Down and dirty simple rotating ads

Kullanım tekniği Down and dirty simple rotating ads


12 May 2019
Tepki puanı
Compatible XF Versions 2.x

NB: I have found this may cause jumping on some browsers, will post an update fix tomorrow.

Option 1 (very very simple)

  • Edit the code (see below) to include each ad's LINK_URL and IMAGE_URL
  • (Optional) Edit duration of display var howOften = 7; default =7 seconds
  • Create an ad in ACP > Setup > Advertising
  • Paste both part 1 and part 2 of the code in the ad (it doesn't matter which order)
Option 2 ( very simple)

After editing as above
  • Paste part 1 of the code at the bottom of PAGE_CONTAINER template
  • Paste part 2 of the code in your ad
Note that option two may be better practice, but you will need to add part 1 to the template in every style .

The Ad location

Before using this please test that your ad location is actually showing as expected. To do this, simply create the ad and type in some text, e.g. TEST, or add a simple html to display an image. Now check that i shows on your forum.

Jumping issues with some browsers

NB: Ideally your ad banner images should be the same dimension or the page will jump when they rotate. Even if they are the same height, there can still be jumping issues with some browsers.

For this reason we included the container style style ="min-height:100px". The height here should be as high as the images (or largest image)

This is the down and dirty fix, the only tiny problem is it would cause a vertical gap to show on smaller devices.

Instead of style ="min-height:100px" then give the container a class and set different min-height for that class in EXTRA.CSS for various screen sizes

The Code

NB: keep exactly as is, replace only the where the text is RED, ie LINK_URL, ALT_TEXT and IMAGE_URL. It is important not to change the single quote to double quote, ie do not change ' to ".

URLs with queries ? may not work. Remember this is down and dirty, simple and easy. For more complex features I would recommend you get an addon that will accomodate those.

Part 1

Dear Guests, welcome! Please, Giriş Yap or Kayıt Ol to view hide content!

Part 2

Dear Guests, welcome! Please, Giriş Yap or Kayıt Ol to view hide content!

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
Awesome. Much better. And thanks for taking the time to do this.
Quick Jump