This is my first attempt to make a Zenphoto theme. Actually, not 'make' a theme, but convert a jQuery gallery [http://tympanus.net/codrops/2010/05/14/sliding-panel-photo-wall-gallery-with-jquery/] to Zenphoto theme.
The thumbnails of the pictures are loaded, when the user clicks on the thumbnail, the image enlarges dynamically [jQuery] i.e. without going to the image page loading the image in the album page itself. I have been successful converting that jQuery gallery [as is] to a basic Zenphoto theme.
The issue arises when I want to show comments and meta data for the image clicked.
I am not sure [b]what[/b] parameters to pass via jQuery to [b]which[/b][b] file to get the comments and exif data loaded dynamically.
What I have done till now is:
-Get the image parameter via the id of the image which I have set on album.php
`
`
-Make a PHP file with the following code ---- anotherfile.php:
`
But this throws an error understandably:Call to a member function get() on a non-object`
What parameter do I have to pass to getMetaDataImage function or printImageMetaData function to load the metadata dynamically for the image clicked? And similarly to the comment function?[/b]
Please see:
http://www.zenphoto.org/news/category/theming-templating
and especially:
http://www.zenphoto.org/news/zenphotos-object-model-framework
In short you arer outside the context and have to pass the image name and its albums name (you can have images of the same name in several albums, you know?) and then create a new image object on the page.
Unless your above code is situated in the zp-core folder the require_once("functions.php"); will not load the Zenphoto file of that name. You will have to spell out the full path to that file.
How is anotherfile.php being loaded?
I may be confused, but I suspect your are going down the wrong track. Remember that there is a separation of the server side and the client side of your site. PHP runs on the server side. jQuery (or any javascript) runs on the client side.
What this means is that you have to populate any jQuery details into the page WITH php. I suggest you download the development nightly build. There you will find an update Effervescence+ theme that has a jQuery gallery based on [i]ad-gallery[/i]. That may not be the gallery look you want but certainly it should give you insite on how these things are done.
anotherfile.php is loaded via jQuery.
Here is the code:
`
function exifLoad(image) {
var album = $(".zp_uneditable_album_title").html();
var postData = {
"image" : image,
"album" : album
};
$.ajax({
type: "POST",
url: "/zenphoto/themes/mytheme/anotherfile.php",
data: postData,
success: function(data){
$("#exif-panel").html(data);
}
});
}
And this is the changedanotherfile.php`:
`
`
Though now it doesn't throw any error, it doesn't display any data either. Nada. Blank.
@sbillard, I [i]know[/i] jQuery is on client-side and PHP is on server-side. I'm not sure what you meant by 'loaded' and thought you were asking how the page is being called.
If I didn't know, I wouldn't have successfully be able to load the images directly via jQuery.