Welcome to XENTR - Think Different and Make it...

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

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

plouf

Kayıtlı Kullanıcı
XenTR Üyesi
Katılım
12 May 2019
Mesajlar
34
Tepki puanı
11
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

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


Part 2

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


 

a.veli

Kayıtlı Kullanıcı
XenTR Üyesi
Katılım
20 May 2019
Mesajlar
3
Tepki puanı
0
Awesome. Much better. And thanks for taking the time to do this.
:)
 
shape1
shape2
shape3
shape4
shape5
shape6
Üst