Posts: 37,498
Threads: 399
Joined: Apr 2008
Reputation:
776
2010-05-29, 09:49 PM
(This post was last modified: 2010-05-29, 09:56 PM by Matt.)
That code isn't needed as this plugin doesn't have an admin language file.
Just noticed an error in the code I provided, have edited all current code snippets, including quotes; if I've edited your post, that's all I've changed.
Try this file:
ems.php (Size: 21.9 KB / Downloads: 154)
Look at the bottom of the file, see if you can make sense of what I've added. Note that it won't appear to work if you test this with your main admin account as you'll be a super admin and you'll override it.
Posts: 378
Threads: 95
Joined: Dec 2009
Reputation:
2
2010-05-29, 10:16 PM
(This post was last modified: 2010-05-29, 10:33 PM by groovybluedog.)
Its so confusing, I just cant cope! This is really starting to [----] me off!
I know its not your fault, because you didnt develop MyBB, but in MyBB 1.6 there need to be an easy way to do this! Quality Assurance, I hope your reading this. I just cannot do this, Its so confusing, because i need to do this for other plugins not just EMS and it changes for every plugin! Language files? What the? "Can Manage EMS?"? Huh?
MyBB Extras = Nope.
Posts: 3,631
Threads: 124
Joined: Sep 2008
Reputation:
10
2010-05-29, 10:41 PM
(2010-05-29, 10:16 PM)groovybluedog Wrote: Its so confusing, I just cant cope! This is really starting to [----] me off!
I know its not your fault, because you didnt develop MyBB, but in MyBB 1.6 there need to be an easy way to do this! Quality Assurance, I hope your reading this. I just cannot do this, Its so confusing, because i need to do this for other plugins not just EMS and it changes for every plugin! Language files? What the? "Can Manage EMS?"? Huh? I am not sure how this is the fault of MyBB as if someone is to blame it is either you or the plugin developer. It's up to the developers to put the code in or not and it's not so hard to add a simple code snippit to a plugin.
Posts: 378
Threads: 95
Joined: Dec 2009
Reputation:
2
2010-05-29, 10:44 PM
(This post was last modified: 2010-05-29, 10:45 PM by groovybluedog.)
Its not the actual putting in im confused with. Its using different plugins.
Language files? What are they? What do i put in if it does have a language file? How do i tell if it has one or not?
In that file,
Quote:// plugin hook
$plugins->add_hook("admin_config_permissions", "ems_admin_config_permissions");
// function
function ems_admin_config_permissions($admin_permissions)
{
global $lang;
$admin_permissions['ems'] = "Can manage EMS?";
return $admin_permissions;
}
?>
I get the can manage ems part, Its the name of the option, Ok. I can see where the name of the plugin goes, ok, Its just this language files i dont get yet.
MyBB Extras = Nope.
Posts: 3,631
Threads: 124
Joined: Sep 2008
Reputation:
10
2010-05-29, 11:06 PM
(2010-05-29, 10:44 PM)groovybluedog Wrote: Its not the actual putting in im confused with. Its using different plugins.
Language files? What are they? What do i put in if it does have a language file? How do i tell if it has one or not?
In that file,
Quote:// plugin hook
$plugins->add_hook("admin_config_permissions", "ems_admin_config_permissions");
// function
function ems_admin_config_permissions($admin_permissions)
{
global $lang;
$admin_permissions['ems'] = "Can manage EMS?";
return $admin_permissions;
}
?>
I get the can manage ems part, Its the name of the option, Ok. I can see where the name of the plugin goes, ok, Its just this language files i dont get yet. Did you try applying the same method to another plugin?
Posts: 37,498
Threads: 399
Joined: Apr 2008
Reputation:
776
2010-05-29, 11:09 PM
(This post was last modified: 2010-05-29, 11:20 PM by Matt.)
I'm not really sure how we could make it much simpler, and we're not going to rewrite the plugin system in the middle of a beta. You'll know if a plugin has a language file as it'll have a file in the ./inc/languages/english/ and/or ./inc/languages/english/admin/ folder, for example ems.lang.php; note this plugin doesn't have any language files. The code I said to remove loads the language file, the admin one in this case, but if the plugin hasn't got any language files, it's not necessary to have that code as it won't be doing anything. I've hardcoded text in there instead of loading a language file.
Posts: 378
Threads: 95
Joined: Dec 2009
Reputation:
2
2010-05-30, 02:03 PM
Okay, I get this now, Thanks alot, But how can i restrict admins from Reaching Certain Categorys in settings. Like this:
"Board Online / Offline (2 Settings)
General Configuration (21 Settings)
Server and Optimization Options (17 Settings)
Date and Time Formats (5 Settings)
Forum Home Options (9 Settings)"
How can i restrict people to actual setting groups not the whole settings page?
MyBB Extras = Nope.
Posts: 37,498
Threads: 399
Joined: Apr 2008
Reputation:
776
2010-05-30, 02:22 PM
It's not possible to limit individual settings like that, only main modules. That would need it's own plugin.
Posts: 3,631
Threads: 124
Joined: Sep 2008
Reputation:
10
2010-05-30, 03:22 PM
I don't get it, why do you want to restrict everything from your admins? If you don't trust them than they shouldn't be admins.
|