Skip to content

Commit

Permalink
Merge pull request #183 from iMattPro/updates
Browse files Browse the repository at this point in the history
Maintenance
  • Loading branch information
iMattPro committed Jul 5, 2024
2 parents 8a6b887 + 59046aa commit 35b22e6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
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', '<');
}
}

0 comments on commit 35b22e6

Please sign in to comment.