Creating albums...

So it may be a bit of a tricky question but I think it can be done if I get started in the right direction. I have a filemaker pro database that has fields for specific information about an item, but doesn't allow images. I have created a button that I can open up a new browser with zenphoto. My question now is can I use information from the database to pass to the URL to automatically pass me to a page with a preformed album (from the database information ie. create an album named XYZ because in FMP I inserted XYZ). Is what I am thinking of possible? Even a direction/file to wander around in relating to this would help.

Thanks!

Comments

  • If you mean to link to the zenphoto image page, yes, you can. Assuming you are using mod_rewrite, the link is <yoursite>zenphoto/<album>/<image>. (Assumes you installed in the folder zenphoto.)
  • I have done this, and it kind of works. When I type in that address it gives me an index page (i.e. Index of / and file list) of what is in that directory instead of sending me to my album page.

    And I believe I was a bit unclear in my original post. The database sends the URL, but if the album is not already created, zenphoto does nothing. Typically there will not be an album already created for the images being uploaded. I was hoping that I could just pass to zenphoto:
    "server/zenphoto/zp-core/admin-upload.php?album=ABC%2fXYZ"
    where then the folders for ABC and XYZ are created and I am brought to the upload screen to fill that album with photos and metadata.

    My issue is that I need to sometimes build sub-albums where higher albums/folder structure is not already present. Is this something that is possible by just passing a URL?

    Thanks again!
  • Hello,

    I have found a way to make the folders that I need for uploading, now I am just trying to figure out how to implement this into zenphoto...

    `
    <?php

    //This code is designed to run from a filemaker button to create photo directories from filemaker without having to do it by hand.

    //Gets the album info from the end of the URL
    $url = $_GET['album'];

    //Sets the album info in variables and pulls them from the URL splitting them between the forward-slashes
    list($folder, $powder, $substrate,) = array_map('urldecode',explode('/',$url));

    //Sets the path for the directory to be created and sends out a warning if the directory could not be created
    $path = "$folder/$powder/$substrate";
    if(!mkdir("$path", 0775, true))
    {
    echo ("Couldn't create directory, it probably already exists, but check /Volumes/Mach 2/Media Library/Images/$path to be sure.");
    }

    ?>
    `
    So that should create my folder structure, I would just like somebody to help me out with where I should put this...
    1. in a zenphoto page
    2. a separate page and then redirect to the upload-page from there

    Thanks
  • Hello,

    I have found a way to make the folders that I need for uploading, now I am just trying to figure out how to implement this into zenphoto...

    `
    <?php

    //This code is designed to run from a filemaker button to create photo directories from filemaker without having to do it by hand.

    //Gets the album info from the end of the URL
    $url = $_GET['album'];

    //Sets the album info in variables and pulls them from the URL splitting them between the forward-slashes
    list($folder, $powder, $substrate,) = array_map('urldecode',explode('/',$url));

    //Sets the path for the directory to be created and sends out a warning if the directory could not be created
    $path = "$folder/$powder/$substrate";
    if(!mkdir("$path", 0775, true))
    {
    echo ("Couldn't create directory, it probably already exists, but check /Volumes/Mach 2/Media Library/Images/$path to be sure.");
    }

    ?>
    `
    So that should create my folder structure, I would just like somebody to help me out with where I should put this...
    1. in a zenphoto page
    2. a separate page and then redirect to the upload-page from there

    Thanks
  • The folder needs to be created within the Zenphoto albums folder. The root of that is got by the function getAlbumFolder(). Please see the function comments for details. I'm unclear as to the structure of the $_GET['album']) parameter. Normally in Zenphoto this would be the naked "album" name so the path would be getAlbumFolder()._Get['album']);

    Of course, you will need to use make sure the character set is correct--we use the functions InternalToFilesystem() and FilesystemToInternal() to make this happen.
  • Sorry I'm very new to php. The filemaker server passes our zenphoto URL with album information already in it. There are fields for our $powder and $substrate variables which filemaker throws together into a url. The url is something like http://server/zenphoto/zp-core/admin-upload.php?album=$folder/$powder/$substrate and the GET just pulls the information so it knows what folder to go in:
    -> .../zenphoto/albums/$folder/$powder/$substrate/photos.

    Where should I be looking at these files to put something in? and where are the function comments located?
  • So then the server path would be `getAlbumFolder().internalToFilesystem($folder.'/'.$powder.'/'.$substrate.'/photos');`
Sign In or Register to comment.