A couple of migration questions

tvset

Joined: 2005-09-20
Posts: 8
Posted: Tue, 2005-09-20 16:59

I have migrated my photoalbums to G2 and everything seems to work just fine. There are only a couple of issues I need to resolve and need help with.

My album structure is as follows:

yyyy/yyyy-mm-dd_album_name/
yyyy/yyyy-mm-dd_album_name/1.jpg
yyyy/yyyy-mm-dd_album_name/2.jpg
yyyy/yyyy-mm-dd_album_name/orig/
yyyy/yyyy-mm-dd_album_name/orig/1.jpg
yyyy/yyyy-mm-dd_album_name/orig/2.jpg

Here are my questions:
1. Is there any way for me to tell G2 to make orig/ directory invisble to anyone except Site Admins? I need some batch processing here, as I have about 500 albums and I don't want to modify properties of each one manually.

2. Is there any way for me to tell G2 to use yyyy-mm-dd part of the path as album's creation date? Currently all albums show today's creation date and that's not what I'd like it to be. Again, I know how to change this manually, but I would really love to have some batch processing.

Any help is greatly appreciated.

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Tue, 2005-09-20 17:18

Check out galleryadd2.pl (Google is your friend), it can add photos via a perl script to an existing G2 install.

I'm sure someone else can help out with making a SQL statement you can directly in your db to set the permissions on the orig/ albums.

h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-09-20 17:25

1. you can remove view all version from the everybody group, then users won't see anything.

2. no, unless you write e.g. some code, e.g. modify modules/classes/SetOriginationTimestampTask.class and make it a) edit album items too and b) tinker with the $item->setCreationTimestamp() and $item->getName() or $item->getTitle()

 
tvset

Joined: 2005-09-20
Posts: 8
Posted: Tue, 2005-09-20 21:22

Hmm... looks complicated...

I am currently very close to solving the album name/creation date issue with a little bit of Perl. But the whole permission thing seems too complicated with access lists and stuff. I guess I'll have to do more digging into it...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-09-20 21:31

the G2 API is far easier than interacting with the database directly.

 
tvset

Joined: 2005-09-20
Posts: 8
Posted: Wed, 2005-09-21 17:26

Well, if you were one of those who wrote it, than maybe it is. :)
Anyway, I managed to do everything I wanted and it didn't take a lot of time. The script with a short description is linked from here:
http://mamchenkov.net/wordpress/2005/09/21/progress-with-the-gallery2/

Just in case someone else would want to follow this path. :)