Forums / General Questions / Integrating PHPBB3 with Zencart

Integrating PHPBB3 with Zencart

Locked

Views: 41,750

Results 41 to 60 of 82
This thread is locked. New replies are disabled.
21 Jun 2008, 1:08 AM
#41
chuck avatar

chuck

Totally Zenned

Join Date:
Jul 2005
Posts:
255
Plugin Contributions:
0

Integrating PHPBB3 with Zencart

whoknowswhat:

I get an error...
[20-Jun-2008 15:21:27] PHP Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /class.phpbb.php on line 363

I get that from the zencart debug tool, sad thing is,** there is no line 363**.... It also makes my index.php show up blank.....

That sort of thing is symptomatic of having either bad files (bad upload) or you've created a PHP syntax error in one of your customizations.

21 Jun 2008, 9:07 AM
#42
deepiristo avatar

deepiristo

New Zenner

Join Date:
Feb 2008
Posts:
7
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

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:(

21 Jun 2008, 9:08 AM
#43
deepiristo avatar

deepiristo

New Zenner

Join Date:
Feb 2008
Posts:
7
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

felixh:

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 configure.php replace ```php
    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 phpbb3 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
  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 phpbb_config SET config_value = '{$user_id}' WHERE config_name = 'newest_user_id'";
		$this->db_phpbb->Execute($sql);
		$sql = "update phpbb_config SET config_value = '{$nick}' WHERE config_name = 'newest_username'";
		$this->db_phpbb->Execute($sql);
		$sql = "update phpbb_config 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);
      }
    }
  1. Enjoy your nicely integrated phpbb3 forum with zencart, and if you find better solution please let me know :smile:

You can find other zencart tips and tricks at my blog - ferolen.com/blog

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

25 Jun 2008, 10:29 PM
#44
whoknowswhat avatar

whoknowswhat

New Zenner

Join Date:
Jun 2008
Location:
MI, USA
Posts:
7
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

chuck:

That sort of thing is symptomatic of having either bad files (bad upload) or you've created a PHP syntax error in one of your customizations.

It very well could be, I'll give it another shot when I have time.....

4 Jul 2008, 1:23 PM
#45
kadesign avatar

kadesign

Totally Zenned

Join Date:
Feb 2005
Location:
New Jersey
Posts:
593
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

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;

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')]

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.

Any ideas?

Thanks,
Kelly

Kelly Ann
Raven Media, LLC

11 Jul 2008, 9:37 PM
#46
vypero avatar

vypero

New Zenner

Join Date:
Jun 2008
Posts:
7
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

deepiristo:

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

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.

31 Jul 2008, 11:48 PM
#47
nzinni avatar

nzinni

New Zenner

Join Date:
May 2008
Posts:
6
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

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:
define('DIR_WS_PHPBB', 'C:/your server/www/phpbb3/');  

with correct VIRTUAL path to your phpbb installation 'phpbb3/' (no leading /).

  1. Enable link to your phpbb3 from your zencart administrator. Inside your store configuration set the “Link to phpbb” to “true”.

  2. edit "class.phpbb.php" inside your .../includes/classes folders. Try to find phpbb_create_account function and replace with the following code.
    PHP 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'] . " 
               (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[B] " . $this->phpBB['config_table'] . "[/B]SET config_value = '{$user_id}' WHERE config_name = 'newest_user_id'"; 
       $this->db_phpbb->Execute($sql); 
       $sql = " update [B]" . $this->phpBB['config_table'] . "[/B]SET config_value = '{$nick}' WHERE config_name = 'newest_username'"; 
       $this->db_phpbb->Execute($sql); 
       $sql = " update[B] " . $this->phpBB['config_table'] . "[/B]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); 
     } 
   }  

Modified from work by deepiristo and Vypero. Tested with ZC 1.38a and phpBB 3.0.2:clap:

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.

10 Aug 2008, 5:58 PM
#48
xam avatar

xam

New Zenner

Join Date:
Apr 2008
Posts:
23
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

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 ;)

11 Aug 2008, 9:04 AM
#49
kylelondonuk avatar

kylelondonuk

New Zenner

Join Date:
May 2007
Posts:
30
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

nzinni:

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:

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:
>  ```
 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[B] " . $this->phpBB['config_table'] . "[/B]SET config_value = '{$user_id}' WHERE config_name = 'newest_user_id'"; 
        $this->db_phpbb->Execute($sql); 
        $sql = " update [B]" . $this->phpBB['config_table'] . "[/B]SET config_value = '{$nick}' WHERE config_name = 'newest_username'"; 
        $this->db_phpbb->Execute($sql); 
        $sql = " update[B] " . $this->phpBB['config_table'] . "[/B]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); 
      } 
    }  
```Modified from work by deepiristo and Vypero. Tested with ZC 1.38a and phpBB 3.0.2:clap:
> 
> 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.

Hi, I followed these instructions above but get the following error after creating a new account in Zen Cart:

   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']
  
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 <https://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
13 Aug 2008, 7:29 AM
#50
kylelondonuk avatar

kylelondonuk

New Zenner

Join Date:
May 2007
Posts:
30
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

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

16 Aug 2008, 2:01 AM
#51
ka678 avatar

ka678

New Zenner

Join Date:
Aug 2008
Posts:
4
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

Hello.

I'm also having trouble integrating my phpbb (v 3.0.0) forum along with my zencart (v 1.3.8a).

My phpbb forum was installed into the following directory:
/home/myserver/public_html/forum/

My zencart was intalled afterwards into the following directory:
/home/myserver/public_html/store/

Both were installed with fantastico and assigned separate databases.

I've made the changes you've suggested and the zencart registration requests for a forum nickname but the customer info does not transfer over to the phpbb tables. Zencart registration works fine. Could the installation and structure be causing the problem?

Thanks in advance for the help!

16 Aug 2008, 7:54 AM
#52
kylelondonuk avatar

kylelondonuk

New Zenner

Join Date:
May 2007
Posts:
30
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

hi,

this is a bit of a guess from me, but if PHPbb3 requires a virtual directory listing in your zen cart includes/configure.php file, and your setup iss how you say, then maybe the path to the forum should read:

define('DIR_WS_PHPBB', '../forum/');

then obviously if the phpbb tables are in a separate database you will need to make changes for that also. you could instead just copy and insert all of the phpbb tables (with phpbb_ prefix used) into the zen cart table, which would make using the changes listed in this topic much easier... then you'd just have to change your database settings in the phpbb folder: forum/config.php

hope this helps

20 Aug 2008, 6:29 PM
#53
vypero avatar

vypero

New Zenner

Join Date:
Jun 2008
Posts:
7
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

Hmmm... I am not sure whether the relative path will solve the issue. I have the same file structure just like ka678 but I setup with Simple Script rather than Fantastico.

I will have to try the relative path anyway. I just notice that if you use an absolute path, like this:

  define('DIR_WS_PHPBB', '/home/mydomain/public_html/forum/');

you will end up with a 'forum' link under 'information' sideboxes going to the wrong location. I will keep you posted.

21 Aug 2008, 8:05 PM
#54
vypero avatar

vypero

New Zenner

Join Date:
Jun 2008
Posts:
7
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

The relative path works and it will also fix the 'forum' link under 'information' sideboxes.

26 Aug 2008, 11:51 PM
#55
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

How do you get this to work from different databases?

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

2 Sep 2008, 6:16 PM
#56
szarin avatar

szarin

New Zenner

Join Date:
Aug 2008
Posts:
47
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

I have searched the faq's, looked at documentation and gone through some of the posts regarding the integration. I have tried doing the modifications but it is not working.

I used fantastico (my webhosting company's autoamted script for installing software) to install my store, at the time i did not choose to link the store and the forum together simply because i was new to Zen Cart and did not want to screw up my forum database.

I have now setup my store and im looking to get it integrated with my forums (i read its tougher this way... but thats how i do things heh)

i have modified the includes/configure.php

define('DIR_WS_PHPBB', '/forums/');

and the includes/classes/class.phpbb.php with

    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?
}
}

The nice thing i suppose is that i dont have any errors. However i do not have the integration i was hoping for. The users are not being created, they are not showing up on the main page of the forums.

i have also turned on the link in the admin area as well.

Store links
Forum Links

2 Sep 2008, 9:11 PM
#57
szarin avatar

szarin

New Zenner

Join Date:
Aug 2008
Posts:
47
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

update: i have been able to get the two to talk... i needed an to include the root path in the setup. I figured id try it as a long shot... and it worked.

Now, the next task... im gonna spend some time looking through the countless forums here, but if anyone knows the answer, please let me know heh....

At the bottom of my phpbb forums it lists the newest users, i know its trivial... but anyone know what i can have that reflect the new users from the store?

Thanks in advanced.

2 Sep 2008, 9:23 PM
#58
szarin avatar

szarin

New Zenner

Join Date:
Aug 2008
Posts:
47
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

update: i have been able to get my store and my existing board to talk, however the link is not correct in the Information Sidebox. I think im just gonna hardcode the link. I know the problem lies with the pathing of the " define('DIR_WS_PHPBB', '/forums/'); " line in the configure.php .... If they are talking i can at least hard code it.

I noticed that the latest member info at the bottom of the forums did not get updated. Can i get some clarification, is that suppose to happen? or have ppl modified more files either with Zen Cart or phpBB forums to get that work together? I think its a neat bridge between the two. I will search the forums on how to do that, but if anyone knows a url of a walk through or brief instructions on what i need to do that would be awesome.

grrrr... i hate that 7 min time limit... i can't keep my thoughts organized enough to make changes under those restrictions... i mean come on... ive been infront of my computer for 15 hours straight and my eyes cant even focus lol....

Store Link
Forum Link

3 Sep 2008, 2:18 AM
#59
jvalent avatar

jvalent

New Zenner

Join Date:
Feb 2008
Posts:
68
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

Hi all,

I have followed all the steps outlined in this thread and I get nothing. Nothing happens. One thing I am stumped on is that there is no place to enter a username when you are registering within ZEN and PhpBB requires a username?

If anyone can offer any help I would appreciate it. I have spent over 4 hours now trying to figure this out.

Someone mentioned a link in the information bar, I don't have that either.

Link to my site is: https://www.togentertainment.com

Thanks

Jeff

3 Sep 2008, 4:25 AM
#60
szarin avatar

szarin

New Zenner

Join Date:
Aug 2008
Posts:
47
Plugin Contributions:
0

Re: Integrating PHPBB3 with Zencart

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.

  1. 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".

  1. 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)

  1. 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.