Delete the picture after upload and keep the thumbnails !! Delete the picture after upload and keep the thumbnails !!
 

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

Delete the picture after upload and keep the thumbnails !!

Started by foxus777, May 22, 2006, 05:32:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

foxus777

hello

I would delete the picture after the upload, and keep the thumbnail created by coppermine, automaticaly, it's easy you think ?

thanks you :)

Stramm

you'll have to modify include/picmgmnt.inc.php
but just deleting the pic will mean you've a lot of broken links / img tags

Joachim Müller

a common misunderstanding: coppermine doesn't store the pics in the database, but only that path to the pics. Deleting the pics means (as Stramm suggested) rendering the link from thumbnail to intermediate/full-sized pic broken.

foxus777

okay, i know the effet of this operation thanks :)

in picmgmnt.inc.php, i must modifie what exactly ?

thanks :)

Stramm

untested and with no guarantee...
the most easiest solution is to let coppemine create the images and after it has done the necessary sql queries, deleteing the images
add
        @unlink($normal);
        @unlink($image);


right after
    $query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
    $result = cpg_db_query($query);