You are here

function image_delete in Image 6

Same name and namespace in other branches
  1. 5.2 image.module \image_delete()
  2. 5 image.module \image_delete()

Implementation of hook_delete().

File

./image.module, line 622

Code

function image_delete($node) {
  $result = db_query('SELECT i.fid, f.filepath FROM {image} i INNER JOIN {files} f ON i.fid = f.fid WHERE i.nid = %d', $node->nid);
  while ($file = db_fetch_object($result)) {
    db_query("DELETE FROM {image} WHERE nid = %d AND fid = %d", $node->nid, $file->fid);
    _image_file_remove($file);
  }
}