Testing phpBB4 and the integration code

User avatar
axew3
w3all User
w3all User
Posts: 3020
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Testing phpBB4 and the integration code

Post by axew3 »

Just started testing
phpBB version 4 is on the way:
https://area51.phpbb.com/downloads/

this post is just to let you know that the integration code will so tested for compatibilities whenever someone like to test it also maybe integrated.

phpBB 4 database changes:
the
avatar_path
config_value
has been removed on phpBB4 so it require to be removed into the

Code: Select all

private static function w3all_get_phpbb_config(){
on file
class.wp.w3all-phpbb.php

since it is NOT used at all into the plugin code, it can be easily removed to accomplish with phpBB4 compatibility.

so that this

Code: Select all

$res = array( 'allow_autologin' => $a[0]->config_value,
                    'avatar_gallery_path' => $a[1]->config_value,
                    'avatar_path' => $a[2]->config_value,
                    'avatar_salt' => $a[3]->config_value,
                    'cookie_domain' => $a[4]->config_value,
                    'cookie_name' => $a[5]->config_value,
                    'default_dateformat' => $a[6]->config_value,
                    'default_lang' => $a[7]->config_value,
                    'load_online_time' => $a[8]->config_value,
                    'max_autologin_time' => $a[9]->config_value,
                    'newest_user_id' => $a[10]->config_value,
                    'newest_username' => $a[11]->config_value,
                    'num_posts' => $a[12]->config_value,
                    'num_topics' => $a[13]->config_value,
                    'num_users' => $a[14]->config_value,
                    'rand_seed' => $a[15]->config_value,
                    'rand_seed_last_update' => $a[16]->config_value,
                    'record_online_users' => $a[17]->config_value,
                    'script_path' => $a[18]->config_value,
                    'session_length' => $a[19]->config_value,
                    'version'  => $a[20]->config_value
                  );
will become this:

Code: Select all

$res = array( 'allow_autologin' => $a[0]->config_value,
                    'avatar_gallery_path' => $a[1]->config_value,
                    #'avatar_path' => $a[2]->config_value,
                    'avatar_salt' => $a[2]->config_value,
                    'cookie_domain' => $a[3]->config_value,
                    'cookie_name' => $a[4]->config_value,
                    'default_dateformat' => $a[5]->config_value,
                    'default_lang' => $a[6]->config_value,
                    'load_online_time' => $a[7]->config_value,
                    'max_autologin_time' => $a[8]->config_value,
                    'newest_user_id' => $a[9]->config_value,
                    'newest_username' => $a[10]->config_value,
                    'num_posts' => $a[11]->config_value,
                    'num_topics' => $a[12]->config_value,
                    'num_users' => $a[13]->config_value,
                    'rand_seed' => $a[14]->config_value,
                    'rand_seed_last_update' => $a[15]->config_value,
                    'record_online_users' => $a[16]->config_value,
                    'script_path' => $a[17]->config_value,
                    'session_length' => $a[18]->config_value,
                    'version'  => $a[19]->config_value
                  );
... following tests
User avatar
axew3
w3all User
w3all User
Posts: 3020
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Testing phpBB4 and the integration code

Post by axew3 »

Just activated the avatar widget: all works fine nothing to be changed. The code also run fine on creating users from WP into phpBB.

BUT

Code: Select all

[09-Oct-2025 16:53:35 UTC] WordPress database error Table 'phpbb4.phpbb_banlist' doesn't exist for query SELECT *
DO NOT EXIST ANYMORE also.

Let see how bans are now managed into phpBB 4...

seem it has been just renamed into `phpbb_bans`

??? well ok going to fix it
User avatar
axew3
w3all User
w3all User
Posts: 3020
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Testing phpBB4 and the integration code

Post by axew3 »

Compatible with the new coming phpBB4
WP phpBB plugin version 3.0.4 phpBB4 ready

pre 3.0.4 test release fix several bugs about phpBB3 integration (3.0.3 bugs i've find out while looking on code) and is phpBB4 ready!

Code: Select all

 function w3_phpbb4_ban($phpbb_uid = '', $uname = '', $uemail = ''){
has been updated to accomplish with the new phpBB4 ban way
User avatar
axew3
w3all User
w3all User
Posts: 3020
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Testing phpBB4 and the integration code

Post by axew3 »

Download 3.0.4

The w3_phpbb_ban has been changed to be very simple when it is called/fired into phpBB4.

Code: Select all

  #phpBB 4 START
  .......
  $banned = false;
  .......

  if($phpbb_config['version'][0] > 3) #phpBB 4
  { 
    $phpbb_ubans = $w3all_phpbb_connection->get_results("
    SELECT ban_id, ban_item, ban_end FROM ".$w3all_config["table_prefix"]."bans WHERE ban_userid = '$phpbb_uid'
    OR ban_userid = '0' AND ban_item = '$uemail'
    OR ban_userid = '0' AND ban_item = '$user_REMOTE_ADDR_sql'");

    if( empty($phpbb_ubans) ) return false;

    foreach($phpbb_ubans as $b){
      if( $b->ban_item == $uemail OR $b->ban_item  == $user_REMOTE_ADDR )
      {
        #eventual expired ban id
        if( $b->ban_end > 1 && $b->ban_end < $timenow )
        {
          $ban_ids_remove .= $b->ban_id.','; #collect expired
        }

        # check if the user is banned
        if( $b->ban_end > $timenow OR $b->ban_end < 1 )
        {
          $banned = true; #the user is banned
        }
      }
    }
 
    #clean up expired
    if( isset($ban_ids_remove) ){
     $ban_ids_remove = substr($ban_ids_remove, 0, -1);
     $w3all_phpbb_connection->query("DELETE FROM ".$w3all_config["table_prefix"]."bans WHERE ban_id IN($ban_ids_remove)");
    }
    
    if(!defined("W3BANCKEXEC")) define("W3BANCKEXEC", true);

    return $banned;

  }

  #phpBB 4 END
3.0.4 has been released and is fully compatible with phpBB4 so that the attachment into this post has been removed.
User avatar
axew3
w3all User
w3all User
Posts: 3020
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Testing phpBB4 and the integration code

Post by axew3 »

3.0.4 has been released and is fully compatible with the phpBB4.

https://wordpress.org/support/plugin/wp ... tegration/

Code: Select all

== Changelog ==

= 3.0.4 =
*Release Date - 12 Oct, 2025*
Fix: 'private static function verify_phpbb_credentials(){' so to not wrongly detect an user as banned, in certain cases
Fix: Shortcode – latest phpBB topics/posts in WordPress using Forums IDS does not work properly. Instead of the author of the post, “Guest” is displayed.
Add: the 3.0.4 plugin code is ready for phpBB4 ( https://www.axew3.com/w3/forums/viewtopic.php?t=2062 )
Fix: minor fixes
User avatar
axew3
w3all User
w3all User
Posts: 3020
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Testing phpBB4 and the integration code

Post by axew3 »

axew3 wrote: Sat Oct 11, 2025 5:41 pm Download 3.0.4

The w3_phpbb_ban has been changed to be very simple when it is called/fired into phpBB4.

Code: Select all

  #phpBB 4 START
  .......
  $banned = false;
  .......

  if($phpbb_config['version'][0] > 3) #phpBB 4
  { 
    $phpbb_ubans = $w3all_phpbb_connection->get_results("
    SELECT ban_id, ban_item, ban_end FROM ".$w3all_config["table_prefix"]."bans WHERE ban_userid = '$phpbb_uid'
    OR ban_userid = '0' AND ban_item = '$uemail'
    OR ban_userid = '0' AND ban_item = '$user_REMOTE_ADDR_sql'");

    if( empty($phpbb_ubans) ) return false;

    foreach($phpbb_ubans as $b){
      if( $b->ban_item == $uemail OR $b->ban_item  == $user_REMOTE_ADDR )
      {
        #eventual expired ban id
        if( $b->ban_end > 1 && $b->ban_end < $timenow )
        {
          $ban_ids_remove .= $b->ban_id.','; #collect expired
        }

        # check if the user is banned
        if( $b->ban_end > $timenow OR $b->ban_end < 1 )
        {
          $banned = true; #the user is banned
        }
      }
    }
 
    #clean up expired
    if( isset($ban_ids_remove) ){
     $ban_ids_remove = substr($ban_ids_remove, 0, -1);
     $w3all_phpbb_connection->query("DELETE FROM ".$w3all_config["table_prefix"]."bans WHERE ban_id IN($ban_ids_remove)");
    }
    
    if(!defined("W3BANCKEXEC")) define("W3BANCKEXEC", true);

    return $banned;

  }

  #phpBB 4 END
3.0.4 has been released and is fully compatible with phpBB4 so that the attachment into this post has been removed.
For what it worth to mention, the function code for phpBB4 actually do not will check like phpBB do, for a partial IP address to be banned or an entire email domain or subdomain, but just for the exact presented IP or email.
Post Reply