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   Go Down

Author Topic: FileMove Plugin (managing the storage folder) for cpg1.5x  (Read 35105 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
FileMove Plugin (managing the storage folder) for cpg1.5x
« on: October 21, 2010, 10:48:22 am »

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

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!
« Last Edit: February 07, 2013, 10:00:21 am by Αndré »
Logged

François Keller

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

amadeus

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #2 on: November 27, 2010, 11:27:16 pm »

Hello,

any news about this?

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #3 on: November 28, 2010, 01:12:31 am »

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

nasiri

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Nasiri Web Media Development
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #4 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
Logged
Nasiri Media
Web Development in Münster / Germany

http://www.nasiri.com

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #5 on: December 09, 2010, 06:02:36 pm »

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

nasiri

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Nasiri Web Media Development
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #6 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
Logged
Nasiri Media
Web Development in Münster / Germany

http://www.nasiri.com

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #7 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.
Logged

nasiri

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Nasiri Web Media Development
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #8 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.

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

http://www.nasiri.com

François Keller

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #10 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)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #11 on: January 24, 2012, 10:01:16 am »

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

micropalla

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #12 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 ';
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #13 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.
Logged

netb

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 82
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #14 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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #15 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?
Logged

netb

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 82
Re: Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #16 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #17 on: July 28, 2015, 01:25:42 pm »

Are there any sub-folders in the affected folder?
Logged

netb

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 82
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #18 on: July 28, 2015, 06:25:11 pm »

No, there aren't any subfolders.  :)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: FileMove Plugin (managing the storage folder) for cpg1.5x
« Reply #19 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 /'
Logged
Pages: [1] 2   Go Up
 

Page created in 0.043 seconds with 20 queries.