Junior Member
Junior Member
mlanglois   2007-03-24, 17:59
#1

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?

Developer
Developer
trisweb   2007-03-25, 22:01
#2

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.

Member
Member
jordi-kun   2007-09-12, 18:02
#3

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.

Member
Member
sbillard   2007-09-12, 23:23
#4

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.

Member
Member
jordi-kun   2007-09-13, 16:27
#5

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.

Member
Member
aitf311   2007-09-13, 17:11
#6

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.

Member
Member
sbillard   2007-09-13, 23:08
#7

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/".

Developer
Developer
trisweb   2007-09-13, 23:59
#8

Excellent. Thanks Stephen. Post on trac as usual!

Member
Member
sbillard   2007-09-14, 00:14
#9

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.

Member
Member
jordi-kun   2007-09-14, 06:28
#10

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

Member
Member
sbillard   2007-09-14, 14:23
#11

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.

Member
Member
jordi-kun   2007-09-15, 20:49
#12

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.

Member
Member
sbillard   2007-09-16, 03:54
#13

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

Member
Member
jordi-kun   2007-09-17, 18:16
#14

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

Member
Member
sbillard   2007-09-17, 21:55
#15

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!

Member
Member
jordi-kun   2007-10-02, 16:35
#16

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

Member
Member
aitf311   2007-10-02, 17:10
#17

That sounds like a good idea for a trac ticket.

Member
Member
sbillard   2007-10-03, 03:08
#18

There is already a ticket.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.