FileMove Plugin (managing the storage folder) for cpg1.5x FileMove Plugin (managing the storage folder) for cpg1.5x
 

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 Plugin (managing the storage folder) for cpg1.5x

Started by Αndré, October 21, 2010, 10:48:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Αndré

This is a port of the cpg1.4.x plugin FileMove.

Quote from: François Keller on October 14, 2007, 10:08:35 PM
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:
   *transfer the whole content from a folder to another
   *transfer only some files from a folder to another
The files are transfered (normal, thumbnails, intermediate) and the database is updated
Caution this plugin doesn't create new folders. If you will have new folders into your album folder you must create them by FTP.
It will have no changes in your albums, it only manages 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.

Known issues
* the plugin seems not workin with Internet Explorer

v1.2
Improvement of the plugin:
*Changing plugin icon
*changing place of the menu item
*Internationalisation of the  configuration.php file
Caution, they are some lang strings to translate in the German, spanish, Italian, Dutsch and Persian lang file

Caution: this is just a 'quick & dirty port'. It means that the plugin doesn't use the additional security features of Inspekt, as I used everywhere the getRaw function. Furthermore I didn't checked the code for possible improvements. I just recognized that the plugin seems to update the database without checking if the selected files/folder were really moved. Use this plugin at your own risk!

François Keller

Thank's ANdré for this port. It was on my todo list but i'm to bussy on the moment.
If i find a moment i'll look for improvement of this plugin (e.g; using jquery to have a drag an drop feature to move the files, but it's anothe story)
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

amadeus


Αndré

What news do you expect? The plugin has been ported and does its job.

nasiri

is it just me or if i move a folder i want to move to folder itself too, but it just moves every file of one folder to the destination folder ...

i would like to move the folder itself because i got categorized by date like : Year/MONTH/Day/_folderitself

so any suggestions ? is it possible with this plugin prt ?

thx for info
Nasiri Media
Web Development in Münster / Germany

http://www.nasiri.com

Αndré

Why don't you just create the new folder and move the files to that folder?

nasiri

there must be a way to create the same folder name before you move the files from the old folder ... otherwise everytime you want to use the filemover you have to create a bunch of folders before ... doesn't make sense at all, just have the problem right now.

problem is ... :

client wants to upload files per ftp on any folder to use its smartphone for mass import. physical folder LIVE subfolder Album Name ....

the rest of the gallery is sorted in categories and subcategories ... after some days he needs to move the bunch of folders at their respected places. he needs the filemover permanantly ...

this plugin should really be invested more time from us all i realize. what is a database also the physical one which are used for image url if you cannot move whole directories at the same time.

good night
Nasiri Media
Web Development in Münster / Germany

http://www.nasiri.com

Αndré

Well, I just ported that plugin. As it's called FileMove and not FolderMove it maybe wasn't created to move folders, but files ::) But it should be very easy to create a plugin (or modify this one) that moves whole folders, as you need to check fewer things.

nasiri

:D i see now .. no offense ... thx for the plugin anyway. thought there're maybe more people who facing this problem.

;)
Nasiri Media
Web Development in Münster / Germany

http://www.nasiri.com

François Keller

Little improvements in the v1.2 attached on the very first post
Changing the plugin icon
New place for the menu item
Internationlisation of the configuration.php file
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

Αndré

The plugin doesn't move the watermark backup files orig_filename.jpg. Possible fix, change
    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);
            }
        }
    }

to
    $DFile_Orig=$Dpath.$CONFIG['orig_pfx'].$file_name;
    $AFile_Orig=$Apath.$CONFIG['orig_pfx'].$file_name;
    if(file_exists($DFile_Orig)){
        if(copy($DFile_Orig,$AFile_Orig)) {
            unlink($DFile_Orig);
        }
    }
    //modpack compatibility {Stramm}
    if(isset($CONFIG['mini_pfx'])) {
        $DFile_Mini=$Dpath.$CONFIG['mini_pfx'].$file_name;
        $AFile_Mini=$Apath.$CONFIG['mini_pfx'].$file_name;
        if(file_exists($DFile_Mini)){
            if(copy($DFile_Mini,$AFile_Mini)) {
                unlink($DFile_Mini);
            }
        }
    }

in include/function.inc.php.

Additionally they have to be hidden in the file tree:
Change
if (strpos($entry, stristr($entry,$CONFIG['normal_pfx'])) !== 0 && strpos($entry, stristr($entry,$CONFIG['thumb_pfx'])) !== 0)
to
if (strpos($entry, stristr($entry,$CONFIG['normal_pfx'])) !== 0 && strpos($entry, stristr($entry,$CONFIG['thumb_pfx'])) !== 0 && strpos($entry, stristr($entry,$CONFIG['orig_pfx'])) !== 0)

Change
if (strpos($file, stristr($file,$CONFIG['normal_pfx'])) !== 0 && strpos($file, stristr($file,$CONFIG['thumb_pfx'])) !== 0)
to
if (strpos($file, stristr($file,$CONFIG['normal_pfx'])) !== 0 && strpos($file, stristr($file,$CONFIG['thumb_pfx'])) !== 0 && strpos($file, stristr($file,$CONFIG['orig_pfx'])) !== 0)

Αndré

Version 1.3 attached to initial post. It also fixes an issue reported here.

micropalla

Hello.
Your plugin works fine but there is an error in the italian translation that create a parse error during installation.
On line 49 replace at the end:

$lang_plugin_FileMove['transfer_file'] = 'Trasferisci alcuni files dalla ',

with

$lang_plugin_FileMove['transfer_file'] = 'Trasferisci alcuni files dalla ';

Αndré

Thanks. It seems that I already fixed that on 2012-01-26 (1 year ago), but haven't released an upgraded package. I'll update the package in the initial post soon.

netb

Hello,
Firstly to say that this is a great plugin saved me when I was told by the hosting that there were too many files in one place. Now I have found a problem, I had created a folder from FTP which has a blank space at the end of it's name by mistake, like that - "folder-name " and moved files there. But if you want to open it with the plugin it doesn't work. Could this cause any other problems and can it be fixed somehow?

Αndré

I'm not sure what exactly you try to accomplish.

Quote from: netb on July 27, 2015, 07:03:07 PM
"folder-name " and moved files there. But if you want to open it with the plugin it doesn't work.

As you're not able to open the folder with the plugin, what exactly do you mean with "move"? I assume you want to get rid of the folder with the trailing space and move all files to "folder-name" without the space?

netb

Quote from: Αndré on July 28, 2015, 09:09:44 AM
I'm not sure what exactly you try to accomplish.

As you're not able to open the folder with the plugin, what exactly do you mean with "move"? I assume you want to get rid of the folder with the trailing space and move all files to "folder-name" without the space?

Yes that's what I want.

Αndré


netb


Αndré

1. Make a backup of your albums folder and your MySQL database!
2. Rename "folder-name " to "folder-name" with your FTP client
3. Execute the following query with a tool like phpMyAdmin, after you adjusted the table prefix and path to your conditions:
UPDATE cpg15x_pictures SET filepath = 'path/to/folder-name/' WHERE filepath = 'path/to/folder-name /'