Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Posts
    350
    Plugin Contributions
    0

    Default Zen Cart and PHPBB integration problem resolved

    This is just a heads up for anyone who was having a problem with integration since the 1.2.7 upgrade of Zen Cart, like I was. Nothing I did solved the issue. I tried all of the suggestions, including having both Zen Cart and PHPBB in the same database. None of it worked.

    Here is what worked.

    1. I installed a fresh, unedited copy of BOTH Zen Cart and PHPBB (I've tried this now both ways, using separate databases and just separate table prefixes in the same database, it works in both cases), making sure I had the latest version of both before proceeding any further. I was up to date, so....

    2. I tested the integration by entering several new members to the cart. They all showed up as new forum members. So far, so good.

    3. I copied ALL of the database information from the already existing databases for both into the new database(s), but I only imported the data, not the structure (this was the problem, something in the structure of one of these pieces of software was conflicting with the other. I have no idea what it was.) After getting past the "Duplicate entry" issue because I was copying myself as admin over the existing admin, also myself, (as Homer would say, "DOH!"), I managed to swap over all of the data from the cart and the forum into the new database. This resolved all of my previous issues with integration and it has been working fine for a few weeks now.

    I also noticed a possible reason for my initial problem. When I went back to playing with the old cart and forum, which were still both installed and working (except for the integration issue) on the website where this problem was detected originally, I noticed that if I rolled back the versions of Zen Cart and tried upgrading again, I got several SQL error messages during the upgrades. If I went into the database and checked, the updates I could look at were successful, yet the page kept tossing errors. I checked the SQL before and after the upgrades (I had several copies of the database in various stages of upgrading, so I could see side-by-side what was going on) and the chenges were definitely being made... The only problem was, for some reason, one of the upgrades neglected to add one new table, so each time I ran an upgrade, it tried to write into that table, which didn't exist. Going directly into the database gave me the chance to spot the missing table and also allowed me to create it since the upgrade wasn't doing it... For some reason, the error messages were not giving me that clue. They usually do that.

    I went way back to 1.2.6 (or older, I forget now) and started over. I must have missed an upgrade along the way the first time, because now both the old and the new system are working fine. Maybe in the future, you can add levels to the upgrade scripts like PHPBB does so those of us that miss an upgrade or three can jump to the current level instead of having to install each upgrade until we reach the latest version? I won't let it happen again, but I'm not the only one who missed an upgrade, I'm sure.

    One other thing I noticed. If I run the SQL patches from the admin panel, the system adds a second zen_ prefix to the new tables it creates. For example, the SQL error table zen_upgrade_exceptions becomes zen_zen_upgrade_exceptions. I have to go into the database and remove the extra zen_ prefix from any new table or the cart does not get upgraded. If I run the SQL script through phpMyAdmin, it does not add the extra zen_ prefix. The admin panel SQL upgrade does not change any of the existing tables, only tables that are created during the upgrade. It's not a problem for me since I know how to get around it now, but it was a bit confusing at first. I just run all upgrade scripts through phpMyAdmin now. Problem solved.

    I hope some of this helps someone who may be arm-wrestling with integration like I was.
    Ripper
    Oz Website Services
    www.oz-web.net

  2. #2
    Join Date
    Jan 2004
    Posts
    60,178
    Blog Entries
    4
    Plugin Contributions
    139

    Default Re: Zen Cart and PHPBB integration problem resolved

    What an adventure.

    I'm guessing that there was some sort of permissions issue preventing the table from being created as intended. Either that or something peculiar with how the DB_PREFIX was being handled through the process.

    As to the SQLPatches comments... it normally doesn't operate as you described.
    1. Upgrades were *never* intended to be run via SQL Patches. Upgrades are intended to be run from zc_install only, esp so it can do error-checking and dependency-evaluation as it goes along.
    2. Table prefixes are only added based on the DB_PREFIX setting in your configure.php files.
    Sorry to hear you've had peculiar troubles. I'm just stating for the record that a future reader of this thread should note that the above measures should NOT normally be necessary, and to only attempt them as a last resort.

    Ripper, thanks for sharing the details ... I know you've had a very rough ride with this one. Very glad to hear it's working again.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.



  3. #3
    Join Date
    Oct 2006
    Posts
    16
    Plugin Contributions
    0

    Default Re: Zen Cart and PHPBB integration problem resolved

    I'm on Zencart 1.3.6 and for quite a while, I've been having a ridiculous time trying to get phpBB2 to be integrated but couldn't. Tried all the helpful suggestions ard the forums but nothing worked. Pretty much the same problem what a lot of people seems to be having.
    I finally resorted to do a painful require-by-require trace of it all and I've finally got mine to work. But the cause is so ridiculous that it's quite funny (it would be hilarious if I didn't stay up whole night for this).
    I'm not sure if all the problems out there are related to this (I actually doubt it), but hopefully this helps someone skip what I just went thru tonight.

    So, the problem is kinda like what a lot of people are having ard here. Forum link doesn't appear, nick not in register page. Nothing I did with configuration.php worked.

    Started tracing thru all the require() back and forth. The problem it seems for me is that the forum link and nick field doesn't appear because no matter what I do, my phpbb installation fail the tests in the phpbb class (In my installation of zc, there's a class.phpbb.php AND a class.phpBB.php. I assumed that it's just old fileset left over but the phpbb class i'm talking about is in class.phpbb.php).
    I finally narrow it down in class.phpbb.php , to around line 75 - 79.

    Code:
              if (substr($line,0,1)!='$') continue;
              if (substr_count($line,'"')>1) $delim='"';
              if (substr_count($line,"'")>1) $delim="'"; // determine whether single or double quotes used in this line.
              $def_string=array();
              $def_string=explode($delim,trim($line));
              if (substr($line,0,7)=='$dbhost') $this->phpBB['dbhost'] = $def_string[1];
              if (substr($line,0,7)=='$dbname') $this->phpBB['dbname'] = $def_string[1];
              if (substr($line,0,7)=='$dbuser') $this->phpBB['dbuser'] = $def_string[1];
              if (substr($line,0,9)=='$dbpasswd') $this->phpBB['dbpasswd'] = $def_string[1];
              if (substr($line,0,13)=='$table_prefix') $this->phpBB['table_prefix'] = $def_string[1];
    It appears that although the class could find the config.php of phpbb very well, it is unable to extract the database login data. And therefore, unable to connect and failing the installation tests.
    I eventually realise it is because the string functions are all acting quite odd,

    Code:
    if (substr($line,0,1)!='$') continue;
    was evaling to TRUE all the time?? And thus bypassing all the assignments.
    And when I comment that out, the if statements all eval funny, giving false all the time?
    I got tired and tried hardcoding the database data into the variables and it worked perfectly.

    I'm certain there's a perfectly logical explaination to this but right now, it doesn't matter so much to me. I will probably come back and see what exactly it is about these string functions that's not right (I am guessing it's just some escape character thing), but right now, i got the forum to run, which is all I want for now.

    Hopefully this is of some usefulness.


    Cheers,
    Aloy

  4. #4
    Join Date
    Feb 2007
    Posts
    215
    Plugin Contributions
    0

    Default Re: Zen Cart and PHPBB integration problem resolved

    iv got the nick name to appear on the acount page and it was working all fine before.

    But now for some reason when members sign up and put the nick name in the forum it doesnt recognise. Netiher has the account been made in phpbb admin.

    www.unikids.co.uk/zencart

    What am i doing wrong??

  5. #5
    Join Date
    Feb 2007
    Posts
    215
    Plugin Contributions
    0

    Default Re: Zen Cart and PHPBB integration problem resolved

    got it working..

    silly mistake..i was basically creating accounts with the same email address but diff username..

    and phpbb doesnt like the idea that 2 users can have the same email address..simple

  6. #6
    Join Date
    Mar 2008
    Posts
    2
    Plugin Contributions
    0

    Default Re: Zen Cart and PHPBB integration problem resolved

    phpbb3 and zencart 3.8
    add this to the phpbb class on zencart

    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 = "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() ."')";
            
    $sql "insert into " $this->phpBB['users_table'] . "
                    ( username,username_clean, user_password, user_email, user_regdate, user_passchg, group_id, user_permissions, user_sig, user_occ, user_interests, user_email_hash)
                    values
                    ( '" 
    $nick "','" $nick "', '" md5($password) . "', '" $email_address "', '" time() . "', '" time(). "', 2, '', '', '', '', '" crc32(strtolower($email_address)) . strlen($email_address) . "')";
            
    $this->db_phpbb->Execute($sql); 
            

    //could do a check here to see if Insert_ID() matches $user_id...

        
    $sql "SELECT user_id, username, user_colour
            FROM " 
    $this->phpBB['users_table'] . "
            WHERE user_type IN ('0', '3')
            ORDER BY user_id DESC LIMIT 1"
    ;
        
    $phpbb_newest_user $this->db_phpbb->Execute($sql);

        
    $sql "UPDATE " $this->phpBB['config_table'] . "
            SET config_value = '" 
    $phpbb_newest_user->fields['user_id'] . "'
            WHERE config_name = 'newest_user_id'"
    ;
        
    $this->db_phpbb->Execute($sql);
        
        
    $sql "UPDATE " $this->phpBB['config_table'] . "
            SET config_value = '" 
    $phpbb_newest_user->fields['username'] . "'
            WHERE config_name = 'newest_username'"
    ;
        
    $this->db_phpbb->Execute($sql);    
        
        
    $sql "UPDATE " $this->phpBB['config_table'] . "
            SET config_value = '" 
    $phpbb_newest_user->fields['user_colour'] . "'
            WHERE config_name = 'newest_user_colour'"
    ;
        
    $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);

    // @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();
          
    echo   $sql "INSERT INTO " $this->phpBB['user_group_table'] . " (user_id, group_id, user_pending)
                    VALUES ("
    .$phpbb_newest_user->fields['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?
          
    }
        } 

  7. #7
    Join Date
    Jun 2009
    Posts
    11
    Plugin Contributions
    0

    Default Re: Zen Cart and PHPBB integration problem resolved

    Quote Originally Posted by remtools View Post
    phpbb3 and zencart 3.8
    add this to the phpbb class on zencart
    Hi,

    Thanks for this, which file name is it ?

    Thanks

 

 

Similar Threads

  1. Linking Phpbb to zen cart
    By cymric in forum Basic Configuration
    Replies: 15
    Last Post: 1 Jun 2006, 04:30 PM
  2. Configuring Zen To Work With Phpbb
    By DrByte in forum General Questions
    Replies: 168
    Last Post: 7 May 2006, 12:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •