Customizing SMF > SMF Coding Discussion

2.0.2 add a member to group

(1/6) > >>

repxl:

--- Code: ---<?php
// Change this so that it points to the SSI.php file in your smf directory.
require_once('SSI.php');

require_once($sourcedir.'/Subs-Membergroups.php');

$memberID = 6;
$groupID = 10;
addMembersToGroup(array($memberID), $groupID);
?>
--- End code ---

i want to add a member to a group in my other php files outside of smf.

will think work just like this ?

becuase in the description is this

- requires the manage_membergroups permission.
and
- non-admins are not able to add members to the admin group.

btw my member buy premium and it will automatically add him to the membergroup "Premium Members"
it,s automatically handled when he pays by paypal in an if statement.
so i can,t check for non-admins will it still work and how to require the manage_membergroups permission ?

Arantor:
It depends on how it's called.

When SSI.php is loaded, it will check the cookies etc. of the logged in person to change permissions.

If you're using the paid subscriptions system to manage adding people to groups automatically, it will do this for you and not have a problem doing it.

repxl:
hmm ofc lol when im logged off and im using remove or add to group it promps up the login bar that i need login



how i can do this without login .. im using it when ppl pay by paypal it will do add or remove to smf so i need it without any logins .

Arantor:
Well, that's because if you're a guest, it will ask you to log in to see if your account would then have permission.

I don't understand what the problem is: if you're using paid subscriptions, the paid subscriptions WILL DO IT ITSELF, as in 'leave it alone'.

repxl:
look when users buy premium i have an php script which will be runed automatically

and there im using Add member to group function but i wont be logged in you know i will be away 1 month so when someone buy premium i need that he will get the premium membership on forum .

so how i can do this

Navigation

[0] Message Index

[#] Next page

Go to full version