hi
I wish to acess to the image object of a specific image.
I only know his path on the server (albums/album_1/image_1.jpeg for exemple).
How can I do that with the different existing functions ?
Thanks for your help.
thanks for your help
I do like that :
`
`
It works well.
Maybe, it would be a good idea to have a function which allow to directly access to the image object of a specific image.
Something like that:
$imageobject = FunctionName($galleryobject, "/album_name/image_name.jpg");
btw, there is a mistake on http://www.zenphoto.org/news/zenphotos-object-model-framework.
in
Note that "folder name" means the name of the real folder on the filesystem within the root "albums" folder of your installation. If you want to create an object of a subalbum the name must include the parent album name(s) like "toplalbumfoldername/subalbum1folder/subalbum2folder" (etc);
there is a missing "/" and it should be :
"/toplalbumfoldername/subalbum1folder/subalbum2folder" (etc);
If you are on Zenphoto theme pages you don't need to create the gallery object as that is already present in the global $_zp_gallery always. Not sure, if the check if the image exists is really needed as it otherwise should not be able to create an image object (sbillar might correct me though)
I doubt that we will make a function for image object as that would just save one line of code actually.
You actually don't need the trailing slash at all. "albumname/subalbumname" is enough.
with my tests, without the slash, I can't access to the picture :
"if (is_object($imageobject) && $imageobject->exists)" returns always false.
I will have a look on the function above (tanks for your advise)
@acrylian
1- if I write :
`
`
I have this error in debuglog :
Quote:{Sat, 07 Jan 2012 20:55:48 GMT} Zenphoto v1.4.1.5[8326]
Backtrace: Bad gallery in instantiation of album groupe-photo-ecully/portraits-low-key.
Album->Album called
from eval (template-functions.php(4699) : eval()'d code [21])
from printCodeblock (template-functions.php [4699])
from include (pages.php [12])
from include (index.php [5])
from index.php [155]
so I need the creation of a gallery object.
fyi, this code is used on personnnal home page, to display a slideshow.
3- you are right, the slash at the begenning is not required (I don't know where my mistake was)
@sbillard: We might reconsider the recent change ignoring the "$gallery" parameter. Maybe just a check if the global $_zp_gallery is set would be the way to allow both ways. (or maybe we just add the global to the codeblock, which they probably don't have being Zenpage functions).