Hello There, Guest! › Register

MySubscriptions 2.2 released.
Looking for a custom plugin for your site? Ask here for a quote.

Plaza module help
#1

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
#2

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

Place this in the _run function or _page, depending on what you want
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
#3

Ooo! Thanks a lot Big Grin

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

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

Andrew - NewPoints Plugin Developer


[Image: dragonanimated_446370.gif]
#5

@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
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
#6

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?
#7

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
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
#8

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
#9

You know that you can edit someones money by editign the user, right?
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
#10

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




Users browsing this thread: 1 Guest(s)