forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: François Keller on October 14, 2007, 10:08:35 pm

Title: FileMove: managing the storage folder (albums)
Post by: François Keller on October 14, 2007, 10:08:35 pm
FileMove V 1.2

Hi all,

here is a new plugin inspired by Sanlogik who had a problem with the organisation from his albums folder
What will this plugin do ?
This plugin allow you to reorder the folder where are all your pictures (generally the album folder)
You have two options:
   *tranfer the whole content from a folder to another
   *transfer only some files from a folder to another
The files are transfered (normal, thumbnails, intermediars) and the database is updated
Caution this plugin doesn't create new folders. If you will have new folders into your album foldern you must create them by FTP.
It will have no changes in your albums, This is only managed the storage folder.
Install
* Unpack the archive and upload the "FileMove" directory structure to your Coppermine gallery's plugins folder.
* Login as an admin, go to config, then "Manage Plugins"
* Find the "FileMove" entry in the available plugins and click install.
* A new menu button is now added in the admin menu.
langage
Plugin also avaible in English and French.
*dutch.php lang file added (thank's Hein)
*persion.php lang file added (thank's Sami)
*italian.php lang file added (thank's Lontano)
*spanish.php lang file addes (thank's Rubenix)
Feel free to translate the lang/english.php language file to your own language.
Version 1.1
*Adding compatibility with Stramms Modpack (Thank's Stramm for your code)
Version 1.2
*Natural alphabetic sorting from the folder list
Known issues
* the plugin seems not workin with Internet Explorer
Title: Re: FileMove: managing the storage folder (albums)
Post by: Hein Traag on October 15, 2007, 01:25:59 pm
Translated into Dutch. Added as dutch.php.txt (no means of zipping).

Going to give this one a go on my test. Thanks Frantz!

** Configuration has the description in French ;)
Code: [Select]
$description='Choisir les fichiers à déplacer et modifier la base de donnée en fonction';What might be the best English translation ?
Title: Re: FileMove: managing the storage folder (albums)
Post by: Hein Traag on October 15, 2007, 01:40:23 pm
Just tried it and it worked perfectly. Moved a folder and moved 1 file. It does the trick without errors.
Update dutch.php.txt a bit.
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on October 15, 2007, 01:47:16 pm
Code: [Select]
$description='Choisir les fichiers à déplacer et modifier la base de donnée en fonction';ooopss! forgotten it was in french sorry.
translation could be:
Code: [Select]
$description='Choose files to move and modify the database according';thank's Hein for report and for dutch translation
both will be added soon in the pack(done)
Title: Re: FileMove: managing the storage folder (albums)
Post by: Hein Traag on October 15, 2007, 01:51:49 pm
Isn't
Code: [Select]
$description='Choose files or a folder to move and modify the database according'; a better description as this plugin also allows folders to be moved around ?
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on October 15, 2007, 01:54:27 pm
Isn't
Code: [Select]
$description='Choose files or a folder to move and modify the database according'; a better description as this plugin also allows folders to be moved around ?
yes your right
Title: Re: FileMove: managing the storage folder (albums)
Post by: Pascal YAP on October 15, 2007, 02:24:21 pm
Ola Frantz,

It's OK, it's again a very usefull Plugin  ;D K+1 ;)
It's not good idea to post this same K+1 inside our French Board  :D

Good work, good plugin... Bravo.

PYAP
Title: Re: FileMove: managing the storage folder (albums)
Post by: Sami on October 15, 2007, 03:03:56 pm
Good work Frantz

Persian lang attached ;)
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on October 15, 2007, 03:17:28 pm
thank's Sami
your lang file will be added ASP ti the pack
Title: Re: FileMove: managing the storage folder (albums)
Post by: Davide Renda on October 15, 2007, 08:47:42 pm
Italian translation attached, just unzip inside the /lang directory.
Great job Frantz, I wander if would this plugin be worth in being added to the core of next Coppermine release?
Title: Re: FileMove: managing the storage folder (albums)
Post by: rubenix on October 15, 2007, 09:18:05 pm
nice plugin indeed  :o

Thanks a lot, was looking for something like that  :P

attached my little contribution!!

EDIT--> by the way I don't know if I can post the spanish translation as I'm not a 'frequent contributor'
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on October 15, 2007, 09:33:18 pm
@Lontano
Thank's for your translation
Quote
I wander if would this plugin be worth in being added to the core of next Coppermine release?
Not on the moment, the plugin is to new for this  ;)
@rubenix
Thank's too for your translation
Quote
EDIT--> by the way I don't know if I can post the spanish translation as I'm not a 'frequent contributor'
not a problem, we are looking for all contributions.

@both, your contribution will be added in the pack.
Title: Re: FileMove: managing the storage folder (albums)
Post by: Davide Renda on October 19, 2007, 09:56:04 am
Users of Stramm's Modpack please be aware this plugin moves all files according to standard Coppermine prefix: normal_, thumb_ and original file; Modpack also create mini_ and orig_ and these ones won't be moved instead.

Frantz, is there a way to include also these files for Modpack's users? A kind of quick hack to make it work?
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on October 19, 2007, 10:21:18 am
@lontano,

you have to modify file_move() function (plugins/FileMove/include/function.inc.php)
Code: [Select]
function file_move($file_name,$DRep,$ARep)
{
global $CONFIG;
//Fichiers de départ
$Dpath="./".$CONFIG['fullpath'].$DRep;
$DFile=$Dpath.$file_name;
$DFile_Thumb=$Dpath.$CONFIG['thumb_pfx'].$file_name;
$DFile_Normal=$Dpath.$CONFIG['normal_pfx'].$file_name;
//Fichiers d'arrivée
$Apath="./".$CONFIG['fullpath'].$ARep;
$AFile=$Apath.$file_name;
$AFile_Thumb=$Apath.$CONFIG['thumb_pfx'].$file_name;
$AFile_Normal=$Apath.$CONFIG['normal_pfx'].$file_name;
//copie des fichiers,
copy($DFile,$AFile);
copy($DFile_Thumb,$AFile_Thumb);
copy($DFile_Normal,$AFile_Normal);
//effacement des fichiers d'origine
unlink($DFile);
unlink($DFile_Thumb);
unlink($DFile_Normal);
}
by adding the mini_ and orig_ prefix (i don't know if te préfix are stored in the database and can be other that mni_ and orig_)
code can be:
Code: [Select]
function file_move($file_name,$DRep,$ARep)
{
global $CONFIG;
//Fichiers de départ
$Dpath="./".$CONFIG['fullpath'].$DRep;
$DFile=$Dpath.$file_name;
$DFile_Thumb=$Dpath.$CONFIG['thumb_pfx'].$file_name;
$DFile_Normal=$Dpath.$CONFIG['normal_pfx'].$file_name;
        $DFile_mini=$Dpath."mini_".$filename;//for Stramm modpack
        $DFile_orig=$Dpath."orig_'.$filename;//for Stramm modpack
//Fichiers d'arrivée
$Apath="./".$CONFIG['fullpath'].$ARep;
$AFile=$Apath.$file_name;
$AFile_Thumb=$Apath.$CONFIG['thumb_pfx'].$file_name;
$AFile_Normal=$Apath.$CONFIG['normal_pfx'].$file_name;
        $AFile_mini=$Apath."mini_".$filename;//for Stramm modpack
        $AFile_orig=$Apath."orig_".$filename;//for Stramm modpack
//copie des fichiers,
copy($DFile,$AFile);
copy($DFile_Thumb,$AFile_Thumb);
copy($DFile_Normal,$AFile_Normal);
        copy($DFile_mini,$AFile_mini);//for Stramm modpack
        copy($DFile_orig,$AFile_orig);//for Stramm modpack
//effacement des fichiers d'origine
unlink($DFile);
unlink($DFile_Thumb);
unlink($DFile_Normal);
        unlink($DFile_mini);//for Stramm modpack
        unlink($DFile_orig);//for Stramm modpack
}
for the "normal users"; comment the lines for the stramm modpack
Title: Re: FileMove: managing the storage folder (albums)
Post by: Davide Renda on October 19, 2007, 10:45:19 am
Merci Frantz, but I now get a
Code: [Select]
Parse error: syntax error, unexpected '/' in /xxxx/include/function.inc.php on line 339which correspond to this line
Code: [Select]
$Apath="./".$CONFIG['fullpath'].$ARep;I've double-checked the code, but couldn't find anything...
Title: Re: FileMove: managing the storage folder (albums)
Post by: Davide Renda on October 19, 2007, 11:18:11 am
Got rid of the error changing code in functions.ici.php as it follows
Code: [Select]
function file_move($file_name,$DRep,$ARep)
{
global $CONFIG;
//Fichiers de d�part
$Dpath="./".$CONFIG['fullpath'].$DRep;
$DFile=$Dpath.$file_name;
$DFile_Thumb=$Dpath.$CONFIG['thumb_pfx'].$file_name;
$DFile_Normal=$Dpath.$CONFIG['normal_pfx'].$file_name;
        $DFile_Mini=$Dpath.$CONFIG['mini_pfx'].$file_name;//for Stramm modpack
        //Fichiers d'arriv�e
$Apath="./".$CONFIG['fullpath'].$ARep;
$AFile=$Apath.$file_name;
$AFile_Thumb=$Apath.$CONFIG['thumb_pfx'].$file_name;
$AFile_Normal=$Apath.$CONFIG['normal_pfx'].$file_name;
        $AFile_Mini=$Apath.$CONFIG['mini_pfx'].$file_name;//for Stramm modpack
        //copie des fichiers,
copy($DFile,$AFile);
copy($DFile_Thumb,$AFile_Thumb);
copy($DFile_Normal,$AFile_Normal);
        copy($DFile_Mini,$AFile_Mini);//for Stramm modpack
        //effacement des fichiers d'origine
unlink($DFile);
unlink($DFile_Thumb);
unlink($DFile_Normal);
        unlink($DFile_Mini);//for Stramm modpack
}

And it works!
Thanks for having pointed me toward the good direction ;)
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on October 19, 2007, 11:22:55 am
thank's Lontano for reporting. I will add this modif in the pack with explanations for the modpack users ASP
Title: Re: FileMove: managing the storage folder (albums)
Post by: Hein Traag on October 19, 2007, 11:31:07 am
Frantz, instead of telling Modpack users what to change in order to include the mini_ and orig_ prefixes is it maybe possible to add a kind of filter to your original code so it wil include mini_ and orig_ files if they are there ?
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on October 19, 2007, 11:57:48 am
@Hein,

your right, i'll see how to make the change (i must have a look to the modpack before)
Title: Re: FileMove: managing the storage folder (albums)
Post by: Stramm on October 19, 2007, 12:39:42 pm
haven't tested this...
Code: [Select]
//modpack compatibility
if(isset($CONFIG['mini_pfx'])) {
$DFile_Mini=$Dpath.$CONFIG['mini_pfx'].$file_name;
$DFile_Orig=$Dpath.$CONFIG['orig_pfx'].$file_name;
$AFile_Mini=$Apath.$CONFIG['mini_pfx'].$file_name;
$AFile_Orig=$Apath.$CONFIG['orig_pfx'].$file_name;
if(file_exists($DFile_Mini)){
if(copy($DFile_Mini,$AFile_Mini)) {
unlink($DFile_Mini);
}
}
if(file_exists($DFile_Orig)){
if(copy($DFile_Orig,$AFile_Orig)) {
unlink($DFile_Orig);
}
}
}

edit: I should have said where to add this ;)

in the plugins function.inc.php right after
Code: [Select]
copy($DFile_Normal,$AFile_Normal);
add
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on October 19, 2007, 01:07:02 pm
Thank's Stramm, will ask Lontano for testing
new 1.1 version including Stramm's code for compatibility with the Modpack code attached in the very first post
Title: Re: FileMove: managing the storage folder (albums)
Post by: Davide Renda on October 20, 2007, 10:08:21 pm
Just realised I did a couple of errors in translating... correct lang file has been replaced on my previous post. Sorry!
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on October 21, 2007, 09:29:05 am
Lontano,
i'll replace italian lang file in the pack
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on April 05, 2008, 01:18:36 pm
New version attached on the very first post of this thread:
Folder list is now sorted alphabeticly
Title: Re: FileMove: managing the storage folder (albums)
Post by: MechMykl on April 17, 2008, 03:56:53 am
Am I missing something? I installed the plugin and it seems to be working, but when I click the folder I can't do anything after that... none of the buttons (all, some, back) do anything??
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on April 17, 2008, 07:22:37 am
can you attach screenshots after clicking the folder ?
Title: Re: FileMove: managing the storage folder (albums)
Post by: MechMykl on April 17, 2008, 12:58:46 pm
http://www.stuff.hqubed.com/uploads/copperminemoveallbuttonclick.JPG
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on April 17, 2008, 01:30:14 pm
and what happend when you click on the move some files button ?
Title: Re: FileMove: managing the storage folder (albums)
Post by: MechMykl on April 18, 2008, 02:24:42 am
Nothing... that's what perplexes me... no usual sound, no loading... nothing (for any of them.)
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on April 18, 2008, 07:37:18 am
try to reupload all the plugin files
Title: Re: FileMove: managing the storage folder (albums)
Post by: MechMykl on April 19, 2008, 01:27:47 am
Hahaha wow.
Well, as it turns out... this plugin (for me, at least?) only works in FIREFOX.
I tried all three versions of this plugin in IE 7 but it simply didn't work... so I loaded up Firefox portable and it worked fine, how silly.

Thank you for such a GREAT plugin, I like to keep my folders clean and this will certainly do the trick!!
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on April 19, 2008, 07:50:10 am
Quote
Well, as it turns out... this plugin (for me, at least?) only works in FIREFOX.
humm, i'll test this (not tested before)
thank's for this report
Title: Re: FileMove: managing the storage folder (albums)
Post by: stardust on July 21, 2008, 05:43:44 am
This only works in Firefox for me too.

I love this plugin though! I started using "Batch Add" after uploading 8000+ images with the simple "Upload File" feature on coppermine ::) So this plugin helps me organize those 8000+ images from /userpics/ in different folders under /albums/ better. And I can organize those folders under /albums/ better ;D Thank you!!
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on July 21, 2008, 07:20:27 am
Tested on IE and actually work not  :-\
I 'll have a look to find out what goes wrong
Title: Re: FileMove: managing the storage folder (albums)
Post by: nointerest on August 05, 2008, 02:20:31 am
Hi Fancois,

I am translating the Plug-In into German. I am not sure about the meaning of these parts:

Select the folder you will move

Choice of the operation

in to

I understand the words - but not really what they mean, the context. I need that understanding however in order to choose the right words - otherwise it could end up more confusing than helping.
I am not running the plugin myself, therefore I am asking you here now. I hope that is ok.
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on August 05, 2008, 08:14:54 am
Hi,

Quote
Select the folder you will move
will mean, in case you will move an entire directory (with all his content), to select this directory folder
Quote
Choice of the operation
English sentence surely not good (but it's not my mother language): it will mean what will you do
Quote
in to
exemple: the yourselectedfile.jpg will be moved into the selectedfolder
hope it's clear anougth  ;)
Title: Re: FileMove: managing the storage folder (albums)
Post by: nointerest on August 05, 2008, 10:51:12 pm
Thanks, that was what I needed.

I add the translation to this post.
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on August 06, 2008, 07:28:25 am
thank's, your contribution will be added in the pack ASP
Title: Re: FileMove: managing the storage folder (albums)
Post by: mearnscc on June 01, 2009, 02:55:21 am
Tested on IE and actually work not  :-\
I 'll have a look to find out what goes wrong

Hi, inexperienced user here, I have uploaded this and get to the same stage as above, i.e it does not work in ie(8)?

Has this moved on since the last post?

Brian.
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on June 01, 2009, 08:52:06 am
no, actual, the plugin doesn't work as expected with IE
Title: Re: FileMove: managing the storage folder (albums)
Post by: mearnscc on June 01, 2009, 09:48:25 am
no, actual, the plugin doesn't work as expected with IE

Many thanks Francois for the prompt response. I take it if I download Firefox it will work with that. I need a facility on Coppermine that let's me manage image locations for a Camera Club in order that they can be downloaded easily over FTP.

Many thanks in advance.
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on June 01, 2009, 10:50:32 am
it's on my todo list to see why it doesn't work with IE but for the cpg1.5 plugin
Title: Re: FileMove: managing the storage folder (albums)
Post by: mearnscc on June 01, 2009, 03:33:28 pm
it's on my todo list to see why it doesn't work with IE but for the cpg1.5 plugin

OK Francois, I appreciate you are busy! For your info, as you could gather I dont use Firefox however I do use Google Chrome and it does appear to work on that. However I am not sure its doing what I envisaged it to. Via FTP I created a new folder in the Userpics Folder called "Open 1". I then went into the plugin and selected "move some files", selected my files and then I was given the option of the "Open 1" Folder to put them in via a little Directory Tree with Userpics at the top of it. I click to confirm and everything seems to go through ok.

However when I go into "Open 1" via ftp there is nothing there? In the Userpics directory, all traces of my image have dissapeared, image, normal_image and thumb_image have all dissapeared so they have moved somewhere?

Thanks again

Brian.

Any ideas?
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on June 01, 2009, 04:00:49 pm
and with no space in the folder name ?
Title: Re: FileMove: managing the storage folder (albums)
Post by: mearnscc on June 01, 2009, 04:14:01 pm
and with no space in the folder name ?

Francois I did have a space in the Folder Name Open 1 however I have changed it to Open1 and I have moved 2 files to it and whilst they have dissapeared out of the Userpics Folder they have not appeared in the Open1 Folder? I hope I am not being stupid here!

Thanks again.
Title: Re: FileMove: managing the storage folder (albums)
Post by: mearnscc on June 01, 2009, 04:45:30 pm
Francois I did have a space in the Folder Name Open 1 however I have changed it to Open1 and I have moved 2 files to it and whilst they have dissapeared out of the Userpics Folder they have not appeared in the Open1 Folder? I hope I am not being stupid here!

Thanks again.

Francois can I just add that now when I upload an image (I ran out of images to move) everything goes fine, select image, upload, place in album etc. When I view the Album and click the image to get large size, I get;

"Critical Error"
"There was an error while processing a database query"

Does this suggest the root problem is with the database?


I apologise for the psots and I know you are busy, I just hope my feedback is giving some direction.

Brian.
Brian. 
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on June 01, 2009, 05:36:11 pm
normally the plugin doesn't interfer with the upload process. The only thing is perhaps you have a permission problem with the folders.
But at least the upload problem should not have to deal with the plugin
Title: Re: FileMove: managing the storage folder (albums)
Post by: mearnscc on June 01, 2009, 09:30:23 pm
normally the plugin doesn't interfer with the upload process. The only thing is perhaps you have a permission problem with the folders.
But at least the upload problem should not have to deal with the plugin

Thanks Francois, just seems a bit coincidental? Any thoughts on my previous post on where the images are being moved to? I have searched for them and no joy.

Brian.
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on June 01, 2009, 10:22:16 pm
I think they have been erased from the server  :-\
Title: Re: FileMove: managing the storage folder (albums)
Post by: mearnscc on June 02, 2009, 12:38:45 am
I think you are correct I'll set up another folder with a different name from one of the Albums and see how that goes?
Title: Re: FileMove: managing the storage folder (albums)
Post by: mearnscc on June 03, 2009, 11:05:18 pm
Francois,

I tried this again with another album created within the userpics folder (no spaces) and used the plugin to move files. It moves the files but to where only God knows! Not sure if its a problem with my set up which I assume is the same as most people or its the Plugin.

If you have not lost the will to live then I'll take any advice.

Brian.
Title: Re: FileMove: managing the storage folder (albums)
Post by: François Keller on June 04, 2009, 07:18:25 am
i'll test on mys test install this evening to see if i have the same problem (it's the first time i hear such an issue, this plugin was made for a user, and it seems to works as expected for him)
Title: Re: FileMove: managing the storage folder (albums)
Post by: Davide Renda on June 08, 2009, 09:50:00 pm
I've been massively using this plugin to re-arrange all files in my gallery (being online since 2004 it was a real mess!) and never had such issues noticed by mearnscc.
I've also successfully moved files uploaded via XP_Publish, getting rid of all those WPWnnnnnnnn directories spread within the album folder.

Quote
I tried this again with another album created within the userpics folder
userpics folder shouldn't be used for FTP uploads, but only for users direct upload (via the Coppermine upload feature) for registered users, I would think the conflict with the plugin lies within this point.
Title: Re: FileMove: managing the storage folder (albums)
Post by: idotal on January 23, 2011, 11:03:04 am
if i want to transfer directory that inside her there is directories with files, it's say that the there is no photos in the directory.
for example -
in albums folder
somedirectory
photos
   try1(9 photos)
   try2(33 photos)

and i want to move the photos directory with all the directories and files inside her to the directory album/somedirectory

how can i do that?
because when i choose the photos album and try to transfer her to the somedirectory folder, it say that there are no photos in the photos album, and it not transfer it.
Title: Re: FileMove: managing the storage folder (albums)
Post by: Russ_ on March 02, 2017, 09:04:59 am
Does this plug-in still work with latest version?
I've installed it and then click: Information>FileMove, I get this error:
Fatal error: Cannot redeclare cpgGetMicroTime() (previously declared in /home/chainsaw/public_html/gallery/include/init.inc.php:25) in /home/chainsaw/public_html/gallery/include/init.inc.php on line 27

If not, is there any other way of moving  the folders that some photos are in, on my server? I've had a careful look through my PHPMyAdmin, but really have no idea what I'm doing.
Title: Re: FileMove: managing the storage folder (albums)
Post by: Russ_ on March 02, 2017, 09:11:45 am
Doesn't matter found the 1.5 version. Not sure why my first search failed. Thanks.