You are here

function nodequeue_nodeapi in Nodequeue 5

Same name and namespace in other branches
  1. 5.2 nodequeue.module \nodequeue_nodeapi()
  2. 6.2 nodequeue.module \nodequeue_nodeapi()

Implementation of hook_nodeapi

File

./nodequeue.module, line 599

Code

function nodequeue_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
  switch ($op) {
    case 'delete':

      // If a node is being deleted, ensure it's also removed from any queues.
      $result = db_query("SELECT * FROM {nodequeue_nodes} WHERE nid = %d", $node->nid);
      while ($obj = db_fetch_object($result)) {
        nodequeue_queue_remove($obj->qid, $obj->position);
      }
      break;
  }
}