Skip to content
This repository was archived by the owner on Oct 22, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Adds a page listing currently banned users.

## Requirements

- phpBB 3.3.0 or later
- phpBB 3.3.19 or later
- PHP 8.0 or later

## Installation
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"extra": {
"display-name": "Ban List",
"soft-require": {
"phpbb/phpbb": ">=3.3.0,<4.0.0@dev"
"phpbb/phpbb": ">=3.3.19,<4.0.0@dev"
}
}
}
37 changes: 33 additions & 4 deletions ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,45 @@
class ext extends \phpbb\extension\base
{
/**
* Check whether or not the extension can be enabled.
* Check whether the extension can be enabled.
* The current phpBB version should meet or exceed
* the minimum version required by this extension.
*
* Requires phpBB 3.3.0 and PHP 8.0.0
* @return bool|array
* @access public
*/
public function is_enableable()
{
$config = $this->container->get('config');
$enableable = $this->check_phpbb_version() && $this->check_php_version();

return phpbb_version_compare($config['version'], '3.3.0', '>=') && version_compare(PHP_VERSION, '8.0.0', '>=');
if (!$enableable)
{
$language = $this->container->get('language');
$language->add_lang('install_banlist', 'phpbbmodders/banlist');

return $language->lang('BANLIST_NOT_ENABLEABLE');
}

return $enableable;
}

/**
* Require phpBB 3.3.19
*
* @return bool
*/
public function check_phpbb_version()
{
return phpbb_version_compare(PHPBB_VERSION, '3.3.19', '>=');
}

/**
* Require PHP 8.0
*
* @return bool
*/
public function check_php_version()
{
return PHP_VERSION_ID >= 80000;
}
}
42 changes: 42 additions & 0 deletions language/en/install_banlist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
*
* Ban List extension for the phpBB Forum Software package
*
* @copyright (c) 2024, phpBB Modders, https://www.phpbbmodders.com/
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = [];
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, [
'BANLIST_NOT_ENABLEABLE' => 'Ban List could not be enabled. The minimum requirements of phpBB 3.3.19 and/or PHP 8.0.0 were not satisfied.',
]);
Loading