title: Post-save callback?
body: <p>How do I execute a function every time a node is being updated? I tried to use hook_nodeapi, but it looks like that the hook is removed from Drupal 7. </p>
  
  <p>What I want to do is,</p>
  
  <ol>
  <li>add a new field to my content type called 'main image (bool)' to let the admin set a main image.</li>
  <li>I am going to use Views module to display nodes, but order nodes by 'main image' field and added date.</li>
  <li>so that the first node is always the main image.</li>
  </ol>
  
  <p>to do this, I need to make sure that there is always only one node with 'main image' set to true.</p>