Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
November 21, 2009, 01:26:30 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Private messages disabled
Caused by the massive abuse of the PM system in the past, the sending of personal messages has been disabled for all regular users on the Coppermine forum.
[more]
   Home   Help Search Board rules Login Register  
Pages: [1] 2 3   Go Down
  Send this topic  |  Print  
Author Topic: FileMove: managing the storage folder (albums)  (Read 17414 times)
0 Members and 1 Guest are viewing this topic.
François Keller Topic starter
Dev Team member
****
Gender: Male
France France

Posts: 7369


aka Frantz


WWW
« on: October 14, 2007, 09: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

* FileMove.zip (37.17 KB - downloaded 214 times.)
* FileMove1_1.zip (37.32 KB - downloaded 212 times.)
* FileMove1_2.zip (37.39 KB - downloaded 434 times.)
« Last Edit: July 21, 2008, 06: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
****
Gender: Male
Netherlands Netherlands

Posts: 2153


A, B, Cpg


WWW
« Reply #1 on: October 15, 2007, 12: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 Wink
Code:
$description='Choisir les fichiers à déplacer et modifier la base de donnée en fonction';
What might be the best English translation ?

* dutch.php.txt (2.43 KB - downloaded 180 times.)
« Last Edit: October 15, 2007, 12:39:25 pm by Hein » Logged

Hein Traag
Dev Team member
****
Gender: Male
Netherlands Netherlands

Posts: 2153


A, B, Cpg


WWW
« Reply #2 on: October 15, 2007, 12: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 Topic starter
Dev Team member
****
Gender: Male
France France

Posts: 7369


aka Frantz


WWW
« Reply #3 on: October 15, 2007, 12:47:16 pm »

Code:
$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:
$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, 01: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
****
Gender: Male
Netherlands Netherlands

Posts: 2153


A, B, Cpg


WWW
« Reply #4 on: October 15, 2007, 12:51:49 pm »

Isn't
Code:
$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 Topic starter
Dev Team member
****
Gender: Male
France France

Posts: 7369


aka Frantz


WWW
« Reply #5 on: October 15, 2007, 12:54:27 pm »

Isn't
Code:
$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
****
Gender: Male
Armenia Armenia

Posts: 3791


He's me, and She's Moon


WWW
« Reply #6 on: October 15, 2007, 01:24:21 pm »

Ola Frantz,

It's OK, it's again a very usefull Plugin  Grin K+1 Wink
It's not good idea to post this same K+1 inside our French Board  Cheesy

Good work, good plugin... Bravo.

PYAP
Logged

! Pas de PM please ! No PM s'il vous plait !
Sami
Dev Team member
****
Gender: Male
Iran, Islamic Republic of Iran, Islamic Republic of

Posts: 3689


BMossavari


WWW
« Reply #7 on: October 15, 2007, 02:03:56 pm »

Good work Frantz

Persian lang attached Wink

* persian.zip (1.3 KB - downloaded 186 times.)
Logged

‍I don't answer to PM with support question
Please post your issue to related board
François Keller Topic starter
Dev Team member
****
Gender: Male
France France

Posts: 7369


aka Frantz


WWW
« Reply #8 on: October 15, 2007, 02: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
****
Gender: Male
France France

Posts: 1319


aka "Lontano"


WWW
« Reply #9 on: October 15, 2007, 07: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?

* italian.php.zip (1.16 KB - downloaded 158 times.)
« Last Edit: October 20, 2007, 09:08:48 pm by Lontano » Logged

rubenix
Coppermine novice
*
Gender: Male
Posts: 40


WWW
« Reply #10 on: October 15, 2007, 08:18:05 pm »

nice plugin indeed  Shocked

Thanks a lot, was looking for something like that  Tongue

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'

* spanish.php.txt (2.42 KB - downloaded 180 times.)
« Last Edit: October 15, 2007, 08:25:55 pm by rubenix » Logged
François Keller Topic starter
Dev Team member
****
Gender: Male
France France

Posts: 7369


aka Frantz


WWW
« Reply #11 on: October 15, 2007, 08: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  Wink
@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
****
Gender: Male
France France

Posts: 1319


aka "Lontano"


WWW
« Reply #12 on: October 19, 2007, 08: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, 09:37:01 am by Lontano » Logged

François Keller Topic starter
Dev Team member
****
Gender: Male
France France

Posts: 7369


aka Frantz


WWW
« Reply #13 on: October 19, 2007, 09:21:18 am »

@lontano,

you have to modify file_move() function (plugins/FileMove/include/function.inc.php)
Code:
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:
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
****
Gender: Male
France France

Posts: 1319


aka "Lontano"


WWW
« Reply #14 on: October 19, 2007, 09:45:19 am »

Merci Frantz, but I now get a
Code:
Parse error: syntax error, unexpected '/' in /xxxx/include/function.inc.php on line 339
which correspond to this line
Code:
$Apath="./".$CONFIG['fullpath'].$ARep;
I've double-checked the code, but couldn't find anything...
« Last Edit: October 19, 2007, 10:07:08 am by Lontano » Logged

Davide Renda
Dev Team member
****
Gender: Male
France France

Posts: 1319


aka "Lontano"


WWW
« Reply #15 on: October 19, 2007, 10:18:11 am »

Got rid of the error changing code in functions.ici.php as it follows
Code:
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 Wink
Logged

François Keller Topic starter
Dev Team member
****
Gender: Male
France France

Posts: 7369


aka Frantz


WWW
« Reply #16 on: October 19, 2007, 10: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
****
Gender: Male
Netherlands Netherlands

Posts: 2153


A, B, Cpg


WWW
« Reply #17 on: October 19, 2007, 10: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 Topic starter
Dev Team member
****
Gender: Male
France France

Posts: 7369


aka Frantz


WWW
« Reply #18 on: October 19, 2007, 10: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
****
Gender: Male
Posts: 5622



« Reply #19 on: October 19, 2007, 11:39:42 am »

haven't tested this...
Code:
//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 Wink

in the plugins function.inc.php right after
Code:
copy($DFile_Normal,$AFile_Normal);
add
« Last Edit: October 19, 2007, 01:16:51 pm by Stramm » Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
Pages: [1] 2 3   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.127 seconds with 17 queries.