Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

December 05, 2022, 08:54:18 AM

Login with username, password and session length
Members
  • Total Members: 3853
  • Latest: tty456
Stats
  • Total Posts: 193627
  • Total Topics: 21108
  • Online today: 83
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 0
Guests: 66
Total: 66

Author Topic: Multiple banner ad rotator?  (Read 21552 times)

0 Members and 1 Guest are viewing this topic.

Offline IchBin

  • Friends
  • *
  • Posts: 16231
Re: Multiple banner ad rotator?
« Reply #30 on: November 28, 2007, 05:11:19 PM »
You can add space by adding a < br /> (without the space after the "<"). Or you can add space to the div with the style attribute. Read up on CSS via google to figure that out using padding.

xtremebass

  • Guest
Re: Multiple banner ad rotator?
« Reply #31 on: December 07, 2007, 05:55:29 PM »
This may sound stupid.. But
doesnt work in the php. I dont know the code for putting a horizontal line after each ad.  By the way, this code works great.

katers

  • Guest
Re: Multiple banner ad rotator?
« Reply #32 on: September 04, 2008, 10:27:12 AM »
I am having a hard time figuring out how to add a space between banners as well if anyone can help.

Offline Mick

  • Sr. Member
  • ****
  • Posts: 334
  • I use SMF 2.0.15
    • idesignSMF.com
Re: Multiple banner ad rotator?
« Reply #33 on: September 12, 2009, 09:36:30 AM »
JP,

Im using your code in my test site:

http://chevyavalancheclub.com/cactestforum/index.php

You will see a 985x260px images.  I dont want my registered members to see this,....only guests.   What would be the code to add before your code?


Code: [Select]
$banners = array (
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>'
);

shuffle($banners);

echo $banners[0];

Offline Lesmond

  • Do what you have to!
  • Administrator
  • *
  • Posts: 3169
    • Tiny Pix... Free Image Hosting and Sharing.
Re: Multiple banner ad rotator?
« Reply #34 on: September 12, 2009, 10:00:30 AM »
if its in a block, cant you just set the block for guest view only? but admin will still see it though
Please don't PM me for support without an invitation.


Offline Mick

  • Sr. Member
  • ****
  • Posts: 334
  • I use SMF 2.0.15
    • idesignSMF.com
Re: Multiple banner ad rotator?
« Reply #35 on: September 12, 2009, 10:06:23 AM »
if its in a block, cant you just set the block for guest view only? but admin will still see it though

Its not in a block.   Its in the index.template.php

Offline Lesmond

  • Do what you have to!
  • Administrator
  • *
  • Posts: 3169
    • Tiny Pix... Free Image Hosting and Sharing.
Re: Multiple banner ad rotator?
« Reply #36 on: September 12, 2009, 10:10:13 AM »
ah sorry, thought it was a block, I should read more :idiot2:
Please don't PM me for support without an invitation.


Offline Mick

  • Sr. Member
  • ****
  • Posts: 334
  • I use SMF 2.0.15
    • idesignSMF.com
Re: Multiple banner ad rotator?
« Reply #37 on: September 12, 2009, 10:15:27 AM »
I figured it out.

I added:

Code: [Select]
global $user_info;

if ($user_info['is_guest'])

So now it looke like this:

Code: [Select]

global $user_info;

if ($user_info['is_guest'])

$banners = array (
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>',
'<a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>'
);

shuffle($banners);

echo $banners[0];

JPDeni

  • Guest
Re: Multiple banner ad rotator?
« Reply #38 on: September 12, 2009, 12:22:47 PM »
bluedevil, that's great. You got it worked out on your own. :up:

twister and extremebass, I'll need to know exactly what code you're using before I can figure out how to change it.

Offline Mick

  • Sr. Member
  • ****
  • Posts: 334
  • I use SMF 2.0.15
    • idesignSMF.com
Re: Multiple banner ad rotator?
« Reply #39 on: September 12, 2009, 02:42:41 PM »
bluedevil, that's great. You got it worked out on your own. :up:

Yeah,i got to looking in the index.template and found it.   Surprisingly it worked with your code without adding other strings.

Im proud of myself...lol