2014-10-24, 01:46 AM
I'm currently in the process of working on a word counter plugin for my forums. The premise is pretty simple - count the number of words in a post and add it to the new field (wordcount) in the posts table in the database.
I was wondering if there was a way to use the datahandler hooks (datahandler_post_insert_post_end and datahandler_post_insert_thread_post) to do this? I attempted it, but I ran into problems updating the table because at that point, there is no post ID and I wasn't sure how I would get that new post ID through those hooks.
I currently have it working using newreply_end and newthread_end, but I'm having trouble getting it to work with the fast reply and quick edit, so I'd like to use the datahandler hooks if it's at all possible.
I was wondering if there was a way to use the datahandler hooks (datahandler_post_insert_post_end and datahandler_post_insert_thread_post) to do this? I attempted it, but I ran into problems updating the table because at that point, there is no post ID and I wasn't sure how I would get that new post ID through those hooks.
I currently have it working using newreply_end and newthread_end, but I'm having trouble getting it to work with the fast reply and quick edit, so I'd like to use the datahandler hooks if it's at all possible.