The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Extend validation of posts
Hi,
I fiddled around for hours but I'm stumped What I'm trying to do is extend the validation of posts and display an error message (if necessary) similar to the 'tooshort' thingy. In fact, it should look exactly like the page you get when the 'tooshort' error occurs - error message on top (mine will be rather long and comes as a table) and the editor below with a copy of the rejected message. All I mananged so far is to hook into newreply_post_start and display a 'standard_error'. But that would require the user to return to the previous page after memorizing all the helpful comments. Not so nice Any hint would be greatly appreciated |
#2
|
|||
|
|||
If you create a plugin using hook newpost_process you can check the message text and add to the $errors array, and it will do what you describe. The code is in includes/functions_newpost.php, and the post text is in $post['message']; so something like:
Code:
if (some test on $post['message'] fails) $errors[] = "Some test failed."; I can't remember if you need to call return after that or not. Try it without and see what happens. |
#3
|
|||
|
|||
Yay!
$errors did it, no return required Thanks |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|