SMF Support > SMF 1.1.x Support
Copy user at registration to another database
ExSpirit:
I am using two SMF forums and I would like if users would be synchronised - so when someone registers at first forum he is also added to second forum...
Is there any mod that does that and if not, can someone help me with this?
ExSpirit:
I managed to copy user to other table in Subs-Members.php I added:
--- Code: --- db_query("
INSERT INTO {$db_prefix}members2
(" . implode(', ', array_keys($regOptions['register_vars'])) . ")
VALUES (" . implode(', ', $regOptions['register_vars']) . ')', __FILE__, __LINE__);
--- End code ---
The only problem now is with activation, I'm trying to edit ManageMembers.php:
--- Code: --- db_query("
UPDATE {$db_prefix}members
SET validation_code = '', is_activated = 1
WHERE is_activated = $current_filter$condition
LIMIT $member_count", __FILE__, __LINE__);
--- End code ---
... but I can't get members2 table to change value is_activated to 1 - probably because of different ID or...?
Colin:
Well, before you created the scripts was the install clean or were there already users and data? If so then yes, that is your issue.
ExSpirit:
Yes I already have members registered. SO instead of checking members ID I could just check activation code and change in second database where user has used activation code? I just can't manage to figure it out how, I can't get that value...
Doctor Deejay:
--- Quote ---
--- Code: --- db_query("
UPDATE {$db_prefix}members
SET validation_code = '', is_activated = 1
WHERE is_activated = $current_filter$condition
LIMIT $member_count", __FILE__, __LINE__);
--- End code ---
... but I can't get members2 table to change value is_activated to 1 - probably because of different ID or...?
--- End quote ---
It's because you have "members" set as the table, but I think you meant "members2" :)
Navigation
[0] Message Index
[#] Next page
Go to full version