Support » Plugin: WP w3all phpBB » Doesnt Work

  • Resolved mrmoh

    (@mrmoh)


    I have Spent alot time with this Plugin now, trying to get the installation done properly. First after setting up the Config.php i couldnt log into my WordPress Acc at all anymore, fine i noticed the disclaimer regarding usernames and made sure email / username is exactly the same. If i Set evrything up without Linking the Admin ID 1 Account to to ID 2 on PhpBB, it shows as if working, nothing works however, admin still shows up for missing in phpbb3 db same as any other user.
    When trying to Copy Users from WP to php i get this error + telling me the User was overriden, which is wrong, nothing happend.

    Invalid argument supplied for foreach() in E:\xampp\htdocs\www\wp-content\plugins\wp-w3all-phpbb-integration\views\wp_w3all_users_to_phpbb.php line 109

    the descriptions are horrible, i saw mentioned that the developer isnt native english speaker, however “INFO: you are logged in WordPress as admin UserID 1 and the userID 1 exist in WordPress” its utterly unclear how its relevant info that IF you are logged in in WORDPRESS as userID1 and userID1 exists in wordpress … ?!?!?!
    strongly assume this is meant to say exists in phpbb but yea.. somewhat important
    not the only case of contradictions in Instructions, im not sure what other ppl used to make sense of this, maybe however its just broken.

    So my Question : Does this even work ? Any reason it wouldnt work? Phpbb even shares the same DB with a different prefix, nonetheless not able to find any phpbb users

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author axew3

    (@axewww)

    Hello! I’m sorry for my English. I know i know.

    Ok let try if nobody else will try to help here.

    Take so for good this instead:

    if the default install admin UserID 2 in phpBB does not exist and you’re installing this plugin by using the default WordPress admin UserID 1, then choose to not associate/link the WP userID 1 or you’ll not be able to re-login into WordPress with the WP admin userID 1.

    Mean that if you’re logged as wp admin default install user (id 1), then you need to have into phpBB the related installer phpBB user with id 2 in phpBB (the phpBB default install user) active and existent.
    If not, choose to activate the installation without linking id1 in wp and id 2 in phpBB, and check related option.

    When trying to Copy Users from WP to php i get this error + telling me the User was overriden, which is wrong, nothing happend.

    Invalid argument supplied for foreach() in E:\xampp\htdocs\www\wp-content\plugins\wp-w3all-phpbb-integration\views\wp_w3all_users_to_phpbb.php line 109

    The user isn’t overwritten, it is in case overwritten his email and password if there is another with same username in phpBB.
    How many users you need to transfer into phpBB before the integration start, and when you get this error message? When all users processed as i assume?

    p.s note also that any transferred user from wordpress into phpBB WILL NEED to reset the password to correctly re-login.
    Also, may clean all cookies on browser if still something wrong

    • This reply was modified 10 months, 1 week ago by axew3.
    • This reply was modified 10 months, 1 week ago by axew3.

    Im trying to just copy one user i created for testing this out.

    it is to assume that the error is triggered from this user then since its the only one showing up as well

    heres a screen from the phpbb _user table

    https://i.imgur.com/pAqGYUi.png

    here from the wp_users table

    https://i.imgur.com/WFdJiPm.png

    https://i.imgur.com/JcQ5ol6.png

    linking simply does not work for me even tho they are indeed 100% similiar, even took out the Admin -> admin uppercase difference.

    to me it seems more like a general issue, there is no difference at all if i put wrong config.php values in or not , using the Phpbb root config file MUST be correct though, obviously when the forum itself works

    • This reply was modified 10 months, 1 week ago by mrmoh.
    Plugin Author axew3

    (@axewww)

    Ok, it has been tested also with no users, but only wp admin and the process work fine here. In any case, since you have no users to transfer from wp into phpBB, because you only have the wp install admin ID1 in wordpress, then you have to not do this step.

    But in any case it’s strange the error you get.
    Are you on plugin 1.9.8?

    You say you installed phpBB and wp on same database.
    I so just hope that this is not the issue.
    And should not if all the rest work fine (a last posts widget for example).
    This is it?

    The plugin code connect to phpBB database, by opening another sql connection, may some conflict come out if in this condition (phpBB wp on same db)?
    Should not, but in this case, the double connection would be not necessary, since tables are all on same database.
    The plugin could be so adapted to switch and use single connection in this case.
    I will take a look to implement this scenario on code.

    last post widget or [w3allforumpost id=”3″] doesn’t work either. Showing there is no Post..

    You should have at least made it so, that it checks if the connection is available before actually activating the plugin and possibly removing the option to log in for ID 1 when ID2 cant be found even tho it’s supposed to link it. Like I said before there is absolutely NO difference at all if I put a config.php in where all strings are empty. The only thing the plugin is actually checking on is the “Phpinstalled” stuff…

    As I said, I’m using the original root config.php of my phpbb installation as a path, my Forum works just fine, no issues at all, WordPress still sees no users, no post/threads, nothing.

    At this point, I’m wondering if I should actually spend more time trying to figure out what stops it from working, or if I should just write a new plugin for the same purpose .. Not really convinced so far that this implementation is properly done. The only idea like you mentioned already as well is that there is an issue with it having the same DB but different table prefixes

    also saw

    $w3all_dbms = ''; // maybe required
    $w3all_dbhost = 'required value here';
    $w3all_dbport = ''; // maybe required

    in the unused custom config.php file, im using db port 3307, i hope the “maybe required” refers to it not being required to set if its == 3306

    anyway, this is the config im using

    // phpBB 3.2.x auto-generated configuration file
    // Do not change anything in this file!
    $dbms = 'phpbb\\db\\driver\\mysqli';
    $dbhost = '127.0.0.1';
    $dbport = '3307';
    $dbname = 'cms';
    $dbuser = 'root';
    $dbpasswd = 'pw';
    $table_prefix = 'forum_';
    $phpbb_adm_relative_path = 'adm/';
    $acm_type = 'phpbb\\cache\\driver\\file';
    
    @define('PHPBB_INSTALLED', true);
    // @define('PHPBB_DISPLAY_LOAD_TIME', true);
    @define('PHPBB_ENVIRONMENT', 'production');
    // @define('DEBUG_CONTAINER', true);
    
    Plugin Author axew3

    (@axewww)

    I tested in any way and it’s working fine.

    in the unused custom config.php file, im using db port 3307, i hope the “maybe required” refers to it not being required to set if its == 3306

    ‘maybe required’, will be may removed (i put hints may thinking to more advanced codes additions in mind, while coding nightmares), so do not take care, since in this case, to connect to another database port by using the wordpress class, you’ll need to do this instead:

    MySQL Alternate Port
    If your host uses an alternate port number for your database you’ll need to change the DB_HOST value in the wp-config.php file to reflect the alternate port provided by your host.
    For localhost:
    define( ‘DB_HOST’, ‘127.0.0.1:3307’ );
    or in some cases:
    define( ‘DB_HOST’, ‘localhost:3307’ );
    For specified server:
    define( ‘DB_HOST’, ‘mysql.example.com:3307’ );
    Replace 3307 with whatever port number your host gives you.

    see here:

    Editing wp-config.php

    This in case you need connect via a non default 3306 port, and the plugin code should work fine too i suppose.

    Unique values into phpBB config that really are needed and used are:

    $dbhost = ‘127.0.0.1’;
    $dbname = ‘cms’;
    $dbuser = ‘root’;
    $dbpasswd = ‘pw’;
    $table_prefix = ‘forum_’;

    Yes a connection check and warning in case it is not successfully working can be added with easy, since all is there on code.

    So, you can check if connection succeed or not with a debug into this:

    file /wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php
    where this code:

    private static function w3all_db_connect(){
    
     global $w3all_config;
      $w3db_conn = new wpdb($w3all_config["dbuser"], $w3all_config["dbpasswd"], $w3all_config["dbname"], $w3all_config["dbhost"]);
    	return  $w3db_conn;
    }

    with plugin active, what the value of $w3db_conn it return?
    Can you check this?

    The wordpress install is on the same db , meaning the same port.
    It was installed using that Port so the config file already had
    define( ‘DB_HOST’, ‘127.0.0.1:3307’ );
    Not sure what my wp-config has to do with it when setting the port in another config file / its set and used by everything else.
    I tested as I said before

    $dbhost = ‘127.0.0.1’;
    $dbport = ‘3307’;

    with the original root phpbb config

    same result with custom
    $w3all_dbhost = ‘127.0.0.1’;
    $w3all_dbport = ‘3307’; // maybe required

    —–

    $w3all_dbhost = ‘127.0.0.1:3307’;
    $w3all_dbport = ”; // maybe required

    this works finally..

    maybe implement the usage of the port or change the description from
    $w3all_dbport = ”; // maybe required
    to
    $w3all_dbport = ”; // unused set via dbhost

    thanks for the help.

    Plugin Author axew3

    (@axewww)

    I will implement the db connection check to avoid more problems on plugin configuration and adding the hint as you suggest.

    It’s working now?
    Did you checked if the connection succeed with something like this?
    if you can, change the

    private static function w3all_db_connect(){
    
     global $w3all_config;
      $w3db_conn = new wpdb($w3all_config["dbuser"], $w3all_config["dbpasswd"], $w3all_config["dbname"], $w3all_config["dbhost"]);
    	return  $w3db_conn;
    }

    into this:

    private static function w3all_db_connect(){
    
     global $w3all_config;
      $w3db_conn = new wpdb($w3all_config["dbuser"], $w3all_config["dbpasswd"], $w3all_config["dbname"], $w3all_config["dbhost"]);
    	
    	var_dump($w3db_conn);
    	exit;
    	return  $w3db_conn;
    }

    reload browser,
    what it return?

    If you can help in any way to improve the plugin code or documentation, you’re of course welcome!

    • This reply was modified 10 months, 1 week ago by axew3.

    $w3all_dbhost = ‘127.0.0.1:3307’;
    $w3all_dbport = ”; // maybe required
    seems to work, i can find users in the phpbb now , rest should be working as intendend then.
    Im not home right now but from the looks of it, the port isnt used so makes sense that the connection returns as null or failed since those info wont work on my running 3306 port, which it probably defaults to if nothing is set.

    to use the config.php file structure from phpbb one would need to concat the 2 strings,
    $w3all_config[“dbhost”]
    and $w3all_config[“dbport”]
    into
    sting$dbhost
    wpdb::__construct( string $dbuser, string $dbpassword, string $dbname, string $dbhost )

    same for the usage of the root config file. I assume it doesnt came to attention because just using a db host without specifying :xxxx after it will default to 3306 making it as if the dbhost with dbport=3306 was indeed used.

    Plugin Author axew3

    (@axewww)

    private static function w3all_db_connect(){
    
     global $w3all_config;
     // check that the connection do not require specified db port
     // @mrmoh https://wordpress.org/support/users/mrmoh/
     $w3all_config["dbhost"] = empty($w3all_config["dbport"]) ? $w3all_config["dbhost"] : $w3all_config["dbhost"] . ':' . $w3all_config["dbport"];
     $w3db_conn = new wpdb($w3all_config["dbuser"], $w3all_config["dbpasswd"], $w3all_config["dbname"], $w3all_config["dbhost"]);
    
     return $w3db_conn;
    }

    whenever you find bugs and you can, please report, if you want to contribute in any way, even into another site that will be linked, please let know, thank you for hints and proposing easy solution!

    The code will be committed as soon and the plugin code patched with this.

    p.s if effect so i was little misunderstanding use of dbport var in this case.

    • This reply was modified 10 months, 1 week ago by axew3.
    • This reply was modified 10 months, 1 week ago by axew3.
    Plugin Author axew3

    (@axewww)

    The patch has been committed
    https://wordpress.org/support/topic/1-9-8-patches-log/

    Correctly connect to another port if it is required in phpBB.
    Add: display error message into plugin admin page, if (until) phpBB db connection fail, and set integration as NOT LINKED USERS in the while, to avoid configuration problems.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Doesnt Work’ is closed to new replies.