Accessing and using photo folders outside the Zenphoto web directory

Hi.

I can't find an example in the Forum or Docs of what I am messing up, so I need to ask a question or three on my new installation of Zenphoto. I want to use Zenphoto to display photo galleries on my website, hosted by a third-party service provider (Linux server). I have installed Zenphoto in the directory www.mysite.com/Parent-folder/zenphoto. The photos are in multiple directories under the directory www.mysite.com/Parent-folder/albums, in the format ../albums/01, ../albums/02, ../albums/03, etc. The photos are accessed by other applications on the website, so I don't want to (can't) move them under the Zenphoto 'albums' directory.

Reading the docs, I found that I could change the Zenphoto "album" folder via the "zp-config.php" file by changing the 'album_folder' and 'album_folder_class' variables, so my zp-config.php file now has the following lines (nothing else but database login info is changed from default setup in this file):
...
...
$conf['album_folder'] = '../Parent-folder/albums/';
$conf['album_folder_class'] = 'in_webpath';
...
...

Zenphoto can't find any of the picture folders when I go into the admin page to build albums and point to the individual directories to populate them. I've obviously hortched this config, so any recommendations to links in the Forum I've missed, or tips as to how to fix this would be greatly appreciated.

Thanks for your time.

Comments

  • acrylian Administrator, Developer
    'in_webpath' -- the folder must be the full path of the album folder from the WEB root of the zenphoto installation.

    `'../Parent-folder/albums/';` is not a full path which would be `yoursite.com/Parent-folder/albums/`
  • NM12845 Member
    Thanks, acrylian. I've modified the 'album_folder' to have the value 'mysite.com/Parent-folder/albums/' as you recommended. I misinterpreted that the web root was for the Zenphoto directory, rather than the web root for the site.

    Still no way to link to the existing photo folders to make albums that I can see in the admin page, but I'll search around the Forum for a while, as that wasn't the topic I posted on.

    Regards and thanks again for your time and advice.
  • What you want is
    `
    $conf['album_folder'] = '/Parent-folder/albums/';
    $conf['album_folder_class'] = 'in_webpath';
    `
    You need an absolute path. What you did put was a relative path (the ../) which would be from the current folder--highly likely not to be the correct path.
  • NM12845 Member
    I see, yes, that is a serious mistake on my part. Thanks for correcting me. Still no luck with populating the albums, so I'll work my way through the Forum and look for additional information.

    Thanks again!
  • Take a look at your site through your FTP client. Also remember that Unix filenames are case sensitive.

    You will find paths like:

    `home/user/htdocs/Parent-folder/Zenphoto/` for the zenphoto install

    and

    `home/user/htdocs/Parent-folder/albums/` for your albums.

    You want the path to the actual albums not including the `home/user/htdocs/Parent-folder/` part (which is the WEB root of your zenphoto site. Sorry I did not carefully read your initial post, Did not realize that zenphoto was within Parent-folder)
  • acrylian Administrator, Developer
    And as and addition: Sorry for confusing as I was confusing myself with rarely (by me) used feature..
  • NM12845 Member
    No apologies necessary. You have both been extremely helpful. I'll let you know how I fare.
  • NM12845 Member
    No luck so far with getting this to work I am afraid. I changed the lines in zp-config.php to the following:

    $conf['album_folder'] = '/photos/';
    $conf['album_folder_class'] = 'in_webpath';

    The directory structure of the website looks like this (and though I wish it could be changed, it can't):
    ./ (mysite.com)
    |
    |--- Parent
    |
    |--- zenphoto
    | |--- albums
    |
    |--- photos
    |--- 01
    |--- 02
    |--- 03
    ...

    For whatever reason, I cannot get Zenphoto to "see" and use the existing galleries in "photos". I even tried making albums called "01", "02", etc and re-uploading the files to be displayed into the albums (thus overwriting the originals with duplicates I thought), but Zenphoto instead put the new albums into Zenphoto/albums.

    I'm going to put this aside and solve this project another way, and then I'll return to this puzzle at a later date.

    Thanks again for your help.
  • Ok, here is my example.

    structure is:

    d:\wamp\ web root
    d:\wamp\albums\ contains the albums
    d:\wamp\zenphoto\ zenphoto installation

    for this I use:

    $conf['album_folder'] = '/albums/';
    $conf['album_folder_class'] = 'in_webpath';
  • I am testing locally on windows. I created a directory on the webroot.

    New directory - e:\wamp\ashes
    ZenPhoto directory - e:\wamp\www\zenphoto

    My configuration reads as:
    $conf['album_folder'] = 'e:/wamp/ashes/';
    $conf['album_folder_class'] = 'external';

    Where it says external, if I add "std or in_webpath," it does not work.

    This is what I noticed.

    After editing the config file, I could not access the albums that I created previously. The albums do not show up when I login into the backend. But when I revert back to the original setting in the configuration file, I see the previously created albums.

    Original configuration in ZenPhoto (did not change a thing):
    $conf['album_folder'] = '/albums/';
    $conf['album_folder_class'] = 'std';

    If I put the original configuration, I can see all the files I created.

    My new configuration works and I see the images uploaded in the ashes directory. I hope this helps in figuring out the path.
  • Since you have provided the full server path you do not meet the standard for the path being FROM the webroot. But of course, it will work with the external class. Please try to understand the example I have shown you. That does work.
  • $sbillard - Maybe the example works online, but it does not work locally.

    The directory ashes is in the webroot:
    e:\wamp\ ashes

    ZenPhoto is installed in the "www" directory off the webroot
    e:\wamp\www\ zenphoto

    Zenphoto is NOT installed in the webroot:
    e:\wamp\ zenphoto

    I have tried your example again and it does not work with my setup. The only time it works if if the full path is entered in the $conf['album_folder'] AND the Folder Class is external.

    If ZenPhoto is installed e:\wamp\zenphoto, your example will work.
  • You have found a bug. Fixed in the nightly builds after tonight.
  • NM12845 Member
    @sbillard:

    Thanks for your example. I had set up the zp-config.php lines along the lines of your example, like so:

    Directory structure (server)
    -----------------------------
    mysite.com/Parent/ (web root)
    mysite.com/Parent/photos/ (contains the albums)
    mysite.com/Parent/zenphoto/ (zenphoto installation)

    zp-config.php lines
    --------------------
    $conf['album_folder'] = '/photos/';
    $conf['album_folder_class'] = 'in_webpath';

    Still no luck. I am noticing that the setup program is having difficulty changing file permissions as well ("automated" 777 -> 755 and vice versa fails), and permissions must be modified manually. There may be a server configuration issue I am up against, though the PHP and MySQL are supported versions.

    I was also clumsy copying files in my last modification, and I think I mangled the current installation. I will re-install with the most recent nightly trunk and see if I can get better results.

    Thanks again for your help.
Sign In or Register to comment.