I think the problem is that when you're creating a new thread, the threadid hasn't been created yet. It won't be known until the thread is actually saved. It looks like at hook newpost_complete you would be able to use the threadid.
Also, do you want your code to run for both threads and posts? If you only want it to run when a new thread is created, you'll want to check for $type == 'thread'.
|