I'm programming my own php page, and I want to get the images in a specific album. Documentation says to use the object model, rather than direct mysql queries.
First, how do I get access to the methods? Include?
After that, can I just use the following:
$theAlbum = new Album('myalbum');
$theImages = $Album->getImages();
Thanks for any direction and help.
The doc refers naturally to usages within Zenphoto context of themes and plugins. If you are referring to external usage take a look here: https://www.zenphoto.org/news/integration-with-existing-sites-and-other-cms/
Maybe investigate if creating a theme isn't the easier way. Zenphoto theming is quite flexible.
There is also a third party REST API plugin - well in fact I am a bit involved in it, too – that allowe extern fetching:
https://github.com/deanmoses/zenphoto-json-rest-api/issues
You cannout MySQL queries because of inheritance of albums regarding visibility and protection. A subalbum may be published but it is not if the parent album is not but the db entry itself does not have info about that.
Thanks for this info, I'll look into it.
Maybe there is an easier way to do what I need... I have a small (250px wide) slideshow based on a fixed, specific, non-public album on my home page. The other albums are all just used as albums in a regular gallery. I tried to use the slideshow within Zenphoto, but then all slideshows are only 250px rather than full size. So far, I was doing a mysql query to get images from this specific album, which worked; but then adding in descriptions was not working. Desc's showed up in the table .images but not xx_images. If that makes sense...
Any help would be greatly appreciated!!
Thank you so much, this should be perfect and I like using their slide show. But I'm using this from a non-zenphoto page (just my own index.php), so I need to include the zen library. I tried the code on
https://www.zenphoto.org/news/integration-with-existing-sites-and-other-cms/ (using my correct directory)
define('SERVERPATH',str_replace('\','/',dirname(FILE)).'/zenphoto');
define('WEBPATH','/zenphoto');
require_once(SERVERPATH.'/zp-core/template-functions.php');
But I get a 500 error on the require_once statement. What is the proper way to get access to the zenphoto library?
Thanks again for the help; I'm just not finding much doing my own searches.
Yes, the double slash is correct too (formatting issue here). The file is definitely found properly, and the resulting 500 error comes up, with no error message in the log. I verified that if I change "template-functions" to a wrong name I get a file-not-found error in the log.
So requiring template-functions.php should work? And will include the class methods needed?
I can try reloading that file, but the gallery itself works just fine...