URLs for albums
Locke
Registered Users Posts: 10 Big grins
Hey Guys,
I'm really new at using the API so maybe I'm just missing something. What I want to do is have a PHP function on my blog that will get the URLs for my SmugMug galleries via the API so I can feed them into an unordered list as links. I was looking at albums.get and albums.getinfo but it seems they do not expose that information. Is there another way to go about this? or am I missing something obvious?
Thanks,
--Locke
I'm really new at using the API so maybe I'm just missing something. What I want to do is have a PHP function on my blog that will get the URLs for my SmugMug galleries via the API so I can feed them into an unordered list as links. I was looking at albums.get and albums.getinfo but it seems they do not expose that information. Is there another way to go about this? or am I missing something obvious?
Thanks,
--Locke
0
Comments
Want faster uploading? Vote for FTP!
Yes, I am using the wrapper. This is what I have so far:
$albums = $f->albums_get('NickName=name','Heavy=1');
$images = $f->images_get("AlbumID={$albums}", "Heavy=1");
echo '<ul>';
foreach ($images as $pic) {
echo '<li><a href="'.$pic.'">'.$albums.'</a></li>';
}
echo '</ul>';
The above gets me 23 links (one for each pic in the album) that look similar to this:
http://name.smugmug.com/Projects/album/10825351_hKBR9#768867522_sCffc
http://name.smugmug.com/Projects/album/10825351_hKBR9#768867507_pNzL3
That has been my solution so far since the images.get in the API contains the URL. The problem I'm faced with now is digging into the array prior to the loop that prints the links and stripping out the all the ID numbers for the image and then doing something like array_unique() so I only get one link per album.
Want faster uploading? Vote for FTP!
See what this gets you (you may have to adjust syntax as I haven't tested this code). It should be a list of all the album urls and the titles next to them:
$albums = $f->albums_get('NickName=name','Heavy=1');
foreach ($albums as $album)
{
$eventAlbums[] = "URL: {$album} Title: {$album}\n";
}
print "$eventAlbums";
Want faster uploading? Vote for FTP!
I will give that a shot. Thanks for looking into it.
I'm not a programmer, but I can figure out code if I have to. For me, practicing once a while doesn't hurt.
Want faster uploading? Vote for FTP!