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.
[quote=axew3 post_id=7069 time=1760204519 user_id=48]
[color=#BF0040][size=200]Download 3.0.4[/size][/color]
The [b][i]w3_phpbb_ban[/i][/b] has been changed to be very simple when it is called/fired into phpBB4.
[code] #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[/code]
[b]3.0.4 has been released and is fully compatible with phpBB4 so that the attachment into this post has been removed.[/b]
[/quote]
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.