TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 01:28:01 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 180
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 172
  • Total: 172

Multiple banner ad rotator?

Started by Adamzon, January 22, 2007, 12:44:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

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

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

I am having a hard time figuring out how to add a space between banners as well if anyone can help.

Mick

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?


$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];

Lesmond

if its in a block, cant you just set the block for guest view only? but admin will still see it though

Mick

Quote from: Lesmondâ„¢ on September 12, 2009, 05:00:30 PM
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

Lesmond

ah sorry, thought it was a block, I should read more :idiot2:

Mick

I figured it out.

I added:

global $user_info;

if ($user_info['is_guest'])


So now it looke like this:



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

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.

Mick

Quote from: JPDeni on September 12, 2009, 07:22:47 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