ZenphotoCMS Forum
How to change location of albums folder? - 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: How to change location of albums folder? (/thread-1319.html)



How to change location of albums folder? - mlanglois - 2007-03-24

I'd like to specify another location for the albums folder.
Is there a variable somewhere that I could change (e.g. change "/albums" to "/anotherfolder")? Could it be added to zp-config.php?




How to change location of albums folder? - trisweb - 2007-03-25

It should be in the file class-gallery.php as the variable $albumdir, set in the constructor on line 17, but I believe it's also hardcoded in several other places, like i.php and link paths in functions.php. Just do a global search for "/albums/" and you might be able to change them all where appropriate.




How to change location of albums folder? - jordi-kun - 2007-09-12

Sorry to revive this thread... Any hope to un-hardcode the albums path? I run a server myself and I rather have the albums not in the webroot.




How to change location of albums folder? - sbillard - 2007-09-12

Oh My!

It is hard coded in: (line numbers are from the community build)
admin.php (lines 16 & 188)
class-album.php (lines 9, 26, 244, 249, 394, 441)
class-gallery.php (lines 18 & 274)
class-image.php (lines 30, 31, 32, 47, 252)
functions.php (line 193)
admin-functions.php (line 88)
i.php (lines 73, 80, 181)

Fixing this should probably be put on the roadmap.




How to change location of albums folder? - jordi-kun - 2007-09-13

Indeed. I managed to implement it in the first community build release but with so many updates, it made it impossible to keep track of it.




How to change location of albums folder? - aitf311 - 2007-09-13

jordi-kun, if you get it implemented again please make the diff or patch files and we can get it implemented if it is quality.




How to change location of albums folder? - sbillard - 2007-09-13

Jordi-kun: I have a preliminary patch that fixes all the hard code "/albums/" to calls on the function getAlbumFolder() which I will be releasing soon. So, all that is left is to to the actual option / conf stuff. The implementation I have made will use whatever you put in conf['album_folder'] in zp-config. If there is no such item it defaults to the classic "/album/".




How to change location of albums folder? - trisweb - 2007-09-13

Excellent. Thanks Stephen. Post on trac as usual!




How to change location of albums folder? - sbillard - 2007-09-14

It is there now--had to test it first http://www.zenphoto.org/trac/ticket/116

This allows, but does not implement changing the album folder name. That I did not wish to test.




How to change location of albums folder? - jordi-kun - 2007-09-14

@sbillard: thanks! Since it is using SERVERPATH.getAlbumFolder(), it doesn't look like you can set the albums folder outside the zenphoto folder. I haven't tried it yet though, will do this afternoon.

maybe the getAlbumFolder function could return the also the SERVERPATH if required.




How to change location of albums folder? - sbillard - 2007-09-14

I have a new set of changes on the ticket. However, there is still an issue you will have to deal with. Sometimes it uses SERVERPATH (now the default) and sometimes it uses WEBPATH or another path. YOu have to figure out what to do about those.

The new function is passed the root path and returns the full path. Kind of like you suggest.




How to change location of albums folder? - jordi-kun - 2007-09-15

Thanks sbillard, so far looks good! One thing I saw, which I'm not sure if it's related or not, is that the cached images all go to the /cache folder instead of their respective subfolders.




How to change location of albums folder? - sbillard - 2007-09-16

I'll have to look into this. I didn't think I changed anything having to do with the cache.




How to change location of albums folder? - jordi-kun - 2007-09-17

@sbillard: I found the "what" but not the "why". In functions.php, function getImageCacheFilename(), there is the following line:

if ($album='') { $albumsep = ''; }

if you comment it, cache works perfect. I'm not sure why it was added thus ignore possible consequences.




How to change location of albums folder? - sbillard - 2007-09-17

Yes, I found that myself today. I also don't know why it causes the problem, but I will delete that line in my next update. Thanks for letting me know, though. Wish I'd looked at the forum before working on the problem all day today!




How to change location of albums folder? - jordi-kun - 2007-10-02

what about the cache folder? should it be un-hardencoded?




How to change location of albums folder? - aitf311 - 2007-10-02

That sounds like a good idea for a trac ticket.




How to change location of albums folder? - sbillard - 2007-10-03

There is already a ticket.