how can I implement a hook to validate the words that I’m posting ?
it seems that the forum lacks that feature: prohibited words
so I want to implement one even if I have to make my own module
I just need to know what function to hook
how can I implement a hook to validate the words that I’m posting ?
Share
Have you looked at the existing modules?
A quick search finds Wordfilter and Phonetic Wordfilter. I would suggest you try these out, even if they don’t do exactly what you need their code will probably help point you in the right direction.
+++ EDIT +++
If you must do it when they post then use hook_nodeapi
If you want to remove word automatically then run the ‘presave’ operation to alter the body before saving. Something along the lines of;
Or if you wanted to prevent the user from posting until they had removed any banned words then you use the ‘validate’ operation. Something like;