MyBB-Plugins Forums
Plaza module help - Printable Version

+- MyBB-Plugins Forums (http://forums.mybb-plugins.com)
+-- Forum: Archived Forums (http://forums.mybb-plugins.com/Forum-Archived-Forums)
+--- Forum: MyBB 1.4.x (http://forums.mybb-plugins.com/Forum-MyBB-1-4-x)
+---- Forum: MyPlaza Turbo (http://forums.mybb-plugins.com/Forum-MyPlaza-Turbo)
+---- Thread: Plaza module help (/Thread-Plaza-module-help)

Pages: 1 2


Plaza module help - somik - 09-15-2009

Hi.

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


RE: Plaza module help - Diogo Parrinha - 09-15-2009

PHP Code:
if ($mybb->user['usergroup'] != 4)
       
error_no_permission(); 

Place this in the _run function or _page, depending on what you want


RE: Plaza module help - somik - 09-15-2009

Ooo! Thanks a lot Big Grin

Do i need to return false or just place it there like that?


RE: Plaza module help - Andrew - 09-15-2009

you can also use this:
PHP Code:
if ($mybb->user['usergroup'] != 4)
{
    return;




RE: Plaza module help - Diogo Parrinha - 09-15-2009

@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


RE: Plaza module help - somik - 09-15-2009

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?


RE: Plaza module help - Diogo Parrinha - 09-15-2009

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


RE: Plaza module help - somik - 09-18-2009

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


RE: Plaza module help - Diogo Parrinha - 09-18-2009

You know that you can edit someones money by editign the user, right?


RE: Plaza module help - somik - 09-19-2009

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...