diff --git a/CHANGELOG.md b/CHANGELOG.md index b83dea8..6821fa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # 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. +- Added accessible tag selection when creating topics or editing their first posts. +- Added clickable forum filters that can combine multiple tags using AND 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. +- Raised minimum requirements to phpBB 3.3.0 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. diff --git a/README.md b/README.md index 1d07044..94ed5e5 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,18 @@ -# 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. [](https://github.com/phpbb-extensions/topicprefixes/actions) [](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 topic lists by one or more tags using AND semantics. +- 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. 📦 [Download](https://www.phpbb.com/customise/db/extension/topicprefixes/) the latest release of this extension. diff --git a/acp/topic_prefixes_module.php b/acp/topic_prefixes_module.php index e13021b..d3b45f7 100644 --- a/acp/topic_prefixes_module.php +++ b/acp/topic_prefixes_module.php @@ -33,7 +33,7 @@ public function main() $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(); diff --git a/adm/style/acp_topic_prefixes.css b/adm/style/acp_topic_prefixes.css index 3c73b32..491fa9d 100644 --- a/adm/style/acp_topic_prefixes.css +++ b/adm/style/acp_topic_prefixes.css @@ -3,10 +3,80 @@ font-weight: 900; } -.tp-toggle-on:before { +.tp-toggle-on::before { content: "\f205"; } -.tp-toggle-off:before { +.tp-toggle-off::before { content: "\f204"; } + +.topic-tag { + background-image: linear-gradient(to top, transparent, rgba(255, 255, 255, 0.35)); + border-radius: 3px; + display: inline-block; + font-weight: 600; + line-height: 1.5; + padding: 1px 7px; +} + +.topic-tags-empty { + text-align: center; +} + +.topic-tag-forums { + line-height: 1.8; +} + +.topic-tag-forum { + display: inline-block; + white-space: nowrap; +} + +.topic-tag-forum-separator { + color: #6B7278; + margin-right: 0.5em; +} + +.topic-tag-color, +.topic-tag-color:hover, +.topic-tag-color:focus { + background: #FFFFFF; + border: 1px solid #AFAEAA; + border-radius: 4px; + box-sizing: border-box; + color: inherit; + cursor: pointer; + height: 24px; + margin: 2px 0; + padding: 3px; + width: 48px; +} + +.topic-tag-color:hover { + border-color: #666666; +} + +.topic-tag-color:focus { + border-color: #BC2A4D; + box-shadow: 0 0 0 1px #BC2A4D; + outline: none; +} + +.topic-tag-color::-webkit-color-swatch-wrapper { + padding: 0; +} + +.topic-tag-color::-webkit-color-swatch { + border: 0; + border-radius: 2px; +} + +.topic-tag-color::-moz-color-swatch { + border: 0; + border-radius: 2px; +} + +#forum_ids { + min-width: 22em; +} diff --git a/adm/style/acp_topic_prefixes.html b/adm/style/acp_topic_prefixes.html index 9677ca3..246af15 100644 --- a/adm/style/acp_topic_prefixes.html +++ b/adm/style/acp_topic_prefixes.html @@ -2,70 +2,81 @@ -
{{ lang('TOPIC_TAGS_EXPLAIN') }}
-{{ lang('TOPIC_PREFIXES_EXPLAIN') }}
+| {{ lang('TOPIC_TAG') }} | +{{ lang('TOPIC_TAG_FORUMS') }} | +{{ lang('TOPIC_TAG_ENABLED') }} | +{{ lang('ACTION') }} | +
|---|---|---|---|
| {{ tag.TAG_NAME }} | ++ {% if tag.FORUM_NAMES %} + + {% for forum_name in tag.FORUM_NAMES %} + {{ forum_name }}{% if not loop.last %}{% endif %} + {% endfor %} + + {% else %} + {{ lang('TOPIC_TAG_NO_FORUMS') }} + {% endif %} + | ++ + + + | ++ + {{ ICON_MOVE_UP }} + + {{ ICON_MOVE_DOWN }} + {{ ICON_EDIT }} + {{ ICON_DELETE }} + | +
| {{ lang('TOPIC_TAGS_EMPTY') }} | |||
| {{ lang('TOPIC_PREFIX_TAG') }} | -{{ lang('TOPIC_PREFIX_ENABLED') }} | -{{ lang('ACTION') }} | -
|---|---|---|
| {{ prefix.PREFIX_TAG }} | -- - - - | -- - {{ ICON_MOVE_UP }} - - {{ ICON_MOVE_DOWN }} - {{ ICON_DELETE }} - | -
| {{ lang('TOPIC_PREFIXES_EMPTY') }} | -||