MyBB Community Forums

Full Version: Permission Viewer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(2014-10-29, 11:16 AM)dragonexpert Wrote: [ -> ]I'm not sure what you mean here. I don't use any front end hooks, only ACP ones.

The plugin file is loaded outside the ACP when it is not necessary, we need a better system on 2.0, that is what I meant. Unrelated, yeah.
Fatal error: Call to undefined function xthreads_info() in /www/htdocs/xxx/admin/modules/tools/permissionviewer.php on line 188

and

Warning [2] Invalid argument supplied for foreach() - Line: 468 - File: admin/modules/tools/permissionviewer.php PHP 5.4.40-nmm1 (Linux)
Xthreads doesn't appear to be compatible with this plugin. In general plugins should have the pluginname_info function in the inc/plugins folder. It is a bad practice by the author.
(2015-06-09, 06:28 AM)dragonexpert Wrote: [ -> ]In general plugins should have the pluginname_info function in the inc/plugins folder. It is a bad practice by the author.
There is no such requirement to do so in MyBB. Whether you think it's bad practice is dependent on your subjective view, but I'd say it's bad practice to just crash if the function isn't there (i.e. call the info function without checking for its existence first).

There's also no need to explicitly include the plugin file - MyBB does this automatically on every page load.
I'd agree that a more "MyBB way" would be to use hooks rather than additional info parameter, but if you're happy with it, I can't see anything major (as long as the plugin only has one language file, which should be most of them out there I suppose; then again, they may already do a $lang->load inside the info function for the descriptions to display in the native language, so this whole "language_file" parameter may seem a little redundant).

I'll probably make a change on XThreads' end since I can see the potential for other plugins potentially having similar issues, but I'll blame you here for this particular issue =P
I've yet to come across a plugin that does not use the _info function whenever I've looked at a plugin prior to approving one. xthreads does not exist on this website and since I don't actually use the plugin, I've never seen what the code looks like for it. Does the page that lists all your plugins actually give a description for xthreads?
(2015-06-11, 12:43 PM)dragonexpert Wrote: [ -> ]xthreads does not exist on this website and since I don't actually use the plugin, I've never seen what the code looks like for it. Does the page that lists all your plugins actually give a description for xthreads?
Yes it does. The info function is loaded on the plugins page.
There's no reason to waste memory/resources loading functions that are only ever used in one place.

If you wish to see what the code looks like, you can obtain the plugin here or here, although from your post above, you already seem to have some idea as to what's going on.
I think I have the issue resolved on the Github version, although I haven't tested it yet.
i have deinstalled xthread and now, see you attachment. i use the version of github.
Thanks for making the change.
I'm not sure about the XThreads specific exception you've put there; I've already made a change in my local copy to work with your plugin. It doesn't really hurt though I suppose.

For the issue in the above post, it looks like you need to initialise the $prefixes variable to an empty array before trying to fill it.
I'm not used to having to initialize an array before filling it. I'll update the Github code.
Pages: 1 2 3