I'm not sure what I want to do is possible but I thought it wouldn't hurt to ask. I've searched through the forums, the docs, googled, and even sat down and read a few books. I can't seem to find my answers. Here's what I want to do:
Desired behavior
When a certain function (that belongs to another module) is executed, I want to execute a function in the module I am writing.
Background
I have not written a module before so I am trying to learn. I have decent (but not great) PHP skills. I want to extend a module that I use in several websites. I have been asked for certain features that are not available in the core module. I have read through the issues of that module and found those features requested by many others but not seen any movement to create them. So I decided to give it a try. I didn't want to branch the existing module, so I felt the best option was to extend the current module. Heh... that was before I dug into the code.
Things I've tried
The first thing I thought of was to do a hook_alter but the specific functions I am concerned about do not use use any "alter"able hooks. Second thing I thought of was just watch for the db query wrapped in db_rewrite. However, the original author didn't wrap his queries.
Where I'm at
One of the functions that could act as a trigger for my proposed module ends in _user, the user hook if I understand correctly. However, I have not been able to figure out how to actually intercept this function (if even possible) so I can execute my operation. I have spent hours looking at the hook documentation, tutorials, and books I bought. I still cannot figure out how to watch the _user hook for this specific function and inject my own operation.
Next Step
I need someone to tell me that what I want to do is possible or that I need to quit sniffing the glue. If it is possible, can someone point me to a tutorial or documentation that will help me? If not, I think I am just going to do a cron job that watches the specific database table for updates. Not the way I would prefer to do it but it will work. Any other suggestions?
Please keep in mind this is my FIRST attempt to write a Drupal module. This may be an idiotic question. If so, I apologize. Thanks!