Hi all,
I am trying to integrate a Picasa photo gallery into my EE website. The Nettuts article explaining how to do this using JQuery can be found here: http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-an-image-gallery-powered-by-picasa/
The reason that I am using Picasa rather than the EE Gallery is because the client already has a Picasa account and has uploaded several hundred photos. Plus, I don’t want to have to worry about running out of space on my hosting account.
The solution works fine outside of EE. However I am having trouble integrating it into an EE template.
I created a new template group called “photos” and am using the default index template to display the Picasa photo gallery.
I began by making sure that “Allow PHP” was set for the photos/index template in “Template Preferences Manager”. I wasn’t entirely sure what to set for “PHP Parsing Stage”, so I went with “Output”. I then submitted my changes, and got the “Preferences Updated” message. So I thought, great. When I went back in to check that it had been saved, I was expecting to see “Allow PHP” set to “Yes”, and “PHP Parsing Stage” set to “Output” for that tmplate. But instead they were both set to the original “Do not change” value.
To test if I could execute some php from my template, I added some very simple echo commands, and was able to see them appearing in my template. OK so far. I then decided to go ahead and began to add code from the nettuts article (above) into my photos/index template. At the head of their index.php page was the following code:
<?php
include './_conf.php'; // getting constants
$file = file_get_contents("http://picasaweb.google.com/data/feed/api/user/".$uName."?kind=album&access=public&thumbsize;=".$tSize);
$xml = new SimpleXMLElement($file);
$xml->registerXPathNamespace('gphoto', 'http://schemas.google.com/photos/2007');
$xml->registerXPathNamespace('media', 'http://search.yahoo.com/mrss/');
if($gTitle == null){ // if empty Gallery title will be "user id's Photo Gallery"
$nickname = $xml->xpath('//gphoto:nickname');
$gTitle =$nickname[0]."'s Photo Gallery";
}
?>This is pretty basic stuff. It’s simply calling out to picasa and attempting to retrieve album/photo details for a given user. The user is defined in the _conf.php. This _conf.php file is located in the “photos” template group folder.
To make life easier on myself and to make sure that this bit was working properly before moving on, I just added some very simple html to the template. I figured that if my page rendered correctly, then I could move on and get the other bits working. The rest of my photos/index template looked like this:
<html>
<head>
<title>My Title</title>
</head>
<body>
My sample text
</body>
</html>However, when I went to view the rendered template, the page was blank. When I went view the page source, it was blank too.
I reckon I am having trouble with the include part at the top of my template. Am I doing this correctly? Should the _conf.php (gallery configuration file) be stored in the template group folder alongside my index template?
Thanks in advance for your help,
Ross