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!
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.)
Posts: 8339
try
http://www.flashyourweb.com/staticpages/index.php?page=TheMiniSlideShow
http://www.flashyourweb.com/staticpages/index.php?page=mediaBlock
They already do what you want.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 4
Alecmyers,
I was able to install the simpleviewersource plugin and get everything activated on the gallery side. Yet when I post the necessary XMLpath it doesn't seem to do anything:
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?
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
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)?
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
http://beta.thetfordacademy.org/images/screenshot.jpg
This is a test URL of the page using it:
http://beta.thetfordacademy.org/athletics/boys/basketball/
This is what the actual code looks like on the page:
<div id="flashcontent">
<p>AutoViewer requires JavaScript and the Flash Player. <a href="http://www.macromedia.com/go/getflashplayer/">Get Flash here.</a>
</div>
<script type="text/javascript">
var fo = new SWFObject("viewer.swf", "simpleviewer", "500", "660", "8", "#FFFFFF");
//Optional Configuration
fo.addVariable("xmlDataPath", "http://pictures.thet.net/main.php?g2_view=simpleviewersource.XMLOut%26g2_itemId=4314");
fo.addParam("quality", "best");
fo.write("flashcontent");
</script>
</div>
Posts: 4342
IT looks like simpleviewersource is working fine, because if you plug this url into a browser and view the source generated
http://pictures.thet.net/main.php?g2_view=simpleviewersource.XMLOut&g2_itemId=4314 (note replace %26 with & when manually loading the url)
you get this:
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?
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:
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