16
Mods & Plugins (Releases & Support) / Re: [MOD] Alternate directory for download files.
« on: June 24, 2008, 12:07:32 PM »
Just in case anyone else would like to be able to also delete the "big" files, here's the solution I came up with after seeing that this issue hadn't been tackled by anyone else before.
In lang\english\admin.php search for
Insert this after:
Do the same in \lang\deutch\admin.php
in admin\images.php search for
(this is within a function called delete_images)
After that code, insert
If your "big" folder is not called \download, then you need to replace the /download/ with your "big folder"-name in this line of my code:
In lang\english\admin.php search for
Code: [Select]
$lang['thumb_delete_success'] = "Thumbnail file deleted";
$lang['thumb_delete_error'] = "Error deleting thumbnail file";
Insert this after:
Code: [Select]
$lang['bigimage_delete_success'] = "Big image file deleted";
$lang['bigimage_delete_error'] = "Error deleting big image file";
Do the same in \lang\deutch\admin.php
in admin\images.php search for
Code: [Select]
if (!empty($image_row['image_thumb_file']) && !is_remote($image_row['image_thumb_file']) && !is_local_file($image_row['image_thumb_file'])) {
if (@unlink(THUMB_PATH."/".$image_row['cat_id']."/".$image_row['image_thumb_file'])) {
echo " ".$lang['thumb_delete_success']." (".$image_row['image_thumb_file'].")<br />\n";
}
else {
$error_log[] = "<b>".$lang['thumb_delete_error']." (".$image_row['image_thumb_file'].")<br />\n";
}
}
(this is within a function called delete_images)
After that code, insert
Code: [Select]
/* We should also delete the "big" version in folder /download */
if (!is_remote($image_row['image_media_file']) && !is_local_file($image_row['image_media_file'])) {
$download_del = MEDIA_PATH."/".$image_row['cat_id']."/download/".$image_row['image_media_file'];
if (file_exists($download_del)) {
if (@unlink($download_del)) {
echo " ".$lang['bigimage_delete_success']." (".$image_row['image_media_file'].")<br />\n";
}
else {
$error_log[] = "<b>".$lang['bigimage_delete_error']." (".$download_del.")<br />";
}
}
}
If your "big" folder is not called \download, then you need to replace the /download/ with your "big folder"-name in this line of my code:
Code: [Select]
$download_del = MEDIA_PATH."/".$image_row['cat_id']."/download/".$image_row['image_media_file'];