Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2 3   Go Down

Author Topic: FileMove: managing the storage folder (albums)  (Read 105989 times)

0 Members and 1 Guest are viewing this topic.

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
FileMove: managing the storage folder (albums)
« 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
« Last Edit: July 21, 2008, 07:21:29 am by François Keller »
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: FileMove: managing the storage folder (albums)
« Reply #1 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 ?
« Last Edit: October 15, 2007, 01:39:25 pm by Hein »
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: FileMove: managing the storage folder (albums)
« Reply #2 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.
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: FileMove: managing the storage folder (albums)
« Reply #3 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)
« Last Edit: October 15, 2007, 02:08:23 pm by Frantz »
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: FileMove: managing the storage folder (albums)
« Reply #4 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 ?
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: FileMove: managing the storage folder (albums)
« Reply #5 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
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: FileMove: managing the storage folder (albums)
« Reply #6 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
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: FileMove: managing the storage folder (albums)
« Reply #7 on: October 15, 2007, 03:03:56 pm »

Good work Frantz

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

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: FileMove: managing the storage folder (albums)
« Reply #8 on: October 15, 2007, 03:17:28 pm »

thank's Sami
your lang file will be added ASP ti the pack
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: FileMove: managing the storage folder (albums)
« Reply #9 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?
« Last Edit: October 20, 2007, 10:08:48 pm by Lontano »
Logged

rubenix

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 43
    • Rubrenix Gallery
Re: FileMove: managing the storage folder (albums)
« Reply #10 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'
« Last Edit: October 15, 2007, 09:25:55 pm by rubenix »
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: FileMove: managing the storage folder (albums)
« Reply #11 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.
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: FileMove: managing the storage folder (albums)
« Reply #12 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?
« Last Edit: October 19, 2007, 10:37:01 am by Lontano »
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: FileMove: managing the storage folder (albums)
« Reply #13 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
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: FileMove: managing the storage folder (albums)
« Reply #14 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...
« Last Edit: October 19, 2007, 11:07:08 am by Lontano »
Logged

Davide Renda

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: FileMove: managing the storage folder (albums)
« Reply #15 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 ;)

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: FileMove: managing the storage folder (albums)
« Reply #16 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
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: FileMove: managing the storage folder (albums)
« Reply #17 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 ?
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: FileMove: managing the storage folder (albums)
« Reply #18 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)
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: FileMove: managing the storage folder (albums)
« Reply #19 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
« Last Edit: October 19, 2007, 02:16:51 pm by Stramm »
Logged
Pages: [1] 2 3   Go Up
 

Page created in 0.025 seconds with 20 queries.