Plugins for the Coppermine Photo Gallery are add-ons that use the plugin interface of Coppermine.
Read up the documentation that comes with Coppermine to find out more, e.g. how to install a plugin.

Coppermine version: cpg1.4.x
Plugin name: File2albummover
Plugin version: 0.1
Plugin author: M. van Gorkom (ge-flopt)
Plugin announcement thread: http://forum.coppermine-gallery.net/index.php/topic,22036.0.html



I wanted to place this in the plugin forum, but it stated i couldn't post there, that i had to post it in the corresponding support forum. Well this forum is the only one dedicated to 1.4, so i hope it has to go in this one.

I would like to present to you my piece of software (plugin) for the 1.4 version of Coppermine.
All the info is in the file but i'll give you a bit of info about what this plugin do:
It sorts images according to the album they are in.
So let's say a picture is in the album Green and the directory the image is placed in is called Blue. After running File2albummover the directory the file is in is Green. If the directory didn't exist it was created.

Please read the info.txt before you install the plugin!
The codebase.php is well documented, so if you want to modify stuff, it'll be easy.

Hope you have fun with it.

Name:        File2AlbumMover
Application: Coppermine 1.4B

My Name:     M. van Gorkom
Mail:        geflopt666@hotmail.com
-------------------------------------
What's it about:

When i started with coppermine the first thing i found a bit weird was that although Coppermine has a great
album facility, but the underlaying structure can be a mess. 

For example (a little scheme will do the trick):
                Album        Directory
Flower.jpg      Flowers      Flowers
Rose.jpg        Flowers      Trees
Oak.jpg         Trees        Flowers
deadtree.jpg    Trees        Trees

As you can see the albums don't correspond with the directories.
Well that's when File2AlbumMover comes in to place. It checks in which Album a picture it's in and then moves it 
to the directory with the same name. If that directory doen't exist, it creates it.

So after running File2AlbumMover the structure is as follows:
                Album        Directory
Flower.jpg      Flowers      Flowers
Rose.jpg        Flowers      Flowers
Oak.jpg         Trees        Trees
deadtree.jpg    Trees        Trees


What do you have to do:
- Unpack the files in a directory in the coppermine/plugin dir
- Modify the configuration.php and change $imagefolder variable. 
  At least it has to be / (/ stands for the first directory in the albums dir)
- Make sure you're logged in as admin
- Do not, i repeat do not install the plugin but start it as follows: /coppermine/index.php?file=f2am/codebase
  I'm still learning Coppermine and so installing will not be plesant.
  (f2am is the directory you put File2AlbumMover in)



Of course running this can be a bit tricky: 
- It's my first try at writing a plugin for Coppermine
- I'm not a crack at programming in PHP
- It's version 0.1(Soulfly)
So always make sure you backup your database and files!



Todo:
- Create a better log facility
- Better integration with Coppermine (Can anyone explain how to do this?!)
- Check before the files are deleted if they are really copied and/or the file is the same
- If the file has the same name, maybe change the filename and then move it


Hope to hear from you with updates, Bug reports or even angry letters that you've lost your complete album ;)

Maikel van Gorkom Aka Ge-Flopt
