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

Recent

Welcome to TinyPortal. Please login or sign up.

May 20, 2024, 04:33:03 AM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,195
  • Total Topics: 21,220
  • Online today: 114
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 74
  • Total: 74

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.

FUBAR

I apologize, I didn't remove the unneeded code for the extra banners and Firefox wasn't showing the red X for the missing images.  I removed the code and refreshed the page and it's working perfectly.

My mistake.  ;)

Zetan


insanemustang

Works fine for my firefox too.  You may want to be sure you've got the newest firefox.

Reality12

This looks really good.

Is there a code you know to use HTML instead of PHP, for rotating banners?

IchBin

html cannot achieve that. Either PHP or javascript is pretty much the only way.

purplegold

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


Since I read that HTML cannot create such task, How can i input a text that shows up above all the random banners to work with php. also i would like to know how i can  centre the ads rather then showing up on the left.

Thanks alot!!! :laugh:

Zetan

You can put anything between these:   '   '

$banners = array (
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>More Text</div>',
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank">No Image, Text Link</a></div>',
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>More Text</div>',
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank">No Image, Text Link</a></div>',
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>More Text</div>',
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank">No Image, Text Link</a></div>',
);

shuffle($banners);


each banner or text entry needs to be centered

echo $banners[0];

purplegold

Not quite, but thanks I kind of figured out something  :laugh:

Zetan

Quote from: purplegold on May 26, 2007, 01:51:16 PM
Not quite, but thanks I kind of figured out something  :laugh:


All by yourself?... cool  8)

ApplianceJunk

#29
This code works great for us, thanks!

Quote from: ZTN on May 26, 2007, 01:43:12 PM
You can put anything between these:   '   '

$banners = array (
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>More Text</div>',
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank">No Image, Text Link</a></div>',
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>More Text</div>',
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank">No Image, Text Link</a></div>',
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank"><img src="http://url/to/img"></a>More Text</div>',
'<div align="center">Text Text Text<br><a href="http://link/to/site" target="_blank">No Image, Text Link</a></div>',
);

shuffle($banners);


each banner or text entry needs to be centered

echo $banners[0];

How can I get a space at the top and bottom so the blocks do not look so close together?

With html I could use <br> or <p>

You can see how we use the code here.
ApplianceJunk Forums
It's the block on the left with the two CC ads.



Thanks,