FileMove: managing the storage folder (albums) FileMove: managing the storage folder (albums)
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

FileMove: managing the storage folder (albums)

Started by François Keller, October 14, 2007, 10:08:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

François Keller

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
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Hein Traag

#1
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 ;)
$description='Choisir les fichiers à déplacer et modifier la base de donnée en fonction';
What might be the best English translation ?

Hein Traag

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.

François Keller

#3
$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:
$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)
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Hein Traag

Isn't $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 ?

François Keller

Quote from: Hein on October 15, 2007, 01:51:49 PM
Isn't $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
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Pascal YAP

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

Sami

Good work Frantz

Persian lang attached ;)
‍I don't answer to PM with support question
Please post your issue to related board

François Keller

thank's Sami
your lang file will be added ASP ti the pack
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Davide Renda

#9
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?

rubenix

#10
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'

François Keller

@Lontano
Thank's for your translation
QuoteI 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
QuoteEDIT--> 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.
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Davide Renda

#12
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?

François Keller

@lontano,

you have to modify file_move() function (plugins/FileMove/include/function.inc.php)
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:
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
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Davide Renda

#14
Merci Frantz, but I now get a
Parse error: syntax error, unexpected '/' in /xxxx/include/function.inc.php on line 339
which correspond to this line
$Apath="./".$CONFIG['fullpath'].$ARep;
I've double-checked the code, but couldn't find anything...

Davide Renda

Got rid of the error changing code in functions.ici.php as it follows

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 ;)

François Keller

thank's Lontano for reporting. I will add this modif in the pack with explanations for the modpack users ASP
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Hein Traag

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 ?

François Keller

@Hein,

your right, i'll see how to make the change (i must have a look to the modpack before)
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Stramm

#19
haven't tested this...
//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
copy($DFile_Normal,$AFile_Normal);

add