Log in

View Full Version : Check post title and text before posting


mosz
01-29-2011, 04:12 PM
Hello

I just want to make modification that will be check title and text before add new thread or post. If check will be posotove post/thread will be add,
if not that post/thread not will be add and user will see message (like when try to add new thread with to short topic or text)

I have question - where I should put plugin ?
In witch hook I will be possible to cactch title, post text and prevent add post to database if check will be negative.

i will be very grateful for any help :)

kh99
01-29-2011, 04:49 PM
I think you should be able to use newpost_process and check $post['title'] and $post['message']. If you detect an error you can add an error phrase name to the error list like this:


if ( /* put your check here */ ) // something wrong with title or message text
{
$dataman->error('error_phrase_name');
}



Of course you should chnage 'error_phrase_name' to the actual name of your phrase. The error phrase should be in group "Error Messages".

mosz
01-29-2011, 07:17 PM
works perfect :)
Thank you very much and send possitive vibrations :)

peace