Member
Member
cprog954   2012-08-20, 14:39
#1

My use of ZenPhoto might be somewhat out of the ordinary as I am using ZenPhoto to drive a larger site that relies heavily on photos(all public domain due to the nature of the photos) from a few dozen sites that drives my overall theme... My question is this... I have written a php script that parses the various sites to obtain the data I need for my site. The script downloads the images and stores them in folders by date right now, but could all be stored in a main folder with date appended to image filename if need be.. anyways heres my question

What file can I include() inside of my script from ZenPhoto to make the adding of files automatic everytime my cron runs and calls my script?

I am sure it is possible, I have not looked much at the provided source code yet, but will, but just curious if you guys could point me in the right direction

Administrator
Administrator
acrylian   2012-08-20, 15:17
#2

If you mean creating the albums and image entries, you should look at the Zenphoto object model. If your script is truly externen and not part of the theme you would need to follow the "Zenphoto as a plugin" tutorial on the user guide.

Or probably you could make your script even either a theme custom function or even a plugin using one of the filters available.

Member
Member
sbillard   2012-08-20, 15:47
#3

If I understand correctly you want to run a cron job to download images from external sites and place them into Zenphoto albums. If that is the case there is nothing you need to do within Zenphoto. It will automatically recognize new albums and images. So all your cron job has to do is fetch the images and store them in the appropriatet Zenphoto album stucture.

Administrator
Administrator
acrylian   2012-08-20, 15:57
#4

True, I thought he maybe wanted to add some data from the sources as well. Probably those public domain images have not always meta data (for example images on Wikipedia).

Member
Member
cprog954   2012-08-20, 18:47
#5

Sweet...yea I added a table to db for the data that accompanies the photo from each feed as the data is not meta data but elements in an xml to accompany each photo in the feed... will read up some on the topics noted above

Member
Member
sbillard   2012-08-20, 23:02
#6

If you are lucky, the XML data will match the XMP tags used as a store for image metadata. Then all you need to do is create a file with the image name prefix and XMP as a suffix and place that with the image.

Of course you will also need to enable the xmpMetadata plugin.

If the XML is different then you can simply make the appropriate translations. The plugin document points to the XMP specification for the fields.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.