You are here

function Image::delete in Node Gallery 6

File

./node_gallery.model.inc, line 255
Node gallery module.

Class

Image

Code

function delete() {
  node_delete($this->nid);
  db_query("DELETE FROM {ng_images} WHERE nid = %d", $this->nid);
  db_query("DELETE FROM {files} WHERE fid = %d", $this->fid);
  file_delete($this->filepath);

  // Make sure to flush out the old imagecache images
  if (function_exists(imagecache_image_flush)) {
    imagecache_image_flush($this->filepath);
  }
}