function cw_dpi_delete_product($product_id = 0, $update_categories = true, $delete_all = false) { global $tables; if ($delete_all == true) { db_query('TRUNCATE TABLE ' . $tables['products_detailed_images']); } else { $product_id = (int) $product_id; if (!empty($product_id)) { cw_image_delete_all('products_detailed_images', "id = '{$product_id}'"); } } }
function cw_image_delete($id, $type = '') { global $available_images; $where = $available_images[$type]['type'] != 'U' ? 'image_id' : 'id'; if (is_array($id)) { $where .= " IN ('" . implode("','", $id) . "')"; } else { $where .= " = '{$id}'"; } return cw_image_delete_all($type, $where); }