Help with GalleryAlbums

jerryh

Joined: 2013-02-04
Posts: 27
Posted: Wed, 2013-02-06 22:12

I will prefix this with "I am new to Gallery2"

I am looking through the code and looking to traverse gallery albums programmatically. in using the application, I noticed the tree displayed at the top.
I've also looked at GalleryAlbumItem class.

Any help is greatly appreciated

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2013-02-06 22:33
Quote:
looking to traverse gallery albums programmatically

to what end? some type of external display?

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
jerryh

Joined: 2013-02-04
Posts: 27
Posted: Wed, 2013-02-06 23:25

No. Looking to traverse them with possibility of adding to them ( like a bulk upload). So if the album doesn't exist, I can add it.

Album 1
Album 11
Photo 100
Album 2
Albumn 21
Photo 200

If I upload a structure on to my server and we get a new Album (Album 3), I want to insert it

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2013-02-06 23:37

did you know gallery2 is very mature. we have this functionality already:
http://codex.galleryproject.org/Gallery2:Modules:archiveupload <- w/ this module you can zip up a whole directory structure and gallery will create new albums out of the the sub-directories.
http://codex.galleryproject.org/Gallery2:Modules:uploadify

No need to reinvent the wheel ;)

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
jerryh

Joined: 2013-02-04
Posts: 27
Posted: Wed, 2013-02-06 23:57

thanks. Will it also add the photos? I will take a look

 
jerryh

Joined: 2013-02-04
Posts: 27
Posted: Thu, 2013-02-07 00:02

So if I have activated this module in plugins area, where on the menu will it appear?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2013-02-07 00:07

here was an example I used recently http://testr.suprsidr.com/v/testr/
I uploaded fun.zip that had 3 sub-directories each with a few images.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2013-02-07 00:08

when active there will be a new tab in the itemAdd view.
IYou must first configure the path to your unzip binary in admin.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
jerryh

Joined: 2013-02-04
Posts: 27
Posted: Thu, 2013-02-07 00:35

OK. So I activated the module and setup the path to unzip binary.
Didn't see a new tab. There's a tab called "From Web Browser" which was already there.

I tried it and worked nicely.

Will start to look at code - For our application, we will need to update some custom fields when file is loaded.
With aLbums is there any difference to adding custom fields (and values) that with Item?
Yesterday you pointed me to

Quote:
create a CustomfieldOnUploadOption.inc to extend ItemAddOption
it would need to include methods handleRequestAfterAdd, loadTemplate and isAppropriate

Is there a difference for Albums?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2013-02-07 00:44
Quote:
Didn't see a new tab

That's right, I was thinking of something else, no tab... it just works.

Quote:
Is there a difference for Albums

I don't believe so, I don't really use custom fields.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
jerryh

Joined: 2013-02-04
Posts: 27
Posted: Thu, 2013-02-07 00:50

Ok..

I am going to dig into code. I have some other requirements to do along the way as uploading photos and albums.

thanks.. Great advice...