Testing phpBB4 and the integration code

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Maximum filesize per attachment: 1 MiB.

Expand view Topic review: Testing phpBB4 and the integration code

Re: Testing phpBB4 and the integration code

by axew3 » Mon Oct 13, 2025 7:48 pm

I liked to load an online example so to show a raw test of vertical views (done in the raw way you'll see) and the prototype of a Posts Slider (like Discourse) in phpBB4. Do not be bad on judge it, i will re-code all from scratch asap, And do not look to the style or how it is positioned: of course this aspect has not been considered!
Works fine also on phpBB3 and probably 2 without any change

Check it
https://www.axew3.com/www/phpbb4/viewtopic.php?t=2

ps probably on some iOS (if i do not wrong remember at the time i coded this) will not fully work about the slider because the code require to be finalized/adjusted in a specific instruction (maybe). Not sure, i do not remember, if i already fixed it

Re: Testing phpBB4 and the integration code

by axew3 » Sun Oct 12, 2025 8:14 am

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.

Re: Testing phpBB4 and the integration code

by axew3 » Sun Oct 12, 2025 7:43 am

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

Re: Testing phpBB4 and the integration code

by axew3 » 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.

Re: Testing phpBB4 and the integration code

by axew3 » Sat Oct 11, 2025 8:34 am

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

Re: Testing phpBB4 and the integration code

by axew3 » Thu Oct 09, 2025 4:43 pm

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

Top