Gallery API - Pulling images into your website
starkec
Joined: 2009-01-20
Posts: 4 |
![]() |
I'm extremely new the gallery environment, and working on a project for a client who uses Gallery for managing their images. For our newest website project, I want to be able to pull a specific album from their Gallery into the new website. I've been trying to find imformation on the Gallery API, and thought it might be worth posting on here for details. I'm going to be setting up a flash photo gallery that pulls in an xml file (which contains the images). I will eventually want to be able to use the Gallery API to pull the ablum information (via PHP) and eventually have it post into an xml file. If anyone has had some experience doing this, I'd appreciate the help. Thanks! |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Have a look at the simpleviewersource module which does pretty much exactly what you're asking. (Some familiarity with the SimpleViewer flash application from Airtight Interactive will be appropriate.) |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
starkec
Joined: 2009-01-20
Posts: 4 |
![]() |
Alecmyers, fo.addVariable("xmlDataPath", "http://pictures.thet.net/main.php?g2_view=simpleviewersource.XMLOut%26g2_itemId=4314"); Do you know if there's another area in Gallery where I have to enable the simpleviewer other than the plugin itself? |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
SimpleViewer the Flash application isn't enabled or disabled from within Gallery. simpleviewersource the Gallery Module is enabled/disabled (as are all Gallery modules) from the plugin page. For everything else simpleviewersource codex page wrote:
All parameters are set in the Simpleviewer Tab of the Edit Album page. Have you correctly set the "Enable (or disable) simpleviewer from displaying the pictures in this album and its sub-albums." setting for the albums you want to display (or their parents)? |
|
starkec
Joined: 2009-01-20
Posts: 4 |
![]() |
I have that parameter set to 'yes', so that it's enabled. I'm assuming that's what i want. Here's a screenshot of my gallery interface This is a test URL of the page using it: This is what the actual code looks like on the page: |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
IT looks like simpleviewersource is working fine, because if you plug this url into a browser and view the source generated <simpleviewerGallery thumbnailRows='1' thumbnailColumns='6' navPosition='bottom' stagePadding='0' frameWidth='1' frameColor='0xC3C7D2' textColor='0xC3C7D2' maxImageWidth='500' maxImageHeight='500' thumbPath='http://pictures.thet.net/main.php?g2_view=simpleviewersource.DownloadThumb&g2_itemId=' imagePath='http://pictures.thet.net/main.php?g2_view=simpleviewersource.DownloadMax&g2_maxImageHeight=&g2_maxImageWidth=&g2_itemId=' > <image><filename>4315</filename><caption>IMG_5631</caption></image> <image><filename>4319</filename><caption>IMG_5632</caption></image> <image><filename>4322</filename><caption>IMG_5633</caption></image> <image><filename>4325</filename><caption>IMG_5634</caption></image> <image><filename>4328</filename><caption>IMG_5638</caption></image> </simpleviewerGallery> Which is pretty healthy. It looks like you're trying to load the xml from a domain other than the one hosting the SimpleViewer swf file, so you'll probably have to comply with Adobe's cross-domain xml policy mechanisms. See for instance http://sudhahariharan.wordpress.com/2007/09/04/what-is-this-cross-domainxml-file-anyway/ Could that be the problem? |
|
starkec
Joined: 2009-01-20
Posts: 4 |
![]() |
Alecmyers, are you a genius. I didn't even realize Adobe had this security in place. So to get around it I created a php file that takes in the xml content from the Gallery URL, and then just pushes it back to the Simplerviewer. This way Simpleviewer is pulling a local php file, so the cross domain is no longer an issue. I would have never figured that out without your help, thanks a bunch! Just in case anyone else sees this, if you run into the same issue, just point your simpleviewer to a php file containing this code: Quote:
<?php |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
The best solution (doesn't require extra php) is to put a correctly-configured crossdomain.xml file in the webroot of the site hosting the Gallery installation, the site you want to load the data from. http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14213 |
|