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.
What I want to do is,
- add a new field to my content type called 'main image (bool)' to let the admin set a main image.
- I am going to use Views module to display nodes, but order nodes by 'main image' field and added date.
- so that the first node is always the main image.
to do this, I need to make sure that there is always only one node with 'main image' set to true.