I have made this changes, but its not working. please HELP.
Is there any need to make changes in classes.phpbb.php file
Please tell me all the information to integrate PHPBB with zencart step by step if possible.
Thanks
I just added a forum to my site again and tried integrating with my Zen Cart. I changed my config files to show where my forum is located and I "turned on" the switch in my admin section. But...when I create a test account to check for the integration I ma getting the following error;
I tried it with a few different names just in case there is actually someone that used the same nick name back when I had the forum before and it does the same thing.1062 Duplicate entry '' for key 2
in:
[insert into phpbb_users (user_id, username, user_password, user_email, user_regdate) values ('56', 'josiej', '791ea51bfed310e8a28379a7cef11362', '[email protected]', '1215149682')]
Any ideas?
Thanks,
Kelly
In case you have not figure out. Felixh hardcodes his config table name which you might not be the same naming convention with yours. Here is what you can do:
Replace
"update phpBB_config SET config value ...
to
"update " . $this->phpBB['config_table'] . " SET config_value ...
There are total of three lines that you need to change.
Hope that works out for you.
*Bolded items in red are changes from original posts*
These are steps to integrate zencart 1.3.8 with phpbb3. This step will ensure your phpbb3 display appropriate Total number of user and Newest Member nickname at the board index.
1. Install your phpbb3 and ensure it runs perfectly.
2. Edit your includes/configure.php replace
PHP Code:
with correct VIRTUAL path to your phpbb installation 'phpbb3/' (no leading /).Code:define('DIR_WS_PHPBB', 'C:/your server/www/phpbb3/');
3. Enable link to your phpbb3 from your zencart administrator. Inside your store configuration set the “Link to phpbb” to “true”.
4. edit "class.phpbb.php" inside your .../includes/classes folders. Try to find phpbb_create_account function and replace with the following code.
PHP Code:
Modified from work by deepiristo and Vypero. Tested with ZC 1.38a and phpBB 3.0.2Code: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, group_id, username, username_clean, user_password, user_email, user_regdate) values ('" . (int)$user_id . "',2, '" . $nick . "', '" . $nick . "', '" . md5($password) . "', '" . $email_address . "', '" . time() ."')"; $this->db_phpbb->Execute($sql); $sql = " update " . $this->phpBB['config_table'] . "SET config_value = '{$user_id}' WHERE config_name = 'newest_user_id'"; $this->db_phpbb->Execute($sql); $sql = " update " . $this->phpBB['config_table'] . "SET config_value = '{$nick}' WHERE config_name = 'newest_username'"; $this->db_phpbb->Execute($sql); $sql = " update " . $this->phpBB['config_table'] . "SET config_value = config_value + 1 WHERE config_name = 'num_users'"; $this->db_phpbb->Execute($sql); $sql = "INSERT INTO " . $this->phpBB['user_group_table'] . " (user_id, group_id, user_pending) VALUES ($user_id, 2, 0)"; $this->db_phpbb->Execute($sql); } }
Note that phpbb3 is installed as a subdirectory (store/phpbb3) within zencart with a link of http://www.example.com/forums.
Separate installs will still need to provide the PHYSICAL path.
Last edited by nzinni; 1 Aug 2008 at 12:53 AM.
Is it possible to do exactly the opposite ???
I mean is it possible for users accessing my forum first to register in the forum and make that registration active in my ZenCart site ?
ho.. and thanx for the tip ... it worked for me ;)
Hi, I followed these instructions above but get the following error after creating a new account in Zen Cart:
[FONT=Times New Roman]1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= '54' WHERE config_name = 'newest_user_id'' at line 1
in:
[ update phpbb_configSET config_value = '54' WHERE config_name = 'newest_user_id'][/FONT]
I've looked at that section of the code in class.phpbb.php but cannot see a problem. I've also checked the MySQL database, and indeed the newest_user_id value in the phpbb_config table is still set to 2, instead of 54 which i guess is what it should be, according to the error message. i actually only have 2 users at the moment, but in the mySql phpbb_users table there are lots of users for search engines etc that take up 52 rows, is that normal?
any help would be greatly appreciated! my forum is at www.purlalpacadesigns.com/pads and i have updated my zen cart includes/configure.php file with the firtual directory for phpbb (just "pads/" without the first backslash.
thanks for any help!
Kyle
Hi, i found out what my problem was with the class.phpbb.php edits listed above. there was simply a SPACE [ ] missing before the word "SET" on three lines of the create account function here:
$sql = " update " . $this->phpBB['config_table'] . " SET config_value = '{$user_id}' WHERE config_name = 'newest_user_id'";
$this->db_phpbb->Execute($sql);
$sql = " update " . $this->phpBB['config_table'] . " SET config_value = '{$nick}' WHERE config_name = 'newest_username'";
$this->db_phpbb->Execute($sql);
$sql = " update " . $this->phpBB['config_table'] . " SET config_value = config_value + 1 WHERE config_name = 'num_users'";
the version i have typed in above includes the space, before it looked like this:
"SET
hope that helps people!
kyle
Bookmarks