Thread: Re: Random display of the images. ASAP....
Re: Random display of the images.
ASAP....
United States
2007-10-10 18:00:00
I have only 22 images in my photoset Flickr site. I make it 4 x 3 to
display the 12 images. What I want is a random of the display of the
images based on the 22 images I have in the Flickr site. Hope you can
help me guys.
--- In yws-flickr%40yahoogroups.com">yws-flickryahoogroups.com, "Sam Judson" <sam...> wrote:
>
> Are you still returning only 12 photos from Flickr? You need to return
> something like 100, or 200, and then use shuffle. After you've done the
> shuffle you should just be able to use the first 12 photos in the array.
>
> If you have any further questions which are related to the Flickr
API then
> feel free to ask.
>
> Sam
>
> On 10/10/2007, Dodong Fortaliza <afortaliza...> wrote:
> >
> > I added this code but there is no effect, why?
> >
> > $recent = $photos['photo']; > > srand((float)microtime() * 1000000);
> > shuffle($recent); > >
> > Hope somebody can assist me.
> >
> > --- In yws-flickr%40yahoogroups.com">yws-flickryahoogroups.com <yws-flickr%40yahoogroups.com>,
"David
> > Wilkinson"
> > <davidawilkinson> wrote:
> > >
> > > On 10/10/07, Dodong Fortaliza <afortaliza> wrote:
> > >
> > > > Even if I javascript code that will refresh the page, it will
not work
> > > > since the PHP script below does not have a code to random the
images.
> > > > Hope you can help me.
> > >
> > > Take a look at the PHP shuffle function
> > >
> > > http://www.php.net/manual/en/function.shuffle.php
> > >
> > > Dave W.
> > >
> >
> >
> >
>
On 10/11/07, Dodong Fortaliza < afortalizayahoo.com">afortalizayahoo.com> wrote: > I have only 22 images in my photoset Flickr site. I make it 4 x 3 to > display the 12 images. What I want is a random of the display of the
> images based on the 22 images I have in the Flickr site. Hope you can > help me guys.
This isn't really the place for this. Your problem isn't anything to do with the Flickr API, it's just a lack of basic programming skills.
You need to do something like this
Change the call to flickr.photosets.getPhotos to get all of the photos:
$photos = $f->photosets_getPhotos($setid);
Do the shuffle, and then change your for loop to go through the first 12: