Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
0520fd5
Initial total redesign from title prefixes to topic tags
iMattPro Sep 19, 2026
ce0dd54
Updates and tweaky fixes and more tests
iMattPro Sep 19, 2026
e47df67
Add UCP listeners assuming we get these events in the core
iMattPro Sep 19, 2026
3a78f49
Ensure topic tags stay with a topic after being moved to other forums
iMattPro Sep 20, 2026
a1398e0
Add orphan handling
iMattPro Sep 20, 2026
6f716ef
Fix CSS issues
iMattPro Sep 20, 2026
393ffe0
Fix tests
iMattPro Sep 20, 2026
5b05fc9
Fix dates
iMattPro Sep 20, 2026
caf3bb7
Refactor functional tests
iMattPro Sep 20, 2026
d94fd00
Performance improvements pass
iMattPro Sep 20, 2026
797ba46
Revert handling of tags when all users posts moved to a new forum
iMattPro Sep 20, 2026
ded6748
CSS improvements
iMattPro Sep 20, 2026
db7c63c
Avoid no-op filter links for global topics
iMattPro Sep 20, 2026
3c4ef93
Small code fixes and improvements
iMattPro Sep 20, 2026
bac6367
Fix tests
iMattPro Sep 20, 2026
1f8a7ee
Styling fixes in the ACP
iMattPro Sep 20, 2026
a3f5ea3
Prevent disabled tags from appearing as filter choices
iMattPro Sep 20, 2026
30280e6
Add subtle depth effect to tags so they’r enot so flat
iMattPro Sep 21, 2026
d4dc4c1
Add tooltips to tags
iMattPro Sep 21, 2026
e0a8c32
Added multibyte prefix test coverage using Japanese text
iMattPro Sep 21, 2026
3983d76
Fix MSSQL - as usual
iMattPro Sep 21, 2026
ce9955d
Handling for 4-byte emojis
iMattPro Sep 21, 2026
215f7e0
Enforce a 50 char limit for topic prefix/tags
iMattPro Sep 21, 2026
f713670
Make all three stateless text utilities static
iMattPro Sep 22, 2026
d9e7d99
Rename to Topic Tags
iMattPro Sep 22, 2026
d20a8c6
Loosen phpBB version requirements and add notes about
iMattPro Sep 22, 2026
857b2d8
Default panel shows only enabled tags available in forum
iMattPro Sep 23, 2026
cb6242f
Implement lightweight retained-tag tooltip
iMattPro Sep 23, 2026
16c8785
Adjust topic tags in search profile
iMattPro Sep 24, 2026
2980294
Mark version as “dev” for now [ci skip]
iMattPro Sep 24, 2026
43253cc
Migrate stored for last post subject titles
iMattPro Sep 25, 2026
362dc14
Disable tag filtering in search results
iMattPro Sep 25, 2026
1782300
Display forums associated with tags as list
iMattPro Oct 3, 2026
5a74206
Split multi-bracketed prefixes into individual tags
iMattPro Oct 3, 2026
5ff2957
Enforce disabling board before updating to 2.0.0
iMattPro Oct 3, 2026
7460e03
Add a repair CLI tool to split tags that didn’t migrate as expected
iMattPro Oct 3, 2026
99603ea
Fix tests
iMattPro Oct 3, 2026
e431abf
Fix MSSQL
iMattPro Oct 3, 2026
c6fe298
Keep legacy log lang keys
iMattPro Oct 3, 2026
e0179b4
Enforce permissions when retaining tag filter IDs
iMattPro Oct 3, 2026
4b38bdf
Prevent double HTML-encoding of ACP tag names
iMattPro Oct 3, 2026
b13232e
Avoid visibility queries for unfiltered tag requests
iMattPro Oct 4, 2026
06503c5
Escape log names before HTML interpolation
iMattPro Oct 4, 2026
df2396c
Update tests
iMattPro Oct 4, 2026
c81bd66
Renamed tool to topicprefixes:repair-legacy-tags
iMattPro Oct 4, 2026
8f4d3c1
Re-word the repair tool text
iMattPro Oct 4, 2026
dae2845
Allow tag merging via repair tool
iMattPro Oct 4, 2026
51a0c30
Check destination permissions before displaying shadow topic tags
iMattPro Oct 4, 2026
165910f
Preserve selected tags in the pagination base URL
iMattPro Oct 4, 2026
12a50ec
Fix comments
iMattPro Oct 5, 2026
f5e974a
Fix changelog
iMattPro Oct 5, 2026
dca6807
Refactor cli lang keys and support pluralization
iMattPro Oct 5, 2026
9b1aba9
Add a missing unit test
iMattPro Oct 5, 2026
784d72c
Migration hardening
iMattPro Oct 5, 2026
38a8000
Harden duplicate consolidation in migration
iMattPro Oct 5, 2026
0596ccf
Implement Active Topics display-only behavior
iMattPro Oct 6, 2026
efca6e3
Update docs
iMattPro Oct 6, 2026
01222c1
Get tag filtering working for search results
iMattPro Oct 6, 2026
fe0bbcc
Remove skipped test now that events are available
iMattPro Oct 6, 2026
3406636
Add tag filtering to other search pages (new posts, unanswered etc)
iMattPro Oct 6, 2026
4094747
Remove redundant template flag
iMattPro Oct 6, 2026
ad8b023
Add missing test gaps
iMattPro Oct 6, 2026
fac1b1d
Implement consistent title-tag toggling
iMattPro Oct 7, 2026
baaf0fa
Completely redesign the ACP for a better UX
iMattPro Oct 7, 2026
3bc4b1a
Update javascript
iMattPro Oct 7, 2026
52fbd8b
Fix layout of the no-JS fallback
iMattPro Oct 8, 2026
a1a3f16
ACP forum picker correctly ignores admin’s frontend forum ACL
iMattPro Oct 9, 2026
aa70d19
Repair CLI only changes tags, does not mutate titles or subjects
iMattPro Oct 9, 2026
2daa09e
Tied legacy ordering now repaired deterministically
iMattPro Oct 9, 2026
9407154
ACP save locking prevents duplicate/conflicting requests
iMattPro Oct 9, 2026
89e196e
Migration now resumable and data protection hardened
iMattPro Oct 9, 2026
06c8934
Add CLI tools to repair topic titles and topic replies
iMattPro Oct 12, 2026
1b2f678
Make docblocks consistent throughout
iMattPro Oct 12, 2026
06ecb77
Remove deprecated sql code
iMattPro Oct 12, 2026
951857f
Bump phpBB requirement to 3.3.19
iMattPro Oct 12, 2026
b5d79d2
Fix non-transactional MyISAM title repair
iMattPro Oct 12, 2026
c20fded
Insert first then delete on replace
iMattPro Oct 13, 2026
e897309
Add searchable tags feature
iMattPro Oct 14, 2026
7eb79b0
Fix MSSQL query failures
iMattPro Oct 15, 2026
1dbc379
Harden tests
iMattPro Oct 15, 2026
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
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

### 2.0.0-dev - TBD

- Renamed phpBB Topic Prefixes to phpBB Topic Tags and replaced single text prefixes embedded in titles with relational topic metadata.
- Added multiple color-coded tags per topic with automatic badge text contrast and badges throughout forum, topic, MCP, and search displays.
- Added centralized ACP management for tag text, color, order, status, and availability across multiple forums.
- Redesigned ACP management with a responsive tag catalog, sticky editor, searchable forum assignments, drag-and-drop ordering, and AJAX updates.
- Added accessible tag selection when creating topics or editing their first posts.
- Added clickable filters that combine multiple tags using AND matching in forum lists, category Active Topics, and SQL-backed keyword or author search results shown as topics or posts.
- Added opt-in, permission-filtered tag autocomplete to advanced search, including tag-only topic search and all/any matching.
- Preserved tags through topic moves, splits, forks, and merges, including tags retained after moving into forums where they are unavailable for new assignments.
- Added a safe, restartable upgrade that converts legacy prefixes and assignments into tags while removing matching prefix text from topic titles and first-post subjects.
- Added automatic splitting of complete adjacent bracket sequences and consolidation of duplicate legacy definitions with matching names and enabled states, while preserving malformed formats and same-name definitions with conflicting states.
- Required legacy upgrades to run with the board disabled and directed administrators to back up the database first.
- Added an interactive CLI for splitting tags into multiple separate tags or merging one tag into another.
- Raised minimum requirements to phpBB 3.3.19 and PHP 7.2.
- Note: implementations for showing tags on UCP main page, bookmarks, and subscriptions will take effect after phpBB adds new proposed events (targeted for 3.3.19).

### 1.0.2 - 2025-12-17

- Strengthened compatibility with both phpBB3 and phpBB4-alpha-1.
Expand Down
79 changes: 71 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,82 @@
# phpBB Topic Prefixes
# phpBB Topic Tags

This is the repository for the development of the Topic Prefixes phpBB extension.
This is the repository for development of phpBB Topic Tags, formerly named Topic Prefixes.

[![Build Status](https://github.com/phpbb-extensions/topicprefixes/actions/workflows/tests.yml/badge.svg)](https://github.com/phpbb-extensions/topicprefixes/actions)
[![codecov](https://codecov.io/gh/phpbb-extensions/topicprefixes/branch/master/graph/badge.svg?token=Dc0GWOeQWj)](https://codecov.io/gh/phpbb-extensions/topicprefixes)

The phpBB Topic Prefixes extension allows phpBB board administrators to create topic prefix tags that users can easily add to their topic titles. Features include:
The phpBB Topic Tags extension provides administrator-curated topic tags. Tags are structured topic metadata and are displayed separately from topic titles as colored badges. Features include:

- Create unique and unlimited prefixes for each forum in your phpBB board.
- Admins can sort, enable and disable prefix tags.
- Users will see a topic prefix menu when creating a new topic in a forum that uses topic prefixes.
- Topic prefixes can easily be changed when a user is editing their original first post.
- Because the topic prefix is added directly to the topic title, if an admin disables or deletes a topic prefix, existing topic titles using the deleted prefix will not be changed.
- Create, edit, order, enable, disable, and color topic tags.
- Make each tag available in one or more forums.
- Assign multiple tags while creating a topic or editing its first post.
- Display readable colored badges in topic lists, topic pages, and search results.
- Filter forum and category Active Topics lists by one or more tags using AND semantics.
- Optionally enable tag search in ACP > General > Board features, adding a permission-filtered autocomplete to advanced search with all/any matching and tag-only topic results.
- Filter keyword and author search results shown as topics or posts when using phpBB native, MySQL fulltext, or PostgreSQL search. Sphinx supports tag-only search but not combined tag and text/author search.
- Upgrade existing title prefixes safely into relational tag assignments.
- This is the same extension currently in use at phpbb.com in the Extensions and Styles in development forums.

## Upgrading from 1.x

Before enabling version 2, make a full database backup and disable the board in
General > Board settings. The extension blocks a legacy upgrade while the board
is enabled.

Migration splits complete adjacent bracket sequences such as `[3.3][DEV]` into
separate tags. Legacy prefixes duplicated within or across multiple forums are
consolidated into one tag available in each applicable forum when their decoded
names and enabled states match. Other combined formats and same-name definitions with
different enabled states remain separate. This upgrade is one-way; restore the
pre-upgrade database backup to undo it.

## Repair tools

Before applying any repair, make a current database backup and disable the
board. Each tool shows a preview and asks for confirmation before changing
anything.

### Repair tags

Use this command to split a combined tag into separate tags or merge one tag
into another:

```shell
php bin/phpbbcli.php topicprefixes:repair-tags
```

To repair a specific tag, add `--tag-id=ID`.

### Repair topics

Use this command to repair missing topic tags or old prefixes, usually after
upgrading from version 1 to version 2:

```shell
php bin/phpbbcli.php topicprefixes:repair-topics
```

Choose the action that matches the problem:

- **Recover missing topic tags:** use when a topic still shows its old prefix
and has no tag.
- **Clean leftover topic titles:** use when tags migrated correctly but old
prefix text remains in topic titles.
- **Clean historical reply subjects:** optionally remove old prefixes from
replies. Reply subjects are normally kept as part of the discussion history.

Missing-tag candidates are grouped by forum and inferred tags. You can review
each group in pages of 20, stop previewing at any page, then approve or skip the
whole group. The confirmation reports how many candidates were and were not
previewed. Each completed repair action creates one administrator-log summary.

For title or reply cleanup, enter the old prefix exactly as shown and select the
forum to repair. If post subjects change, rebuild the search index in ACP >
Maintenance > Search index.

Some missing information cannot be recovered from the current database. If the
tool cannot identify the old tag, use a pre-upgrade backup to determine it.

📦 [Download](https://www.phpbb.com/customise/db/extension/topicprefixes/) the latest release of this extension.

🐞 [Report bugs](https://github.com/phpbb-extensions/topicprefixes/issues) to our Issue Tracker.
Expand Down
10 changes: 9 additions & 1 deletion acp/topic_prefixes_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@

namespace phpbb\topicprefixes\acp;

/**
* Describe Topic Prefixes ACP module registration.
*/
class topic_prefixes_info
{
public function module()
/**
* Return ACP module metadata.
*
* @return array ACP module definition
*/
public function module(): array
{
return [
'filename' => '\phpbb\topicprefixes\acp\topic_prefixes_module',
Expand Down
17 changes: 11 additions & 6 deletions acp/topic_prefixes_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,34 @@
namespace phpbb\topicprefixes\acp;

/**
* Class topic_prefixes_module
* Dispatch Topic Prefixes ACP requests to the administrator controller.
*/
class topic_prefixes_module
{
/** @var string */
/** @var string Module action URL */
public $u_action;

/** @var string Template name */
public $tpl_name;

/** @var string Page title language key */
public $page_title;

/**
* Main ACP module
* Dispatch the current ACP request.
*
* @throws \Exception
* @return void
* @throws \Exception When controller dispatch fails
*/
public function main()
public function main(): void
{
global $phpbb_container;

$lang = $phpbb_container->get('language');
$lang->add_lang('acp/forums');
$lang->add_lang('acp_topic_prefixes', 'phpbb/topicprefixes');
$this->tpl_name = 'acp_topic_prefixes';
$this->page_title = 'TOPIC_PREFIXES';
$this->page_title = 'TOPIC_TAGS';

$admin_controller = $phpbb_container->get('phpbb.topicprefixes.admin_controller');
$admin_controller->set_u_action($this->u_action)->main();
Expand Down
Loading