Making a PHP component work - image rotator

General project discussion. NOT for help questions.
Post Reply
rodneym30
New Member
New Member
Posts: 2
Joined: Tue Apr 12, 2011 7:47 pm

Making a PHP component work - image rotator

Post by rodneym30 »

I know this is posted all over. I get the setup and use of UDT. Where my question lies is with requiring the addition of php above the template body that are called in the body itself. I have made my script work as an include pointing to an external file but cannot get it working as an internal file. The issue with an include is that it requires a meta-refresh and to me that is not a great solution for what I am doing. Any input would be tremendously appreciated. Here is what I am trying to do - utilize php at the top of the page that will contain the code to rotate images (called inthis portion of the script) at a specified interval. I will then reference the called images in the body so that images rotate in a specified area of the page.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Making a PHP component work - image rotator

Post by RonnyK »

there are tags in the forge already that cycle images, search for rotate/rotator, and you will find some.

Ronny
rodneym30
New Member
New Member
Posts: 2
Joined: Tue Apr 12, 2011 7:47 pm

Re: Making a PHP component work - image rotator

Post by rodneym30 »

When I looked, I did see some tags but I did not see any that rotated images on a time interval (need 5 seconds) randomly. I did see ones that rotated like a banner on every page reload. Ideally I would like to get the script working I have as then would know how to use other scripts in the future to provide clients with a truly customized option for whatever they need to do in their site. It works as an include calling the php script as an external file, however cannot seem to make it work as a UDT or in setting the smarty to true for allowing php call outs. If you can point me in the direction of a tag that does what I need, I would be very interested as at least I could review it so have an idea of what was done so know for future needs and would use something that already works for my current need.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Making a PHP component work - image rotator

Post by Dr.CSS »

This kind of function is most times done with jQuery scripts like the cycle script, I've done it many many times it even has a random parameter...

If you use UDT make sure it doesn't have <?php or whatever that php start thing is...
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Making a PHP component work - image rotator

Post by RonnyK »

Yep, cycle does it....

But http://dev.cmsmadesimple.org/projects/image-rotator f.e. has interval as well....

I used cycle in Gallery to be able to use the Gallery module for image-admin.

Ronny
Post Reply

Return to “General Discussion”