WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
// Delete image if requestedforeach ($images as $image) { if ($image['delete_image'] !== false) { $img_file = $image['delete_image']; // Thumbs use .jpg extension only $thumb_file = str_replace (".png", ".jpg", $img_file); // Try unlinking image and thumb if (file_exists(WB_PATH.MEDIA_DIRECTORY.'/bakery/images/item'.$item_id.'/'.$img_file)) { unlink(WB_PATH.MEDIA_DIRECTORY.'/bakery/images/item'.$item_id.'/'.$img_file); } if (file_exists(WB_PATH.MEDIA_DIRECTORY.'/bakery/thumbs/item'.$item_id.'/'.$thumb_file)) { unlink(WB_PATH.MEDIA_DIRECTORY.'/bakery/thumbs/item'.$item_id.'/'.$thumb_file); } // Delete image in database $database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_images WHERE `filename` = '$img_file'"); // Check if there was a db error if ($database->is_error()) { $errors[] = $database->get_error(); } }}
// Delete image if requestedforeach ($images as $img_id => $image) { if ($image['delete_image'] !== false) { $img_file = $image['delete_image']; // Thumbs use .jpg extension only $thumb_file = str_replace (".png", ".jpg", $img_file); // Try unlinking image and thumb if (file_exists(WB_PATH.MEDIA_DIRECTORY.'/bakery/images/item'.$item_id.'/'.$img_file)) { unlink(WB_PATH.MEDIA_DIRECTORY.'/bakery/images/item'.$item_id.'/'.$img_file); } if (file_exists(WB_PATH.MEDIA_DIRECTORY.'/bakery/thumbs/item'.$item_id.'/'.$thumb_file)) { unlink(WB_PATH.MEDIA_DIRECTORY.'/bakery/thumbs/item'.$item_id.'/'.$thumb_file); } // Delete image in database $database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_images WHERE `img_id` = '$img_id'"); // Check if there was a db error if ($database->is_error()) { $errors[] = $database->get_error(); } }}