forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: Αndré on October 21, 2010, 10:48:22 am

Title: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: Αndré on October 21, 2010, 10:48:22 am
This is a port of the cpg1.4.x plugin FileMove (http://forum.coppermine-gallery.net/index.php/topic,47565.msg227231.html#msg227231).

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!
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: François Keller on October 21, 2010, 04:10:36 pm
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)
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: amadeus on November 27, 2010, 11:27:16 pm
Hello,

any news about this?

Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: Αndré on November 28, 2010, 01:12:31 am
What news do you expect? The plugin has been ported and does its job.
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: nasiri on December 09, 2010, 05:38:09 pm
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
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: Αndré on December 09, 2010, 06:02:36 pm
Why don't you just create the new folder and move the files to that folder?
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: nasiri on December 10, 2010, 02:57:39 am
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
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: Αndré on December 10, 2010, 12:07:44 pm
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.
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: nasiri on December 10, 2010, 04:37:33 pm
:D i see now .. no offense ... thx for the plugin anyway. thought there're maybe more people who facing this problem.

;)
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: François Keller on February 27, 2011, 05:56:09 pm
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
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: Αndré on January 24, 2012, 09:16:35 am
The plugin doesn't move the watermark backup files orig_filename.jpg. Possible fix, change
Code: [Select]
    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
Code: [Select]
    $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
Code: [Select]
if (strpos($entry, stristr($entry,$CONFIG['normal_pfx'])) !== 0 && strpos($entry, stristr($entry,$CONFIG['thumb_pfx'])) !== 0)to
Code: [Select]
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
Code: [Select]
if (strpos($file, stristr($file,$CONFIG['normal_pfx'])) !== 0 && strpos($file, stristr($file,$CONFIG['thumb_pfx'])) !== 0)to
Code: [Select]
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)
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: Αndré on January 24, 2012, 10:01:16 am
Version 1.3 attached to initial post. It also fixes an issue reported here (http://forum.coppermine-gallery.net/index.php/topic,74298.0.html).
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: micropalla on February 07, 2013, 08:45:17 am
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:

Code: [Select]
$lang_plugin_FileMove['transfer_file'] = 'Trasferisci alcuni files dalla ',
with

Code: [Select]
$lang_plugin_FileMove['transfer_file'] = 'Trasferisci alcuni files dalla ';
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: Αndré on February 07, 2013, 09:59:19 am
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.
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: netb on July 27, 2015, 07:03:07 pm
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?
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: Αndré on July 28, 2015, 09:09:44 am
I'm not sure what exactly you try to accomplish.

"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?
Title: Re: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: netb on July 28, 2015, 12:52:19 pm
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.
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: Αndré on July 28, 2015, 01:25:42 pm
Are there any sub-folders in the affected folder?
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: netb on July 28, 2015, 06:25:11 pm
No, there aren't any subfolders.  :)
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: Αndré on July 28, 2015, 08:25:33 pm
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:
Code: [Select]
UPDATE cpg15x_pictures SET filepath = 'path/to/folder-name/' WHERE filepath = 'path/to/folder-name /'
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: netb on July 28, 2015, 10:55:27 pm
Thanks! I wasn't sure if only an update was needed and not something else. Everything's fine now. :)
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: netb on June 22, 2017, 05:23:12 pm
This plugin doesn't seem to be working with cpg 1.6.03. Would be really great if someone that understands help with porting it. I did change the old mysql functions but it still doesn't move files. :-\
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: ron4mac on June 22, 2017, 07:20:01 pm
Replace move_file.php and move_folder.php with the ones attached.
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: netb on June 23, 2017, 11:06:49 am
Hey, thanks! But you've included a wrong file plugin_config.php in the archive instead of the move_file.php.
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: ron4mac on June 23, 2017, 01:27:05 pm
Hey, thanks! But you've included a wrong file plugin_config.php in the archive instead of the move_file.php.
Oops ... sorry :-[
Errant file selection ... corrected.

I'll likely update the whole plugin before long and post it in the CPG 1.6.x plugins area of the forum.
Title: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
Post by: netb on June 23, 2017, 02:07:44 pm
That would be great! Thanks! :)