Skip to content
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
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
*.png binary
*.jpg binary
*.phar binary

tests/ export-ignore
.github/ export-ignore
.gitignore export-ignore
.gitattributes export-ignore
phpunit.xml.* export-ignore
README.md export-ignore
docs/images/ export-ignore
29 changes: 0 additions & 29 deletions .github/ISSUE_TEMPLATE/bug_report.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/epv-allowed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EPV findings this extension keeps on purpose, checked by the epv job in
# .github/workflows/tests.yml. One finding per line as EPV prints it, without
# "on line N", with paths relative to the extension; give the reason above it.

# ext.php reads phpBB's own serialized migration dependency lists when it moves
# an old nickvergessen/newspage install, with allowed_classes off, so no
# objects can be created.
Error: Using unserialize in /ext.php

# The post subject, poll question and edit reason are stored escaped. These
# calls escape them for the news page without escaping them twice
# (double_encode off), which utf8_htmlspecialchars() can't do.
Error: Using htmlspecialchars in /newspage.php
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint

# PHP syntax check on the lowest PHP version this extension supports and the
# newest one phpBB 3.3 supports. tests.yml runs the tests, code sniffer and
# EPV on phpBB 3.3 and 4.0.
on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
lint:
name: PHP ${{ matrix.php }} lint
runs-on: ubuntu-24.04
strategy:
matrix:
php: ['7.4', '8.4']
steps:
- uses: actions/checkout@v4

- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer:v2

- name: PHP syntax check
run: find . -name '*.php' -not -path './.git/*' -not -path './vendor/*' -print0 | xargs -0 -n1 php -l

- name: Validate composer.json
run: composer validate --no-check-all --no-check-publish
25 changes: 0 additions & 25 deletions .github/workflows/php-syntax.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Tests

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
# phpBB 3.3.x compatibility
call-tests-3-3-x:
name: Extension tests (phpBB 3.3.x)
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
with:
EXTNAME: phpbbmodders/newspage
# EPV runs in the epv job below instead
EPV: 0
PHPBB_BRANCH: '3.3.x'
RUN_FUNCTIONAL_TESTS: 0
PRIMARY_PHP_VERSION: '7.4'
PHP_VERSION_MATRIX: '["7.4", "8.0", "8.1", "8.2"]'

# phpBB 4.0 (master) compatibility
call-tests-master:
name: Extension tests (phpBB master / 4.0)
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
with:
EXTNAME: phpbbmodders/newspage
# EPV runs in the epv job below instead
EPV: 0
PHPBB_BRANCH: 'master'
RUN_FUNCTIONAL_TESTS: 0
PRIMARY_PHP_VERSION: '8.2'
PHP_VERSION_MATRIX: '["8.2", "8.3", "8.4"]'

# EPV (Extension Pre Validator), failing on any Fatal or Error finding not
# listed in .github/epv-allowed.txt
epv:
uses: phpbbmodders/.github/.github/workflows/epv.yml@v1
with:
EXTNAME: phpbbmodders/newspage
PHPBB_BRANCHES: '["3.3.x", "master"]'
57 changes: 0 additions & 57 deletions .travis.yml

This file was deleted.

69 changes: 43 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,57 @@
# NV Newspage Extension
# NV Newspage

An independent continuation of NV Newspage for [phpBB](https://www.phpbb.com/), maintained under phpbbmodders.
[![Tests](https://github.com/phpbbmodders/phpbb-ext-newspage/actions/workflows/tests.yml/badge.svg)](https://github.com/phpbbmodders/phpbb-ext-newspage/actions/workflows/tests.yml) [![Lint](https://github.com/phpbbmodders/phpbb-ext-newspage/actions/workflows/lint.yml/badge.svg)](https://github.com/phpbbmodders/phpbb-ext-newspage/actions/workflows/lint.yml)

## Compatibility
A news page that shows the latest topics from chosen forums, shortened to a set length, with monthly archives and categories.

The imported code targets phpBB 3.1. Work toward phpBB 3.3 support is planned; compatibility has not yet been implemented or verified. Do not install this development branch on a production board.
## Features

The original branches and release tags are preserved as historical upstream snapshots. They do not represent phpbbmodders releases or phpBB 3.3 support.
- A **News** page at `/news`, linked from the board's navigation bar with an icon you choose.
- Shows the first post of the newest topics in the forums you pick, with a set number of news per page and pages.
- Shortens long news to a set number of characters, with a "Read full news" link. Formatting is kept and no tag is cut in half.
- Visitors can filter the news by forum and by month, and open a single news item.
- Optional poster information (avatar, rank, profile fields), post buttons, attachments and moved topics.
- Shows in **Who is online** when someone is reading the news.
- Settings under **ACP → Extensions → Newspage**.

## Screenshots

## Description
<table>
<tr>
<td><a href="docs/images/screenshots/newspage-news.png"><img src="docs/images/screenshots/newspage-news.png" width="440" alt="News page"></a></td>
<td><a href="docs/images/screenshots/newspage-acp-settings.png"><img src="docs/images/screenshots/newspage-acp-settings.png" width="440" alt="ACP settings"></a></td>
</tr>
</table>

Adds an extra page to the board where a switchable number of news can be displayed.
The news texts can be shorten to a given number of characters.
Also the icons can be switched on/off (post icons, user icons)
Click an image for the full size. See the [screenshot gallery](docs/images/screenshots/README.md) for the rest.

## Requirements

## Development Installation
- phpBB 3.3.19 or later, including phpBB 4.0 (tested on its 4.0.0-a3 development version)
- PHP 7.4 or later (phpBB 4.0 itself needs PHP 8.2 or later), with the DOM extension

Clone into phpBB/ext/nickvergessen/newspage:
## Installation

git clone https://github.com/phpbbmodders/phpbb-ext-newspage.git phpBB/ext/nickvergessen/newspage
1. Copy the extension to `/ext/phpbbmodders/newspage`
2. In the Administration Control Panel, go to **Customise → Manage extensions**
3. Enable the **NV Newspage** extension
4. Choose the news forums under **ACP → Extensions → Newspage → Settings**

Set up the dependencies:
### Upgrading from `nickvergessen/newspage`

php composer.phar install --dev
This extension used to be installed as `nickvergessen/newspage`. Your settings carry over:

Go to "ACP" > "Customise" > "Extensions" and enable the "phpBB 3.1 NV Newspage Extension" extension.
1. Disable the old **NV Newspage** extension in the ACP. Do **not** delete its data.
2. Upload this version to `/ext/phpbbmodders/newspage` and enable it. The old install's migration history is moved to the new name automatically.
3. Delete the `/ext/nickvergessen/newspage` folder and purge the board cache.

If you disable the old extension from the command line (`bin/phpbbcli.php`) instead of the ACP, run `bin/phpbbcli.php cache:purge` before enabling the new one; the command-line disable doesn't clear the cache.

## List of events
The settings moved from the news page itself to the ACP. The News link's icon is a Font Awesome class: phpBB 3.3 uses Font Awesome 4.7 and phpBB 4.0 uses Font Awesome 6, so pick a name both have (the default, `fa-bullhorn`, works on both).

See the [documentation](docs/events.md) for a list of available php and template events.
## Events


## Testing

GitHub Actions checks PHP syntax. This does not establish phpBB runtime compatibility. The imported PHPUnit suite and Travis configuration target phpBB 3.1 and need updating before they can validate the 3.3 port.
The PHP and template events other extensions can use are listed in [docs/events.md](docs/events.md).

## TODO

Expand All @@ -47,15 +62,17 @@ Ideas not yet built, practical and speculative alike: [`docs/TODO.md`](docs/TODO
Contributions are welcome!

- **Bug reports**: [Open an issue](https://github.com/phpbbmodders/phpbb-ext-newspage/issues).
- **Everything else** (questions, feature requests, ideas, general discussion): [Use Discussions](https://github.com/phpbbmodders/phpbb-ext-newspage/discussions).
- **Everything else** (questions, feature requests, ideas, general discussion): [Use Discussions](https://github.com/orgs/phpbbmodders/discussions), or the [community forum](https://www.phpbbmodders.com/community/).
- Pull requests are welcome for bug fixes or discussed features.

## Acknowledgments

- Based on [nickv-phpbb/phpbb-ext-newspage](https://github.com/nickv-phpbb/phpbb-ext-newspage), originally developed by Joas Schilling (nickvergessen). Original history, authorship, and licensing are preserved.
- Code review and documentation assisted by [Codex](https://www.anthropic.com/Codex).

- Based on [nickv-phpbb/phpbb-ext-newspage](https://github.com/nickv-phpbb/phpbb-ext-newspage), originally developed by Joas Schilling ([nickvergessen](https://github.com/nickvergessen)). Original history, authorship and licensing are preserved.
- Code review, bug fixes, and documentation assisted by [Claude](https://www.anthropic.com/claude).
- Code review and documentation assisted by [Codex](https://openai.com/codex/).

## License

[GPLv2](license.txt)
This extension is licensed under the **GNU General Public License v2.0**.

See [license.txt](license.txt) for more information.
9 changes: 0 additions & 9 deletions SECURITY.md

This file was deleted.

29 changes: 29 additions & 0 deletions acp/main_info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
*
* NV Newspage extension for the phpBB Forum Software package
*
* @copyright (c) 2026, phpBB Modders, https://www.phpbbmodders.com/
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

namespace phpbbmodders\newspage\acp;

class main_info
{
public function module()
{
return array(
'filename' => '\\phpbbmodders\\newspage\\acp\\main_module',
'title' => 'ACP_NEWSPAGE',
'modes' => array(
'settings' => array(
'title' => 'ACP_NEWSPAGE_SETTINGS',
'auth' => 'ext_phpbbmodders/newspage && acl_a_board',
'cat' => array('ACP_NEWSPAGE'),
),
),
);
}
}
Loading
Loading