Timed Image/banner Rotation?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sansoo
Forum Commoner
Posts: 32
Joined: Mon Aug 14, 2006 5:33 pm
Location: Smallville

Timed Image/banner Rotation?

Post by sansoo »

Yeah, its what it sounds, trying to find a way to rotate images based on a timer or some sort. Not even sure if this is really possible though.
I want rotating ads of products on my homepage. Gotten it to work a few different ways but not purely PHP.

Greg Lawlers phpslideshow does this with a meta refresh but it would be anoying to keep refreshing a home page to those on dial up.

HIOR or something like that has a PHP/javascript solution that seems to work ok.

And ive even seen a CSS/Perl way of refreshing divs but this is on page refresh or reload. This is actually quite interesting considering all the Perl script does is change the style "display: none" and the positioning on a list of divs. Its not set on a timer though.

Without using Flash or Java is something like this possible in PHP?

So far all ive come up with is possibly moving an array Iterator thru an array of <img> tags every n seconds. I even thought of using a Class to do OOP and point to the variables i needed at given intervals. But pretty much everything ive come up with is complete CRAP.

Its all dependent on the Browser / Clock actually keeping track of realtime instead of updating on a refresh. And this i dont understand just yet.

Just looking for comments or suggestions please.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Hasn't this been asked before? And is this PHP Code or Client Side? From the sounds of this post, it seems like an AJAX type project to prevent page reloads and meta refreshes, if I am undersanding you correctly. Am I?

It sounds like you want content rotations without loading/reloading a page.
sansoo
Forum Commoner
Posts: 32
Joined: Mon Aug 14, 2006 5:33 pm
Location: Smallville

Post by sansoo »

I figured it had been asked before but the seach i did for "timed image rotation" turned up a butt load of results. Many not even dealing with any of my keywords. And most dealing with random rotation on page reloads.

Yes it is a content rotation that is to be done without loading/reloading pages.

I know using Java is probably the easiest way to do it client side. Allowing me to preload all the content. (which isnt much so no real delays there). I just try and stay away from Java as much as possible.

I was just wondering if there was a PHP alternative for this so i didnt have to worry about running into any problems with end users not allowing java scripts.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

No, there is no chance with PHP because PHP works on the server. Hence, anything that PHP will do will require a request from the client and a response from the server.
sansoo
Forum Commoner
Posts: 32
Joined: Mon Aug 14, 2006 5:33 pm
Location: Smallville

Post by sansoo »

Thats whay i thought.

I guess i just misunderstood how AJAX is able to request information from a server without doing a page reload.

Is it merely that all the page information is sent to the client browser and then the client side Java deals with it the way its told?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

No AJAX actually executes server-side code and displays their results in the client without actually reloading the page. That is why we all love it so much. :D
sansoo
Forum Commoner
Posts: 32
Joined: Mon Aug 14, 2006 5:33 pm
Location: Smallville

Post by sansoo »

Yeah i can see why you love it now. Im downloading some tool bundle they have up so i can try and dink with it tomorrow. If you cant tell im extremely new to all of this web stuff. Should of stayed a print designer specializing in typography like i was. Oh well this stuff is extremely fun.

Not so fun when you find out PHP isnt what you thought. Still awesome for a lot of stuff though. Trying to get mysite to have the feel that there is something going on so it doesnt get dull. Personaly i have the attention span of a meercat on crack. And i like things to feel fresh all the time.

Any favorite MUST SEE site you have for AJAX?

Ill be googleing my brains out tomorrow for sure.

thanks for the help sorry for the noob questions
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Timed Image/banner Rotation?

Post by onion2k »

sansoo wrote:Greg Lawlers phpslideshow does this with a meta refresh but it would be anoying to keep refreshing a home page to those on dial up.
Sending multiple banner adverts will annoy dial-up users. And it'd annoy me too, and I'm on broadband. And I reckon it'd annoy everyone else too.

Clue: The reason Google's banner adverts are incredibly successful has a lot to do with them being very simple and unobtrusive. Sometimes a simple text link will be more effective than 10 fancy images.
sansoo
Forum Commoner
Posts: 32
Joined: Mon Aug 14, 2006 5:33 pm
Location: Smallville

Post by sansoo »

The reason i wanted to do this was to show images with a small text box of current items on my site that there are special deals on.

I in now way want it to be obtrusive or a an annoyance to any of my guests. Thats why it was necessary to do this without refreshes or exessive page load times.

For now i will be sticking to the rotation being done by page loads/reloads. That is until i get the time to dive further into and AJAX setup.
Post Reply