okies, seeing how i just did this i'll give you a few pointers...
The "NICK" is what will create the user account in your phpBB forums. There are three things i did to get everything to work.
- Admin -> configuration -> my store " enable phpbb linkage = true. "
The "NICK" will only appear under the email portion of the account creation if the store can find the phpBB directory, usually "forums".
- Next edit includes/configure.php
This is what was stopping mine from working. Make sure your path is correct. I believe this is what causes a lot of errors. In the forums and instructions they mention root directories, relative and absolute paths and if confuses must ppl.
My forums directory is not in under the store location.
i tried using /forums/ but that did not work. i tried using forms/ but that didn't work either. Im not actually sure which path the store is looking for. However my extensive DOS knowledge came in handy lol.
This is what worked for me,
define('DIR_WS_PHPBB', '../forums/');
What this tells the software is that it must go up one directory and then enter the phpbb directory. my phpbb is not under my zen cart directory.
(note if your having troubles with the "forum" link on your side boxes this will fix the invalid link)
- what i did is edit includes/classes/class.phpbb.php i looked for phpbb_create_account and replaced that function with the following code.
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?
}
}
however that did not update the "newest member" at the bottom of the phpbb forum... i saw some more code in this post that i will try and let you know.