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

Author Topic: Mod for autocheck of "Delete File" box when original image is missing  (Read 6513 times)

0 Members and 1 Guest are viewing this topic.

hobert

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 29

These small additions to the editpics.php file will automatically have Coppermine check the "Delete file" option of pictures that are missing the original image (using a file_exist statement) when you edit the album files.  You can then click "Apply Modifications" to remove the coppermine data and files (including thumbs, normals, comments, etc.) like normal.

In editpics.php, after
Code: [Select]
$isgalleryicon_selected = ($CURRENT_PIC['galleryicon']) ? 'checked="checked" ':'';
$isgalleryicon_disabled = ($CURRENT_PIC['category'] < FIRST_USER_CAT) ? 'disabled="disabled" ':'';
add,
Code: [Select]
$checked= (file_exists("albums/".$CURRENT_PIC['filepath'].$CURRENT_PIC['filename'])) ? '' : 'checked';
A little bit later, modify this line:
Code: [Select]
<td width="20%" align="center"><input type="checkbox" name="delete{$CURRENT_PIC['pid']}" id="delete{$CURRENT_PIC['pid']}" value="1" class="checkbox" /><label for="delete{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['del_pic']}</label></td> to
Code: [Select]
<td width="20%" align="center"><input type="checkbox" name="delete{$CURRENT_PIC['pid']}" id="delete{$CURRENT_PIC['pid']}" value="1" class="checkbox" $checked /><label for="delete{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['del_pic']}</label></td> (added $checked variable).
Logged

peterlustig

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Mod for autocheck of "Delete File" box when original image is missing
« Reply #1 on: March 05, 2010, 03:04:48 pm »

Great -- this helped me a lot! Thank you!
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.