I have recently installed phpbb3 on Zen Cart 1.3.8a with the latest phpbb class (see post #1 in this thread).
The server is Linux running php 5.2.6 & MySQL 5.0.45.
Zen Cart is in a directory called catalog and phpbb3 is in a directory called forum. Both these are in the site root.
After a few trips round the block getting the path right in catalog/includes/config.php [define('DIR_WS_PHPBB', '/var/www/vhosts/www.motorhomeski.com/httpdocs/forum/');] I tested the creation of users on the forum via Zen Cart create account. All went well and I was able to log in using the nick name and password entered during the creation of the Zen Cart account.
The site recently went live and as soon as the first users began signing up I got reports that people couldn't log into the forum using the username and password the entered when creating the Zen account, though they could log into Zen Cart OK.
I did some rooting round and, to cut a long story short, the problem seems to be with the use of upper case characters in the forum username (nick name). If the chosen username for the forum is entered all lower case [my_username] then there isn't a problem. If uppercase chracters are used [My_UserName] then it is not possible for the user to log in and the admin gets "The requested user does not exist." when trying to access the user .
The reason for this is that the username gets entered into 2 rows in the phpbb_users table; username and username_clean. When creating an account vis the forum registration the chosen username [My_UserName] gets entered into the row 'username' and the lowercase version [my_username] gets entered into the row 'username_clean'.
When creating an account on the forum via Zen Cart this doesn't happen and the chosen username [My_UserName] gets entered into both rows. PhpBB is not happy with this.
Solution.
In <zen_dir>/includes/classes/class.phpbb.php, around line 183, find:
Code:
$sql = "insert into " . $this->phpBB['users_table'] . "
(user_id, group_id, username, username_clean, user_password, user_email, user_email_hash, user_regdate)
values
('" . (int)$user_id . "', " . $this->groupId . ", '" . $nick . "', '" . $nick . "', '" . md5($password) . "', '" . $email_address . "', '" . crc32(strtolower($email_address)) . strlen($email_address) . "', '" . time() ."')";
Change it to:
Code:
$sql = "insert into " . $this->phpBB['users_table'] . "
(user_id, group_id, username, username_clean, user_password, user_email, user_email_hash, user_regdate)
values
('" . (int)$user_id . "', " . $this->groupId . ", '" . $nick . "', '" . strtolower($nick) . "', '" . md5($password) . "', '" . $email_address . "', '" . crc32(strtolower($email_address)) . strlen($email_address) . "', '" . time() ."')";
Changing the second '" . $nick . "' to '" . strtolower($nick) . "' means the chosen username [My_UserName] goes into the row 'username' and the lower case version [my_username] goes into the row 'username_clean'.
I have tested this and it seems to work OK. Let me know if it doesn't work for you.
Veronika7747 asked regarding restricting phpBB to only Zen Cart registered users.
The solution I am using for this is to set Account Activation in the ACP User Registration Settings to Disable. This removes the 'Register' link. So people were not lost I put a line on the board masthead 'To register for this forum Create an account on our shop.' where 'Create an account on our shop' is a link to the sign-up page on the shop.
jestcoun mentioned regarding the double slashes in the link to the forum from the store. I have noted this also on the link that appears in the 'Information' sidebox when the phpBB link is set to true, though the link in the sitemap is correct. No elegant solution yet but the brute force is:
In <zen_dir>/includes/modules/sideboxes/information.php, around line 29, find:
Code:
$information[] = '<a href="' . zen_href_link($phpBB->phpBB['phpbb_url'] . FILENAME_BB_INDEX, '', 'NONSSL', false, '', true) . '" target="_blank">' . BOX_BBINDEX . '</a>';
In the case your furum is in the directory 'forum' in the site root, replace it with:
Code:
$information[] = '<a href="http://<your_site_name>/forum/index.php" target="_blank">Forum</a>';
In the case your forum is in directory that is not in the root or is in a directory with another name, modify the path according your setup.
Hope this helps.
Les.
http://www.motorhomeski.com
Bookmarks