Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance #183

Merged
merged 3 commits into from
Jul 5, 2024
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
28 changes: 16 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
# START Basic Checks Job (EPV, code sniffer, images check, etc.)
basic-checks:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
include:
Expand All @@ -33,14 +33,14 @@ jobs:

steps:
- name: Checkout phpBB
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: phpbb/phpbb
ref: ${{ env.PHPBB_BRANCH }}
path: phpBB3

- name: Checkout extension
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: phpBB3/phpBB/ext/${{ env.EXTNAME }}

Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:

# START MySQL and MariaDB Job
mysql-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
include:
Expand Down Expand Up @@ -127,6 +127,8 @@ jobs:
db: "mysql:5.7"
- php: '8.3'
db: "mysql:5.7"
- php: '8.4'
db: "mysql:5.7"

name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}

Expand Down Expand Up @@ -156,14 +158,14 @@ jobs:

steps:
- name: Checkout phpBB
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: phpbb/phpbb
ref: ${{ env.PHPBB_BRANCH }}
path: phpBB3

- name: Checkout extension
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: phpBB3/phpBB/ext/${{ env.EXTNAME }}

Expand Down Expand Up @@ -240,7 +242,7 @@ jobs:

# START PostgreSQL Job
postgres-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
include:
Expand Down Expand Up @@ -270,6 +272,8 @@ jobs:
db: "postgres:14"
- php: '8.3'
db: "postgres:14"
- php: '8.4'
db: "postgres:14"

name: PHP ${{ matrix.php }} - ${{ matrix.db }}

Expand Down Expand Up @@ -301,14 +305,14 @@ jobs:

steps:
- name: Checkout phpBB
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: phpbb/phpbb
ref: ${{ env.PHPBB_BRANCH }}
path: phpBB3

- name: Checkout extension
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: phpBB3/phpBB/ext/${{ env.EXTNAME }}

Expand Down Expand Up @@ -354,7 +358,7 @@ jobs:

# START Other Tests Job (SQLite 3 and mssql)
other-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
include:
Expand Down Expand Up @@ -396,14 +400,14 @@ jobs:

steps:
- name: Checkout phpBB
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: phpbb/phpbb
ref: ${{ env.PHPBB_BRANCH }}
path: phpBB3

- name: Checkout extension
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: phpBB3/phpBB/ext/${{ env.EXTNAME }}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"extra": {
"display-name": "Advertisement Management",
"soft-require": {
"phpbb/phpbb": ">=3.3.2"
"phpbb/phpbb": ">=3.3.2,<4.0.0@dev"
},
"version-check": {
"host": "www.phpbb.com",
Expand Down
2 changes: 1 addition & 1 deletion event/main_listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function visual_demo()
*/
protected function views($ad_ids)
{
if ($this->config['phpbb_ads_enable_views'] && !$this->user->data['is_bot'] && count($ad_ids))
if ($this->config['phpbb_ads_enable_views'] && empty($this->user->data['is_bot']) && count($ad_ids))
{
$this->template->assign_vars(array(
'S_INCREMENT_VIEWS' => true,
Expand Down
3 changes: 2 additions & 1 deletion ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ext extends \phpbb\extension\base
*/
public function is_enableable()
{
return phpbb_version_compare(PHPBB_VERSION, '3.3.2', '>=');
return phpbb_version_compare(PHPBB_VERSION, '3.3.2', '>=')
&& phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '<');
}
}
Loading