I'm thinking maybe you need to use $r['COUNT(userid)'] to access the results.
As for the hook, when you get it working you might want to find a hook location where your code will only be executed when you're going to display it (global start will be executed on every page). To do that you really need to look at the code, but some people seem to do OK by looking at the list of hook names and guessing or using trial and error. Of course you can ask here as well.
|