API for creating new Album

I'd like to programmatically create an album. However, I can't seem to find something like `createAlbum(string $albumName)`.

Can someone please point me in the right direction? I know an album is just a folder on the filesystem, but I would imagine some metadata needs to be added to the database, etc.

Any help would be greatly appreciated. Thanks!

Comments

  • acrylian Administrator, Developer
    What do you actually want to do? You can create a new album object with
    `$albumobject = new Album($_zp_gallery, );`

    But if you mean to create a real folder on the file system you need to look at the file system functions PHP provides. You will find all here for example: http://www.php.net/
  • I would like to create a page where members of my site can create Albums and upload pictures (this page would be integrated into my site and it's user system). Please correct me if I'm wrong, but it sounds like all I need to do is:

    1. Manually create a directory
    2. Create an Album object using the newly created directory as the albumfoldername
    2. Call the `setTitle`, `setDesc`, etc on the Album Object to update database
    3. Upload pictures into that directory

    ...I just want to make sure that's the proper steps to take. I want to make sure the ZenPhoto database is consistent with what's on the filesytem.

    Thanks!

    On my website I have a user I've installed ZenPhoto
  • You need to add one step to #2b--call on the `save()` method at the end to move the changes from memory into the database.
  • Thanks sbillard! Very much appreciated!
Sign In or Register to comment.