List Info

Thread: Re: Random display of the images. ASAP....




Re: Random display of the images. ASAP....
country flaguser name
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&quot; <sam...> wrote:
&gt;
> Are you still returning only 12 photos from Flickr? You need to return
&gt; 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.
&gt;
> 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:
&gt; >
>; > 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>,
&quot;David
> > Wilkinson&quot;
>; > <davidawilkinson> wrote:
&gt; > >
>; > > On 10/10/07, Dodong Fortaliza <afortaliza> wrote:
&gt; > >
>; > > > 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.
> > >
>; >
>; >
> >
>;

__._,_.___
.

__,_._,___
Re: Re: Random display of the images. ASAP....
country flaguser name
United States
2007-10-10 18:26:25



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
>&nbsp; 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
>&nbsp; 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:

for ($n = 0; $n < 12; $n++)
{
 &nbsp;  $photo = $recent[$n];

 &nbsp; // Do stuff with $photo here.

}


Dave W.

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )