From c073b679b9d7a66c3dfb2ce206e6a1fc8b095a6c Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Fri, 23 Oct 2026 14:58:01 -0500 Subject: [PATCH 1/2] Align PHP requirements with extension enablement --- README.md | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 54a1aa3..da44af2 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Click an image for the full size. See the [screenshot gallery](docs/images/scree ## Requirements - phpBB 3.3.19 or later, including phpBB 4.0 -- PHP 7.4 or later (phpBB 4.0 itself needs PHP 8.2 or later) +- PHP 8.3.36 or later ## Installation diff --git a/composer.json b/composer.json index 5889bfc..0908bbb 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "php": ">=7.4", + "php": ">=8.3.36", "phpbb/phpbb": ">=3.3.19,<4.1.0@dev", "composer/installers": "^1.0 || ^2.0" }, From 28b29a3b70245b98f2e5e30488d406c1668c635b Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Thu, 22 Oct 2026 13:09:42 -0500 Subject: [PATCH 2/2] Add plain URL copying and restore anchor focus --- README.md | 11 ++++--- acp/main_module.php | 5 ++-- adm/style/acp_copylinks_settings.html | 4 +++ docs/images/screenshots/README.md | 4 +-- .../screenshots/copylinks-acp-settings.png | Bin 80215 -> 73187 bytes event/listener.php | 1 + language/en/acp_copylinks.php | 4 ++- language/en/common.php | 1 + migrations/add_copy_format.php | 28 ++++++++++++++++++ styles/all/template/copylinks.js | 11 +++++-- .../template/event/overall_footer_after.html | 5 ++-- 11 files changed, 61 insertions(+), 13 deletions(-) create mode 100644 migrations/add_copy_format.php diff --git a/README.md b/README.md index da44af2..161815e 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,12 @@ Click a forum, topic, post or FAQ heading to copy a link to it, ready-made as BB - Also works on the title above the posting form and on the posts in the topic review below it. - Links are full addresses built from the forum, topic or post ID, so they work anywhere they're pasted and never carry a session ID. They always point at the forum, topic or post itself, not a page of it. - A small icon (Font Awesome `fa-clone` by default) marks each copyable heading and turns into a tick for a moment after copying. Screen readers announce "The link has been copied." -- Built for keyboard and screen reader use: headings stay ordinary links reached with Tab and copied with Enter, each one is described as "Copy a link to this as BBCode", the icon is hidden from screen readers, and focus is always clearly outlined. +- Built for keyboard and screen reader use: headings stay ordinary links reached with Tab and copied with Enter, each one has a description matching the selected copy format, the icon is hidden from screen readers, and focus is always clearly outlined. +- Clicking a post or FAQ question also follows its anchor and keeps the link focused. - Ctrl-, Cmd-, Shift- and middle-clicks still open the link as usual. -- When the browser won't allow copying (for example a board on plain `http://`), the BBCode is shown in a box to copy by hand. +- When the browser won't allow copying (for example a board on plain `http://`), the selected link format is shown in a box to copy by hand. - Search engine bots get the board unchanged. -- Turn the icon on or off, or choose another icon, under **ACP → Extensions → Copy Links → Settings**. +- Choose BBCode (the default) or plain URLs, turn the icon on or off, or choose another icon, under **ACP → Extensions → Copy Links → Settings**. - Works with prosilver and styles based on it. ## Screenshots @@ -23,7 +24,7 @@ Click a forum, topic, post or FAQ heading to copy a link to it, ready-made as BB Tick after copying a topic title Tick after copying an FAQ question -ACP settings +ACP settings @@ -40,6 +41,8 @@ Click an image for the full size. See the [screenshot gallery](docs/images/scree 2. In the Administration Control Panel, go to **Customise → Manage extensions** 3. Enable the **Copy Links** extension +After updating an existing installation, disable and re-enable the extension to apply the new settings migration; do not delete its data. + ## Contributing Contributions are welcome! diff --git a/acp/main_module.php b/acp/main_module.php index c5b82dd..28d7132 100644 --- a/acp/main_module.php +++ b/acp/main_module.php @@ -11,8 +11,7 @@ namespace phpbbmodders\copylinks\acp; /** - * ACP settings page: whether to show an icon next to copyable headings, and - * which Font Awesome icon to use. + * ACP settings page: copy format and the icon next to copyable headings. */ class main_module { @@ -55,12 +54,14 @@ public function main($id, $mode) $config->set('copylinks_icon_enable', (int) $request->variable('copylinks_icon_enable', false)); $config->set('copylinks_icon', $icon); + $config->set('copylinks_plain_url', (int) $request->variable('copylinks_plain_url', false)); $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_COPYLINKS_SETTINGS'); trigger_error($language->lang('CONFIG_UPDATED') . adm_back_link($this->u_action)); } $template->assign_vars([ + 'S_COPYLINKS_PLAIN_URL' => !empty($config['copylinks_plain_url']), 'U_ACTION' => $this->u_action, 'S_COPYLINKS_ICON_ENABLE' => !empty($config['copylinks_icon_enable']), 'COPYLINKS_ICON' => !empty($config['copylinks_icon']) ? $config['copylinks_icon'] : self::DEFAULT_ICON, diff --git a/adm/style/acp_copylinks_settings.html b/adm/style/acp_copylinks_settings.html index 7f22174..f276cdd 100644 --- a/adm/style/acp_copylinks_settings.html +++ b/adm/style/acp_copylinks_settings.html @@ -6,6 +6,10 @@

{{ lang('ACP_COPYLINKS') }}