ZenphotoCMS Forum
Accessing and using photo folders outside the Zenphoto web directory - 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: Accessing and using photo folders outside the Zenphoto web directory (/thread-8616.html)



Accessing and using photo folders outside the Zenphoto web directory - NM12845 - 2011-05-14

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.


Accessing and using photo folders outside the Zenphoto web directory - acrylian - 2011-05-14

Quote:'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/`


Accessing and using photo folders outside the Zenphoto web directory - NM12845 - 2011-05-14

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.


Accessing and using photo folders outside the Zenphoto web directory - sbillard - 2011-05-14

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.


Accessing and using photo folders outside the Zenphoto web directory - NM12845 - 2011-05-14

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!


Accessing and using photo folders outside the Zenphoto web directory - sbillard - 2011-05-14

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)


Accessing and using photo folders outside the Zenphoto web directory - acrylian - 2011-05-14

And as and addition: Sorry for confusing as I was confusing myself with rarely (by me) used feature..


Accessing and using photo folders outside the Zenphoto web directory - NM12845 - 2011-05-14

No apologies necessary. You have both been extremely helpful. I'll let you know how I fare.


Accessing and using photo folders outside the Zenphoto web directory - NM12845 - 2011-05-14

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.


Accessing and using photo folders outside the Zenphoto web directory - sbillard - 2011-05-15

Ok, here is my example.

structure is:

d:\wamp\ [i]web root[/i]
d:\wamp\albums\ [i]contains the albums[/i]
d:\wamp\zenphoto\ [i]zenphoto installation[/i]

for this I use:

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


Accessing and using photo folders outside the Zenphoto web directory - newguest - 2011-05-16

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.


Accessing and using photo folders outside the Zenphoto web directory - sbillard - 2011-05-16

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.


Accessing and using photo folders outside the Zenphoto web directory - newguest - 2011-05-16

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


Accessing and using photo folders outside the Zenphoto web directory - sbillard - 2011-05-17

You have found a bug. Fixed in the nightly builds after tonight.


Accessing and using photo folders outside the Zenphoto web directory - NM12845 - 2011-05-18

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