New Item

6 posts by 3 authors in: Forums > CMS Builder
Last Post: April 21, 2008   (RSS)

By dunlap - April 17, 2008

Would it be possible to create an image randomizer? The utility would have an uploader for the images or media & then the php element generated could be moved around the page.

Just a thought

Re: [dunlap] New Item

By Dave - April 17, 2008

Hi dunlap,

You could definitely do that with CMS Builder. How many images did you want to have?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] New Item

By dunlap - April 17, 2008

Dave:

I would probably add no more than 10 ads to the rotation.



Jim

Re: [dunlap] New Item

By Dave - April 17, 2008

Ok, and what other data will you need for each image? Maybe just a link?

If that's the case I'm thinking a "single page" section editor with just a upload field, and then create a "page viewer" that shows all the images.

Once you get that far (do that first) you'll want some code like this to randomize the images and show just the first one:

<?php
$uploads = getUploads(...your settings here...);
shuffle($uploads); // randomize
foreach ($uploads as $upload): ?>
?>
<img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>"
height="<?php echo $upload['thumbHeight'] ?>"
alt="" /><br/>
<?php break; ?>
<?php endforeach ?>


Hope that helps. Let me know if you get stuck along the way.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] New Item

By grauchut - April 18, 2008 - edited: April 18, 2008

Dave would this look like the top where the three pictures rotate on this page?

http://www.colonialparkfire.org/



Thanks Glenn
Glenn Rauchut (Owner) Emergency Designz