When you say "cron" you're setting it up as a scheduled task using the php file you created, right? (Sometimes people get confused between that and the actual operating system cron). Assuming you are, I'm not sure why you're getting that error because I thought that $db was always a global with the database object, but that error looks like it's saying that it's not. So you could try changing your code to use $vbulletin->db in place of $db (I see 4 places where you'd have to change it).
If you wanted to try the plugin route instead you just have to go to Plugins & Products and choose "add new plugin", choose the hook location you want and paste your code into the text area. Make up a title and make sure you enable it by clicking 'Yes'. (I wanted to mention this just in case, but since you've already gone through the trouble of creating a file for this you might as well keep going with that method).
|