Page 1 of 1
Making a PHP component work - image rotator
Posted: Tue Apr 12, 2011 7:56 pm
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.
Re: Making a PHP component work - image rotator
Posted: Tue Apr 12, 2011 7:58 pm
by RonnyK
there are tags in the forge already that cycle images, search for rotate/rotator, and you will find some.
Ronny
Re: Making a PHP component work - image rotator
Posted: Tue Apr 12, 2011 8:44 pm
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.
Re: Making a PHP component work - image rotator
Posted: Tue Apr 12, 2011 9:48 pm
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...
Re: Making a PHP component work - image rotator
Posted: Wed Apr 13, 2011 7:36 am
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