From d116f82cdcb951c31a2597d2b152a01704e8f2d2 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 27 Oct 2024 16:08:14 +0100 Subject: [PATCH 1/6] [ticket/17418] Add SVG versions of topic icons PHPBB-17418 --- phpBB/images/icons/misc/fire.svg | 36 ++++++++++++ phpBB/images/icons/misc/heart.svg | 31 ++++++++++ phpBB/images/icons/misc/radioactive.svg | 30 ++++++++++ phpBB/images/icons/misc/star.svg | 19 +++++++ phpBB/images/icons/misc/thinking.svg | 76 +++++++++++++++++++++++++ phpBB/images/icons/smile/alert.svg | 32 +++++++++++ phpBB/images/icons/smile/info.svg | 36 ++++++++++++ phpBB/images/icons/smile/mrgreen.svg | 39 +++++++++++++ phpBB/images/icons/smile/question.svg | 35 ++++++++++++ phpBB/images/icons/smile/redface.svg | 63 ++++++++++++++++++++ 10 files changed, 397 insertions(+) create mode 100644 phpBB/images/icons/misc/fire.svg create mode 100644 phpBB/images/icons/misc/heart.svg create mode 100644 phpBB/images/icons/misc/radioactive.svg create mode 100644 phpBB/images/icons/misc/star.svg create mode 100644 phpBB/images/icons/misc/thinking.svg create mode 100644 phpBB/images/icons/smile/alert.svg create mode 100644 phpBB/images/icons/smile/info.svg create mode 100644 phpBB/images/icons/smile/mrgreen.svg create mode 100644 phpBB/images/icons/smile/question.svg create mode 100644 phpBB/images/icons/smile/redface.svg diff --git a/phpBB/images/icons/misc/fire.svg b/phpBB/images/icons/misc/fire.svg new file mode 100644 index 0000000000..5645475690 --- /dev/null +++ b/phpBB/images/icons/misc/fire.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpBB/images/icons/misc/heart.svg b/phpBB/images/icons/misc/heart.svg new file mode 100644 index 0000000000..f25d0a3c64 --- /dev/null +++ b/phpBB/images/icons/misc/heart.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpBB/images/icons/misc/radioactive.svg b/phpBB/images/icons/misc/radioactive.svg new file mode 100644 index 0000000000..372c84e423 --- /dev/null +++ b/phpBB/images/icons/misc/radioactive.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpBB/images/icons/misc/star.svg b/phpBB/images/icons/misc/star.svg new file mode 100644 index 0000000000..e5e88794b9 --- /dev/null +++ b/phpBB/images/icons/misc/star.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/phpBB/images/icons/misc/thinking.svg b/phpBB/images/icons/misc/thinking.svg new file mode 100644 index 0000000000..b3fdc9fca3 --- /dev/null +++ b/phpBB/images/icons/misc/thinking.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpBB/images/icons/smile/alert.svg b/phpBB/images/icons/smile/alert.svg new file mode 100644 index 0000000000..173ba4d780 --- /dev/null +++ b/phpBB/images/icons/smile/alert.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpBB/images/icons/smile/info.svg b/phpBB/images/icons/smile/info.svg new file mode 100644 index 0000000000..f6e9ef7512 --- /dev/null +++ b/phpBB/images/icons/smile/info.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpBB/images/icons/smile/mrgreen.svg b/phpBB/images/icons/smile/mrgreen.svg new file mode 100644 index 0000000000..ef639a5ccd --- /dev/null +++ b/phpBB/images/icons/smile/mrgreen.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpBB/images/icons/smile/question.svg b/phpBB/images/icons/smile/question.svg new file mode 100644 index 0000000000..7a7bf1602a --- /dev/null +++ b/phpBB/images/icons/smile/question.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpBB/images/icons/smile/redface.svg b/phpBB/images/icons/smile/redface.svg new file mode 100644 index 0000000000..99693be14b --- /dev/null +++ b/phpBB/images/icons/smile/redface.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 422741e432f5e9a24dc97e57b4cde88634bd812a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 27 Oct 2024 16:15:08 +0100 Subject: [PATCH 2/6] [ticket/17418] Adjust animation of redface PHPBB-17418 --- phpBB/images/icons/smile/redface.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/images/icons/smile/redface.svg b/phpBB/images/icons/smile/redface.svg index 99693be14b..b3fddd7361 100644 --- a/phpBB/images/icons/smile/redface.svg +++ b/phpBB/images/icons/smile/redface.svg @@ -49,7 +49,7 @@ - + From 4dc69f959f82fe36f3f7aae01366044b2610afb5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 27 Oct 2024 16:21:02 +0100 Subject: [PATCH 3/6] [ticket/17418] Fix broken path in redface PHPBB-17418 --- phpBB/images/icons/smile/redface.svg | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/phpBB/images/icons/smile/redface.svg b/phpBB/images/icons/smile/redface.svg index b3fddd7361..84fe0db5ef 100644 --- a/phpBB/images/icons/smile/redface.svg +++ b/phpBB/images/icons/smile/redface.svg @@ -28,7 +28,7 @@ stroke-linejoin: round; } - + @@ -44,15 +44,14 @@ - - + + - - - - - - + + + + + From 0f3c9f70fc0070936aee5c16cb7611aa634559a1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 27 Oct 2024 16:53:33 +0100 Subject: [PATCH 4/6] [ticket/17418] Add migration for switching from gif to svg icons PHPBB-17418 --- .../db/migration/data/v400/hidpi_icons.php | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v400/hidpi_icons.php diff --git a/phpBB/phpbb/db/migration/data/v400/hidpi_icons.php b/phpBB/phpbb/db/migration/data/v400/hidpi_icons.php new file mode 100644 index 0000000000..6e91b15ca5 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v400/hidpi_icons.php @@ -0,0 +1,75 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v400; + +use phpbb\db\migration\migration; + +class hidpi_icons extends migration +{ + private array $default_icons = [ + 'misc/fire', + 'misc/heart', + 'misc/radioactive', + 'misc/star', + 'misc/thinking', + 'smile/alert', + 'smile/info', + 'smile/mrgreen', + 'smile/question', + 'smile/redface', + ]; + + public static function depends_on(): array + { + return [ + '\phpbb\db\migration\data\v400\dev' + ]; + } + + public function update_data(): array + { + return [ + ['custom', [[$this, 'gif_to_svg_icons']]], + ]; + } + + public function revert_data(): array + { + return [ + ['custom', [[$this, 'svg_to_gif_icons']]], + ]; + } + + public function gif_to_svg_icons(): void + { + foreach ($this->default_icons as $smiley) + { + $sql = 'UPDATE ' . $this->tables['icons'] . " + SET icons_url = '" . $this->db->sql_escape($smiley) . ".svg' + WHERE icons_url = '" . $this->db->sql_escape($smiley) . ".gif'"; + $this->db->sql_query($sql); + } + } + + public function svg_to_gif_icons(): void + { + foreach ($this->default_icons as $smiley) + { + $sql = 'UPDATE ' . $this->tables['icons'] . " + SET icons_url = '" . $this->db->sql_escape($smiley) . ".gif' + WHERE icons_url = '" . $this->db->sql_escape($smiley) . ".svg'"; + $this->db->sql_query($sql); + } + } +} From ecabd85162ec77dfc2666b0780ce3615509fe1db Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 27 Oct 2024 16:54:42 +0100 Subject: [PATCH 5/6] [ticket/17418] Default to svg icons during install PHPBB-17418 --- phpBB/install/schemas/schema_data.sql | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 13af5fa304..21b26ee9c8 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -756,16 +756,16 @@ INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_heigh INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':ugeek:', 'icon_e_ugeek.svg', '{L_SMILIES_UBER_GEEK}', 17, 18, 42); # -- icons -INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/fire.gif', 16, 16, 1, 1); -INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/redface.gif', 16, 16, 9, 1); -INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/mrgreen.gif', 16, 16, 10, 1); -INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/heart.gif', 16, 16, 4, 1); -INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/star.gif', 16, 16, 2, 1); -INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/radioactive.gif', 16, 16, 3, 1); -INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/thinking.gif', 16, 16, 5, 1); -INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/info.gif', 16, 16, 8, 1); -INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/question.gif', 16, 16, 6, 1); -INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/alert.gif', 16, 16, 7, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/fire.svg', 16, 16, 1, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/redface.svg', 16, 16, 9, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/mrgreen.svg', 16, 16, 10, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/heart.svg', 16, 16, 4, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/star.svg', 16, 16, 2, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/radioactive.svg', 16, 16, 3, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/thinking.svg', 16, 16, 5, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/info.svg', 16, 16, 8, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/question.svg', 16, 16, 6, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/alert.svg', 16, 16, 7, 1); # -- reasons INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('warez', '{L_REPORT_WAREZ}', 1); From 116e0f3dbab99ab758912c59ce88f161e6c309ed Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 27 Oct 2024 16:54:55 +0100 Subject: [PATCH 6/6] [ticket/17418] Use icon width and height for acp display PHPBB-17418 --- phpBB/adm/style/acp_icons.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index 25d5cb5207..9a5179419e 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -105,7 +105,7 @@ - {items.TEXT_ALT} + {items.TEXT_ALT} [{items.IMG}]