ZenphotoCMS Forum
API for creating new Album - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: API for creating new Album (/thread-4262.html)



API for creating new Album - ReluctantIdiot - 2008-12-16

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!




API for creating new Album - acrylian - 2008-12-16

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/




API for creating new Album - ReluctantIdiot - 2008-12-16

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
  3. Call the setTitle, setDesc, etc on the Album Object to update database
  4. 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




API for creating new Album - sbillard - 2008-12-16

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.




API for creating new Album - ReluctantIdiot - 2008-12-17

Thanks sbillard! Very much appreciated!