07-06-2010, 07:44 AM
(07-06-2010, 07:37 AM)Tomm M Wrote: Nayar - I have a few issues with your plugin...this was the first ever plugin i made without any knowledge of php and myBB. I only copied codes from other plugins and modified it to just get the job done.
$user = get_user($mybb->input['uid']);
Although this does get checked in the function, you should perform some sort of validation to ensure you actually have a user to edit and show an error if there isn't.
Also, the entire modcpperm function runs whether you're editing a profile or not. In this function, you could do this:
if($mybb->input['action'] != "editprofile")
...and just another gripe, but correct me if I'm wrong - these settings seem global? As in if you set an option to 'no', then no moderator can edit that section. This includes administrators and all moderators? I'm not too sure if you planned to do that or not...
Last thing, there are 11 str_replace function calls. This function accepts arrays as parameters, so it would be a lot easier if you added the strings and replacements then only one str_replace function is needed...
Thanks for your suggestions
I will rewrite the plugin from scratch in November. Could a mod please close this thread till the next release. I am removing the download