zenphoto forums » General Zenphoto Discussion

Add files from directory and not admin panel

(6 posts)
  • Started 9 months ago by cprog954
  • Latest reply from sbillard
  1. cprog954

    Junior
    Joined: Aug '12
    Posts: 7

    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

    Posted 9 months ago #
  2. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,367

    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.

    Don't forget to read the Forum rules and usage resources
    Posted 9 months ago #
  3. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,771

    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.

    Don't forget to read the Forum rules and usage resources
    Posted 9 months ago #
  4. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,367

    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).

    Don't forget to read the Forum rules and usage resources
    Posted 9 months ago #
  5. cprog954

    Junior
    Joined: Aug '12
    Posts: 7

    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

    Posted 9 months ago #
  6. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,771

    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.

    Don't forget to read the Forum rules and usage resources
    Posted 9 months ago #

RSS feed for this topic

Reply

You must log in to post.