Hi StarDancer,
Yes, some of that code in there is a bit over the top for a beginner (like me).
How much did you change, and did you keep a mental record of what edits you made?
Since I got you into this mess, I'll have to help you out.
This is what Sadr1an1 said in that forum topic:
I have succesfuly begin integration with phpbb3, all i have managed to do is synchronizing account creation from zencart into phpbb. After the modification in admin section Configuration->My store->Enable phpBB linkage? = true, and the config file, i have to modify class.phpbb.php, just the following function:
All the code in the postings before this one were irrelevant, since they didn't actually accomplish the desired goal. This post by Sadr1an1 was post #12.
So the file to edit was this one: includes/classes/class.phpbb.php
and you need to replace the function phpbb_create_account which formoraly looked like this:
function phpbb_create_account($nick, $password, $email_address) {
if ($this->phpBB['installed'] != true || !zen_not_null($password) || !zen_not_null($email_address) || !zen_not_null($nick)) return false;
if ($this->phpbb_check_for_duplicate_email($email_address) == 'already_exists') {
// $this->phpbb_change_email($old_email, $email_address);
} else {
$sql = "select max(user_id) as total from " . $this->phpBB['users_table'];
$phpbb_users = $this->db_phpbb->Execute($sql);
$user_id = ($phpbb_users->fields['total'] + 1);
$sql = "insert into " . $this->phpBB['users_table'] . "
(user_id, username, user_password, user_email, user_regdate)
values
('" . (int)$user_id . "', '" . $nick . "', '" . md5($password) . "', '" . $email_address . "', '" . time() ."')";
$this->db_phpbb->Execute($sql);
//could do a check here to see if Insert_ID() matches $user_id...
// @TODO: MySQL5
$sql = "INSERT INTO " . $this->phpBB['groups_table'] . " (group_name, group_description, group_single_user, group_moderator)
VALUES (0, 'Personal User', 1, 0)";
$this->db_phpbb->Execute($sql);
$group_id = $this->db_phpbb->Insert_ID();
$sql = "INSERT INTO " . $this->phpBB['user_group_table'] . " (user_id, group_id, user_pending)
VALUES ($user_id, $group_id, 0)";
$this->db_phpbb->Execute($sql);
//might optionally send an extra email welcoming them to the phpBB forum, reminding them of their nickname?
}
}
you would replace this code with this:
function phpbb_create_account($nick, $password, $email_address) {
if ($this->phpBB['installed'] != true || !zen_not_null($password) || !zen_not_null($email_address) || !zen_not_null($nick)) return false;
if ($this->phpbb_check_for_duplicate_email($email_address) == 'already_exists') {
// $this->phpbb_change_email($old_email, $email_address);
} else {
$sql = "select max(user_id) as total from " . $this->phpBB['users_table'];
$phpbb_users = $this->db_phpbb->Execute($sql);
$user_id = ($phpbb_users->fields['total'] + 1);
$sql = "insert into " . $this->phpBB['users_table'] . "
( username,username_clean, user_password, user_email, user_regdate)
values
( '" . $nick . "','" . $nick . "', '" . md5($password) . "', '" . $email_address . "', '" . time() ."')";
$this->db_phpbb->Execute($sql);
//could do a check here to see if Insert_ID() matches $user_id...
// @TODO: MySQL5
//$sql = "INSERT INTO " . $this->phpBB['groups_table'] . " (group_name, group_desc, group_single_user, group_moderator)
// VALUES (0, 'Personal User', 1, 0)";
//$this->db_phpbb->Execute($sql);
//$group_id = $this->db_phpbb->Insert_ID();
$sql = "INSERT INTO " . $this->phpBB['user_group_table'] . " (user_id, group_id, user_pending)
VALUES ($user_id, 2, 0)";
$this->db_phpbb->Execute($sql);
//might optionally send an extra email welcoming them to the phpBB forum, reminding them of their nickname?
}
}
After this, you could go the extra mile and do what user neteasy did which they explained in post#18 on that topic:
"I have to update the CONFIG table in PHPBB3 so the newest member will be displayed on the PHPBB3 homepage"