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: File replacement plugin  (Read 105232 times)

0 Members and 1 Guest are viewing this topic.

majay

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
Re: File replacement plugin
« Reply #20 on: December 11, 2006, 09:04:08 pm »

This is exactly what I needed, thanks!
Logged

MarkP

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Re: File replacement plugin
« Reply #21 on: January 14, 2007, 05:22:56 pm »

I have a little problem with the plugin...whenever a photo gets replaced the watermark goes away.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: File replacement plugin
« Reply #22 on: January 14, 2007, 07:44:22 pm »

If you use my watermarking mod or the modpack then try the attached, modded file replacer plugin. It's enhanced to also replace the mini thumb and the original backup file (if set in the config and/ or watermarking is enabled). Also (if set in the config) it'll crop the thumbs and sharpen them.

btw., sweet plugin, Nibbler

edit: I've nearly forgotten to say... I haven't tested that much... just replaced one image. So there may be glitches.

MarkP

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Re: File replacement plugin
« Reply #23 on: January 16, 2007, 06:02:00 am »

Works great! I have your mod pack installed. Thanks!
Logged

July3

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 94
Re: File replacement plugin
« Reply #24 on: February 28, 2007, 11:54:19 pm »

Hello, my English is very bad. But i hope you understand my Problem with the Replacer-Plugin. Does it work only with Pictures or also with Videos? Because i would like to replace a video in my Gallery but i will not loose the comments and the number of views.
Logged

Nibbler

  • Guest
Re: File replacement plugin
« Reply #25 on: March 01, 2007, 12:02:45 am »

Should do. Try it and see.
Logged

July3

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 94
Re: File replacement plugin
« Reply #26 on: March 01, 2007, 12:08:32 am »

I try it, but everytime a error comes. It said he can not Load the file to the server  ???
Logged

midnightshowx0

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 10
    • Kevin Jonas Online
Re: File replacement plugin
« Reply #27 on: October 11, 2007, 03:30:12 pm »

Where do I upload the files? Is it the plugin folder? Cause I just tried that, and the button didn't show up.
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: File replacement plugin
« Reply #28 on: October 11, 2007, 04:29:13 pm »

have you read the doc  ? http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#plugin_manager_install
i think you will find the answer here  ;)
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

taiofmine

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: File replacement plugin
« Reply #29 on: February 09, 2008, 10:46:56 pm »

For some reason, it made the replaced image all pixel-y...
[Edit GauGau] Replaced hotlinked image with attachment [/Edit]
...like that.

Is there something I missed that will make the new image display properly?
« Last Edit: February 10, 2008, 12:09:29 am by Joachim Müller »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: File replacement plugin
« Reply #30 on: February 10, 2008, 12:10:34 am »

If the replacement file has a different resolution to the original pic you should use the admin tools to resize.
Logged

Trev98

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: File replacement plugin
« Reply #31 on: March 27, 2008, 01:50:43 am »

Excellent plugin! Works perfectly. Thanks very much, and to wirewolf for the nifty little mod, too. ;D

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: File replacement plugin
« Reply #32 on: August 16, 2008, 08:42:30 pm »

Seems to be a very good plugin.

Unfortunately, I deleted all buttons under the intermediate pic, so there is no button appearing for me.

Is it possible to get the link/button under "edit files" in the thumbnail overview?

Must be line 34/35, or ?

Thank you very much, regards Dietmar
Logged

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: File replacement plugin
« Reply #33 on: August 17, 2008, 09:27:21 am »

solved.

Its just the {ADMIN_MENU}  in theme.php which decides where the button gets.

thank you very much for the plugin.
Logged

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: File replacement plugin - BUG
« Reply #34 on: August 17, 2008, 11:11:46 pm »

Hello.

There is one serious bug if you use 1.1 version which uses the new filename.

example:
the picture to be replaced is named pic1

the new picture is named pic2

(!) if there is already a pic named pic 2 in the folder, this makes great problems with thumbnails etc. At least with me right now.

regards, dietmar



Logged

jManuel

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 46
    • Comunidad de fotografos aficionados
Re: File replacement plugin
« Reply #35 on: October 16, 2008, 10:21:04 pm »

Hi,

For spanish users, spanish version "File replacement plugin Ver.1.1 in spanish".

(Added): "lang spanish interface" ,"Cancel button".

Great plugin
Logged
jManuel - Comunidad de fotografos aficionados

HollowMac

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
    • Fourmis-Passion
Re: File replacement plugin
« Reply #36 on: August 03, 2009, 01:37:02 am »

Hello,

I am French.
I am interested by this plugin but it dit not rename and resize pictures according to regulations in admin panel. So, i have changed the code :

------

Salut,
Je suis français.
J'étais intéressé par ce plugin mais il ne renommait ni ne redimensionnait les images d'après les réglages indiqués dans le panneau d'administration. J'ai donc changé le code pour qu'il le fasse :

Code: [Select]

if (count($_FILES) && $row){



if ($_FILES['fileupload']['error']) die('Upload error ' . $_FILES['fileupload']['error']);


// If magic quotes is on, remove the slashes it added to the file name.
                    if (get_magic_quotes_gpc()) $_FILES['fileupload']['name'] = stripslashes($_FILES['fileupload']['name']);

                    // Create the holder $picture_name by translating the file name. Translate any forbidden character into an underscore.
                    $_FILES['fileupload']['name'] = replace_forbidden($_FILES['fileupload']['name']);


if (REPLACER_USE_NEW_FILENAME) {

$rfilename = $_FILES['fileupload']['name'];

cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET filename ='$rfilename' WHERE pid = '$pid' LIMIT 1");

$old_filename = $row['filename'];

$old_image = $CONFIG['fullpath'] . $row['filepath'] . $old_filename;

$old_normal = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['normal_pfx'] . $old_filename;

$old_thumb = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['thumb_pfx'] . $old_filename;

unlink($old_image);

unlink($old_normal);

unlink($old_thumb);

} else {

$rfilename = $row['filename'];

}



$image = $CONFIG['fullpath'] . $row['filepath'] . $rfilename;

$normal = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['normal_pfx'] . $rfilename;

$thumb = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['thumb_pfx'] . $rfilename;



move_uploaded_file($_FILES['fileupload']['tmp_name'], $image);

chmod($image, octdec($CONFIG['default_file_mode']));



require('include/picmgmt.inc.php');


if (is_known_filetype($image)){



if (is_image($image)){


resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']);

resize_image($image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']);
resize_image($image, $image, $CONFIG['max_upl_width_height'], $CONFIG['thumb_method'], $CONFIG['thumb_use']);


list($width, $height) = getimagesize($image);



} else {

$width = 0;

$height = 0;

}



$image_filesize = filesize($image);

$total_filesize = $image_filesize + (file_exists($normal) ? filesize($normal) : 0) + filesize($thumb);



cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET filesize = '$image_filesize', total_filesize = '$total_filesize', pwidth = '$width', pheight = '$height' WHERE pid = '$pid' LIMIT 1");



// addition by Andi to parse EXIF info of new file

if ($CONFIG['read_exif_data']) {

    include("include/exif_php.inc.php");

    exif_parse_file($image);

}

// end addition



$CONFIG['site_url'] = rtrim($CONFIG['site_url'], '/');

} else {

@unlink($image);

}

header("Location: {$CONFIG['site_url']}/displayimage.php?pos=-$pid");

die();





}


 ;)

Thank you for this plugin. :-*
Logged

ondynek

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: File replacement plugin
« Reply #37 on: August 03, 2009, 09:31:56 pm »

Hello,
thank You very much for plugin - it is awesome, but I would like to ask You one thing - EXIF reading doesn't work for me (I used  Paver version, I tried also Nibbler version with manual update of codebase.php file). Is there any change in Exif reading?
Thank You in advance
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: File replacement plugin
« Reply #38 on: August 04, 2009, 09:17:13 am »

Start a thread of your own on the support board for your individual issues, doing as suggested per board rules (posting a link to your gallery in your thread etc.)
Logged

Bradster

  • Coppermine novice
  • *
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 21
Re: File replacement plugin
« Reply #39 on: October 15, 2009, 03:12:24 pm »

Neat plugin, but the download link on the main Plugins page goes to 'file2albummover' (the plugin just above it), which gives a catastrophically different result when you're not paying attention.
Logged
Pages: 1 [2] 3   Go Up
 

Page created in 0.039 seconds with 20 queries.