RSGallery2 Forum Portal

Developers corner => Developer Lobby => Topic started by: David Volenec on December 30, 2007, 12:30:35 AM

Title: Separate dir for each gallery
Post by: David Volenec on December 30, 2007, 12:30:35 AM
Hi there,

I've slightly changed the code of the RSG2 to fullfill my ideas of storing images...
Originaly the RSG2 stores all the images to one global folder ... But this was a problem for me.

So I changed the code to bring me extra functionality - images are stored into separate folder structure for each gallery.
This is extremely helpful in case:
- you want to upload images taking no care of the filenames (as duplicities of the filenames are solved in a strange manner sometimes)
- you wish to use one of the nice plugins generating slideshows of images stored in the specified folder
- you want the images to be more logicaly stored

If you wish to bring this change to the life in your own installation of RSG2 feel free to use the attached code (prepared for RSGallery2 1.12.2 Alpha).

All you need to know:
- copy the content of the ZIP directly to your Joomla Root and submit overwrites (I recommend to backup the files previously)
- original code working with image files were transformed to accept new storage logic (excluding ZOOM -> RSG MIGRATION and DBCONSOLIDATION) which was extremly complicated for me  ;D
- the change of storage logic is as shown in example:

Lets have the RSG2 configured this way
pathImg_original: images/stories/rsgallery/original
pathImg_display: images/stories/rsgallery/display
pathImg_thumb: images/stories/rsgallery/thumb

When uploading file image.jpg into gallery "myphotos" of the internal ID = 5

The result would be....

Original version:
images/stories/rsgallery/original/image.jpg
images/stories/rsgallery/display/image.jpg
images/stories/rsgallery/thumb/image.jpg

My version:
images/stories/rsgallery/5/original/image.jpg
images/stories/rsgallery/5/display/image.jpg
images/stories/rsgallery/5/thumb/image.jpg

Simple, isn't it? Hope this could help you. Enjoy...

David



[attachment no longer available]
Title: Re: Separate dir for each gallery
Post by: eoin on December 30, 2007, 07:53:29 PM
Nice work David,

Would be nice to have a similar feature built into rsg2 as standard  ;)
Title: Re: Separate dir for each gallery
Post by: David Volenec on December 31, 2007, 01:13:38 PM

If you wish to bring this change to the life in your own installation of RSG2 feel free to use the attached code (prepared for RSGallery2 1.12.2 Alpha).


Actually I'm collecting an energy to make the similar changes to the latest build...
Title: Re: Separate dir for each gallery
Post by: Martin on January 01, 2008, 11:51:06 AM
David, that would actually be wonderful.
can the old code not be used again?
Title: Re: Separate dir for each gallery
Post by: David Volenec on January 02, 2008, 12:12:40 PM
Hi there,

actually I'm solving some bugs

#001: original images are stored though the configuration is set not to store them

As I haven't compared 1.12.2 version of code with newer versions of RSG2, I don't recommend to use my patch in other versions. But feel free to try and report here  ;)

David
Title: Re: Separate dir for each gallery
Post by: Ronald Smit on January 03, 2008, 01:41:40 PM
Guys,

This is a usefull topic for our users, but it has gone beyond bugs or additional features, soI am moving this thread to the Developers Lobby.
Good luck!

Cheers,
Title: Re: Separate dir for each gallery
Post by: David Volenec on January 08, 2008, 12:25:17 AM
Hi there,

I've repaired both known issues:

#001 (REPAIRED): original images are stored though the configuration is set not to store them
#002 (REPAIRED): the display image is not shown when the watermark is enabled

You can download new version below.

David

[attachment no longer available]
Title: Re: Separate dir for each gallery
Post by: Martin on January 10, 2008, 09:04:49 PM
this doesn't work with the nightly build... it just crashes the components.
Title: Re: Separate dir for each gallery
Post by: David Volenec on January 11, 2008, 10:52:51 AM
this doesn't work with the nightly build... it just crashes the components.

As mentioned above: this PATCH was developed under the 1.12.2 version of RSG2 and wasn't tested on any other version neither nightly build.
In addition the PATCH usually means radical changes to the code  ;)

I'm actually not able to prepare an appropriate patch for every version/build of RSG2 - you surely understand.

David
Title: Re: Separate dir for each gallery
Post by: Martin on January 11, 2008, 07:03:56 PM
Hi David.

of course..

perhaps you could strip down to the necessities, the basics of the code, and share it with the developers so they can implement it in the next build. Everything speaks for having pics in seperate dirs, so they should be willing to add it!

thanks for your effort in this!
Title: Re: Separate dir for each gallery
Post by: Jonah on January 23, 2008, 02:25:53 AM
Thanks for posting your patches David.  If you are interested in joining the dev team and working on the current releases send me a PM.  There has been a lot of talk about separate directories for galleries and it will probably be implemented as an option.
Title: Re: Separate dir for each gallery
Post by: john on January 23, 2008, 09:10:08 AM
BTW there have been implemented some helper function in the gallery and items class to aid in the requested functionallity.

The only thing remaining to do is use those functions in the rest of the component :-)

john
Title: Re: Separate dir for each gallery
Post by: xlerator on July 26, 2008, 11:04:14 PM
hey! are there any news with the development of folder structures?
Title: Re: Separate dir for each gallery
Post by: Chef Groovy on August 10, 2008, 06:12:27 PM
It is on the list for the legacy version.  At least minimally, I need it for selfish reasons :)
 
Title: Re: Separate dir for each gallery
Post by: Steve on October 13, 2008, 04:36:11 PM
Any updates here? From purely a backup standpoint, this would be incredibly useful! I ran into a situation where I had to reinstall Joomla!, RSGallery2, and such but still had all of my pictures on my server. The problem, however was that I had no idea what pictures went with which gallery because they were all in one directory! I deleted all of the pictures (I have them backed up offline), and don't want to upload again until I have found a way to implement the multiple directory style gallery.