MyBB-Plugins Forums

Full Version: Plaza module help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

This question is for the code developers of myPlaza plugins.

How do you make a plugin that is admin only? I mean i only want admins to access that plugin. All others will get a "no access" error.

Is that possible? I saw that option in the "quick ban gold".

Could you provide me with a quick code for that? I am not familier with myBB or myPlaza too much...

I know its a variable like: $mybb->input['uid']

But in this case, i want group 4 (admin group in myBB) and it will return error if it fails.

Do i return "false" in the my_run($item) function for failure?

Thanks in advance Big Grin
PHP Code:
if ($mybb->user['usergroup'] != 4)

Place this in the _run function or _page, depending on what you want
Ooo! Thanks a lot Big Grin

Do i need to return false or just place it there like that?
you can also use this:
PHP Code:
if ($mybb->user['usergroup'] != 4)

@somik in the _run function you'll need to return false instead of putting "error_no_permission();" but in _page() you just need the code I posted
Ah, thanks! However when i return false, i get a chunk of code shown instread of any message like "purchage failed" or smt like that...

Any help regarding this?

Also when updating money, can i just call the user_change_money() function or do i update through db_update() like in the demo?
that chunk code might mean something like parse error.
You can call user_change_money but if you can't get it to work just use db_update
Thanks a lot! I ended up using the db_update function at the end Smile

I was making a admin plugin that allows admin to add/substract to any users money, and it works perfectly Big Grin

Thanks again for all the help Smile
You know that you can edit someones money by editign the user, right?
Yea, by going to AdminCP, but i wanted smt faster right inside MyPlaza! I am on 160kbps net u know Sad

Btw, another small thing. Is it possible to own more then one company at a time in MyPlaza? Is there some small option that i missed or is it impossible (impossible being hard to do)! I want one user to own multiple companies if possible...
Pages: 1 2