Re: Sitepoint tutorial with Flickr component

2009-06-29 Thread Vijay Kumbhar
Hello Hols,

hey thats good :) .

Yes sure you can add that array in the main $thumbs array by using simple
php function array_push();
if it not works please explain it properly.

please check that one.

On Mon, Jun 29, 2009 at 7:29 PM, Hols Kay  wrote:

>
> Hi Vijay - thanks for your help!
>
> The photo array is blank while all the other key pairs are populated,
> and photo is the only keypair that uses an array:
> ---
> $thumbs =   array(
>"photoset" => array(
>"id" => "72157620559969985",
>"primary" => "65816580",
>"owner" => "23548...@n00",
>"ownername" => "algo",
>"photo" => array(),
>"page" => 1,
>"per_page" => 500,
>"perpage" => 500,
>"pages" => 1,
>"total" => "1"
> ),
>
> 
>
> Photo is the only key pair that has an array - so I guess that's
> significant. If I change $this->set('thumbs',$this->flickr-
> >photosets_getPhotos($currset)); in GalleryController to $this->set
> ('thumbs',$this->flickr->photosets_getPhotos(array($currset))); then
> that switches $thumbs to false, so it looks like my syntax is off,
> also!
>
> Is there a special way to push the array through?
>
> Thanks again!
> Hols
>
> On Jun 29, 2:22 pm, Vijay Kumbhar  wrote:
> > Hey Hols,
> >
> > Can you please checked  printing that $photo array??
> > Please check that one. If that array is blank / or please check the
> > structure of that array then it gives the error.
> >
> >
> >
> > On Mon, Jun 29, 2009 at 6:22 PM, Hols Kay  wrote:
> >
> > > Hi guys,
> >
> > > Quite new to this - I'm doing this tutorial:
> > >http://www.sitepoint.com/article/photo-gallery-cakephp-flickr/and I'm
> > > having issues on index.ctp. This is the troublesome code:
> > > -
> > > 
> > > -
> >
> > > and this is the output I'm getting from it:
> > > 
> > > Notice (8): Undefined index: photo [APP\views\gallery\index.ctp, line
> > > 12]http://farm.static.flickr.com//_.jpg"; title="" alt="" />
> > > 
> >
> > > buildPhotoURL() looks like this:
> > > 
> > >function buildPhotoURL ($photo, $size = "Medium") {
> > >//receives an array (can use the individual photo data
> > > returned
> > >//from an API call) and returns a URL (doesn't mean that
> the
> > >//file size exists)
> > >$sizes = array(
> > >"square" => "_s",
> > >"thumbnail" => "_t",
> > >"small" => "_m",
> > >"medium" => "",
> > >"large" => "_b",
> > >"original" => "_o"
> > >);
> >
> > >$size = strtolower($size);
> > >if (!array_key_exists($size, $sizes)) {
> > >$size = "medium";
> > >}
> >
> > >if ($size == "original") {
> > >$url = "http://farm"; . $photo['farm'] . ".
> > > static.flickr.com/" .
> > > $photo['server'] . "/" . $photo['id'] . "_" . $photo
> > > ['originalsecret'] . "_o" . "." . $photo['originalformat'];
> > >} else {
> > >$url = "http://farm"; . $photo['farm'] . ".
> > > static.flickr.com/" .
> > > $photo['server'] . "/" . $photo['id'] . "_" . $photo['secret'] . $sizes
> > > [$size] . ".jpg";
> > >}
> > >return $url;
> > >}
> > > 
> >
> > > I know the tutorial is quite out-of-date now, so something might have
> > > changed in either API that I don't know about it, or I could just be
> > > doing something wrong. Does anybody have any ideas, am I missing
> > > something obvious?
> >
> > > Thanks!
> >
> > --
> > Thanks & Regards,
> > Vijayk.
> > Co-founder (www.weboniselab.com)
> >
> > "You Bring the Dreams, We'll Bring the Means"
> >
>


-- 
Thanks & Regards,
Vijayk.
Co-founder (www.weboniselab.com)

"You Bring the Dreams, We'll Bring the Means"

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sitepoint tutorial with Flickr component

2009-06-29 Thread Hols Kay

Hi Vijay - thanks for your help!

The photo array is blank while all the other key pairs are populated,
and photo is the only keypair that uses an array:
---
$thumbs =   array(
"photoset" => array(
"id" => "72157620559969985",
"primary" => "65816580",
"owner" => "23548...@n00",
"ownername" => "algo",
"photo" => array(),
"page" => 1,
"per_page" => 500,
"perpage" => 500,
"pages" => 1,
"total" => "1"
),


Photo is the only key pair that has an array - so I guess that's
significant. If I change $this->set('thumbs',$this->flickr-
>photosets_getPhotos($currset)); in GalleryController to $this->set
('thumbs',$this->flickr->photosets_getPhotos(array($currset))); then
that switches $thumbs to false, so it looks like my syntax is off,
also!

Is there a special way to push the array through?

Thanks again!
Hols

On Jun 29, 2:22 pm, Vijay Kumbhar  wrote:
> Hey Hols,
>
> Can you please checked  printing that $photo array??
> Please check that one. If that array is blank / or please check the
> structure of that array then it gives the error.
>
>
>
> On Mon, Jun 29, 2009 at 6:22 PM, Hols Kay  wrote:
>
> > Hi guys,
>
> > Quite new to this - I'm doing this tutorial:
> >http://www.sitepoint.com/article/photo-gallery-cakephp-flickr/and I'm
> > having issues on index.ctp. This is the troublesome code:
> > -
> > 
> > -
>
> > and this is the output I'm getting from it:
> > 
> > Notice (8): Undefined index: photo [APP\views\gallery\index.ctp, line
> > 12]http://farm.static.flickr.com//_.jpg"; title="" alt="" />
> > 
>
> > buildPhotoURL() looks like this:
> > 
> >        function buildPhotoURL ($photo, $size = "Medium") {
> >                //receives an array (can use the individual photo data
> > returned
> >                //from an API call) and returns a URL (doesn't mean that the
> >                //file size exists)
> >                $sizes = array(
> >                        "square" => "_s",
> >                        "thumbnail" => "_t",
> >                        "small" => "_m",
> >                        "medium" => "",
> >                        "large" => "_b",
> >                        "original" => "_o"
> >                );
>
> >                $size = strtolower($size);
> >                if (!array_key_exists($size, $sizes)) {
> >                        $size = "medium";
> >                }
>
> >                if ($size == "original") {
> >                        $url = "http://farm"; . $photo['farm'] . ".
> > static.flickr.com/" .
> > $photo['server'] . "/" . $photo['id'] . "_" . $photo
> > ['originalsecret'] . "_o" . "." . $photo['originalformat'];
> >                } else {
> >                        $url = "http://farm"; . $photo['farm'] . ".
> > static.flickr.com/" .
> > $photo['server'] . "/" . $photo['id'] . "_" . $photo['secret'] . $sizes
> > [$size] . ".jpg";
> >                }
> >                return $url;
> >        }
> > 
>
> > I know the tutorial is quite out-of-date now, so something might have
> > changed in either API that I don't know about it, or I could just be
> > doing something wrong. Does anybody have any ideas, am I missing
> > something obvious?
>
> > Thanks!
>
> --
> Thanks & Regards,
> Vijayk.
> Co-founder (www.weboniselab.com)
>
> "You Bring the Dreams, We'll Bring the Means"
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sitepoint tutorial with Flickr component

2009-06-29 Thread Vijay Kumbhar
Hey Hols,

Can you please checked  printing that $photo array??
Please check that one. If that array is blank / or please check the
structure of that array then it gives the error.

On Mon, Jun 29, 2009 at 6:22 PM, Hols Kay  wrote:

>
> Hi guys,
>
> Quite new to this - I'm doing this tutorial:
> http://www.sitepoint.com/article/photo-gallery-cakephp-flickr/ and I'm
> having issues on index.ctp. This is the troublesome code:
> -
> 
> -
>
> and this is the output I'm getting from it:
> 
> Notice (8): Undefined index: photo [APP\views\gallery\index.ctp, line
> 12] http://farm.static.flickr.com//_.jpg"; title="" alt="" />
> 
>
> buildPhotoURL() looks like this:
> 
>function buildPhotoURL ($photo, $size = "Medium") {
>//receives an array (can use the individual photo data
> returned
>//from an API call) and returns a URL (doesn't mean that the
>//file size exists)
>$sizes = array(
>"square" => "_s",
>"thumbnail" => "_t",
>"small" => "_m",
>"medium" => "",
>"large" => "_b",
>"original" => "_o"
>);
>
>$size = strtolower($size);
>if (!array_key_exists($size, $sizes)) {
>$size = "medium";
>}
>
>if ($size == "original") {
>$url = "http://farm"; . $photo['farm'] . ".
> static.flickr.com/" .
> $photo['server'] . "/" . $photo['id'] . "_" . $photo
> ['originalsecret'] . "_o" . "." . $photo['originalformat'];
>} else {
>$url = "http://farm"; . $photo['farm'] . ".
> static.flickr.com/" .
> $photo['server'] . "/" . $photo['id'] . "_" . $photo['secret'] . $sizes
> [$size] . ".jpg";
>}
>return $url;
>}
> 
>
> I know the tutorial is quite out-of-date now, so something might have
> changed in either API that I don't know about it, or I could just be
> doing something wrong. Does anybody have any ideas, am I missing
> something obvious?
>
> Thanks!
>
> >
>


-- 
Thanks & Regards,
Vijayk.
Co-founder (www.weboniselab.com)

"You Bring the Dreams, We'll Bring the Means"

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Sitepoint tutorial with Flickr component

2009-06-29 Thread Hols Kay

Hi guys,

Quite new to this - I'm doing this tutorial:
http://www.sitepoint.com/article/photo-gallery-cakephp-flickr/ and I'm
having issues on index.ctp. This is the troublesome code:
-

-

and this is the output I'm getting from it:

Notice (8): Undefined index: photo [APP\views\gallery\index.ctp, line
12] http://farm.static.flickr.com//_.jpg"; title="" alt="" />


buildPhotoURL() looks like this:

function buildPhotoURL ($photo, $size = "Medium") {
//receives an array (can use the individual photo data returned
//from an API call) and returns a URL (doesn't mean that the
//file size exists)
$sizes = array(
"square" => "_s",
"thumbnail" => "_t",
"small" => "_m",
"medium" => "",
"large" => "_b",
"original" => "_o"
);

$size = strtolower($size);
if (!array_key_exists($size, $sizes)) {
$size = "medium";
}

if ($size == "original") {
$url = "http://farm"; . $photo['farm'] . 
".static.flickr.com/" .
$photo['server'] . "/" . $photo['id'] . "_" . $photo
['originalsecret'] . "_o" . "." . $photo['originalformat'];
} else {
$url = "http://farm"; . $photo['farm'] . 
".static.flickr.com/" .
$photo['server'] . "/" . $photo['id'] . "_" . $photo['secret'] . $sizes
[$size] . ".jpg";
}
return $url;
}


I know the tutorial is quite out-of-date now, so something might have
changed in either API that I don't know about it, or I could just be
doing something wrong. Does anybody have any ideas, am I missing
something obvious?

Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---