2012-04-01, 04:27 AM
I just thought while I was in the shower (I know, TMI) that it might be nice if a custom error string could be passed into the error_no_permission function.
Basically, just add a parameter to the function definition, such as $customerror, and if it is defined, display that error instead of the default one which isn't always correct in all situations.
This would allow plugin developers to create much more informative errors without much excess work.
Note: I am unsure if there is a separate function like this already for plugins, and I didn't feel like hunting in the Sourcedocs to find out. And remember, I am not a plugin dev yet, so I am still minimally familiar with functions provided to plugins by MyBB.
Thanks!
Basically, just add a parameter to the function definition, such as $customerror, and if it is defined, display that error instead of the default one which isn't always correct in all situations.
This would allow plugin developers to create much more informative errors without much excess work.
Note: I am unsure if there is a separate function like this already for plugins, and I didn't feel like hunting in the Sourcedocs to find out. And remember, I am not a plugin dev yet, so I am still minimally familiar with functions provided to plugins by MyBB.
Thanks!