Developers corner > Developer Lobby

Separate dir for each gallery

(1/3) > >>

David Volenec:
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]

eoin:
Nice work David,

Would be nice to have a similar feature built into rsg2 as standard  ;)

David Volenec:

--- Quote from: David Volenec on December 30, 2007, 12:30:35 AM ---
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).


--- End quote ---

Actually I'm collecting an energy to make the similar changes to the latest build...

Martin:
David, that would actually be wonderful.
can the old code not be used again?

David Volenec:
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

Navigation

[0] Message Index

[#] Next page

Go to full version