File replacement plugin - Page 2 File replacement plugin - Page 2
 

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

File replacement plugin

Started by Nibbler, August 26, 2005, 04:55:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

majay

This is exactly what I needed, thanks!

MarkP

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

Stramm

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

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

July3

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.

Nibbler


July3

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

midnightshowx0

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

François Keller

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

#29
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?

Joachim Müller

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

Trev98

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

dwo

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

dwo

solved.

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

thank you very much for the plugin.

dwo

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




jManuel

Hi,

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

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

Great plugin
jManuel - Comunidad de fotografos aficionados

HollowMac

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 :



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. :-*

ondynek

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

Joachim Müller

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.)

Bradster

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.