I Need PHPBB Help!

dquigley

New Member
Messages
249
Reaction score
0
Points
0
Hello,

Currently someone has helped me tweak my site so that when someone creates an account on my site the account is also created on the forum, so they are basically linked, here is the code how he did that.

PHP:
		// phpBB register part
		// Retrieve default group ID
        $sql = 'SELECT group_id
                FROM ' . GROUPS_TABLE . "
                WHERE group_name = '" . $db->sql_escape('REGISTERED') . "'
                        AND group_type = " . GROUP_SPECIAL;
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
 
        if (!$row)
        {
                trigger_error('NO_GROUP');
        }
        $group_id = $row['group_id'];
        
 
        $data = array(
                'username'                      => utf8_normalize_nfc(request_var('loginid', '', true)),
                'user_password'                 => phpbb_hash(request_var('password', '', true)),
                'user_email'                    => strtolower(request_var('email', '')),
                'group_id'                      => (int) $group_id,
                'user_type'                     => USER_NORMAL,
                'user_ip'                       => $user->ip,
        );
        
        $user_id = user_add($data);
		// phpBB register part end
		// phpBB login part
        if(login_user($loginid, $password)) {
			$username = request_var('loginid', '', true);
			$password = request_var('password', '', true);
			$autologin = false;
			$result = $auth->login($username, $password, $autologin);
			// Hope for the best
		}
		// phpBB login part end

Now my only problem with that is that when you create a account on my site it is "inactive" once you pay it is activated and then you are given access to all the features.

So what I would like to do is change the above code so that new forum accounts are also "inactive" I know there is a way to manually deactivate forum accounts in the admin panel so I am guessing there is coding to do this.

Then, I would also like the coding to "activate" the forum account, that way once they pay I can have the account automatically activated. Thank you for your help.

Also on the site members can change there password, the problem with that is if a member changes there password on the site it will not correctly log them into the forums anymore.

I would like to change the coding so that if the password on the site is changed then the password to there forum account is changed as well thank you.
 
Last edited:

dquigley

New Member
Messages
249
Reaction score
0
Points
0
151views and no responses? Is this a hard problem to solve or is it that it is a pain in the butt and no one wants to do it.
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
I could do it, by I just need to think about it.

PHPBB's website is down, so you might need to way a bit (I need to get the documentation)
 
Last edited:

dquigley

New Member
Messages
249
Reaction score
0
Points
0
Well I had my friend Dead Battery help me a bit and we found a way to do it, What I have done is simply removed all rights for normal registered forum users, and created a new group called paying users, so once they pay on my site I just need the coding to switch them to that other group so they can access the forum.

Hope that explanation was helpful, here is some of the coding stuff I think may help

group_user_add (line 2607)

Add user(s) to group

* return: false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'

mixed group_user_add ( $group_id, [ $user_id_ary = false], [ $username_ary = false], [ $group_name = false], [ $default = false], [ $leader = 0], [ $pending = 0], [ $group_attributes = false])

* $group_id
* $user_id_ary
* $username_ary
* $group_name
* $default
* $leader
* $pending
* $group_attributes
group_user_del (line 2708)

Remove a user/s from a given group. When we remove users we update their default group_id. We do this by examining which "special" groups they belong to. The selection is made based on a reasonable priority system

* return: if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'

false group_user_del ( $group_id, [ $user_id_ary = false], [ $username_ary = false], [ $group_name = false])

* $group_id
* $user_id_ary
* $username_ary
* $group_name

and the site where we found that coding is

http://area51.phpbb.com/docs/code/phpBB3/_includes---functions_user.php.html
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
it is, in fact, a good way to monitor and class your users
 
Top