Skip to content

Commit 56abf9b

Browse files
committed
v1.4.4
- On migration, set max_filesize in extension_groups for images to 0. - Change DB query for image extension in main listener
1 parent 1f9334f commit 56abf9b

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This extension can change the image size and/or the image file size. It rotate i
4040
Copy the extension to `phpBB3/ext/imcger/imgupload`.
4141
Go to "ACP" > "Customise" > "Manage extensions" and enable the "Image upload use ImageMagick" extension.
4242

43-
For full functionality "Maximum file size" in "ACP" > "Posting" > "Attachment settings" must be set to 0. This is done automatically during the migration.
43+
For full functionality "Maximum file size" in "ACP" > "Posting" > "Attachment settings" must be set to 0 and in "ACP" > "Posting" > "Manage attachment extension groups" > "Settings in Images" > "Maximum file size" must be set to 0. This is done automatically during the migration.
4444

4545
For full functionality "Maximum image dimensions" in "ACP" > "Posting" > "Attachment settings" must be set to 0. This is done automatically during the migration.
4646
For full functionality "Maximum avatar file size" in "ACP" > "Board configuration" > "Avatar settings" must be set to 0. This is done automatically during the migration.
@@ -54,6 +54,10 @@ For full functionality "Maximum avatar file size" in "ACP" > "Board configuratio
5454

5555
## Changelog
5656

57+
### v1.4.4 (19-06-2024)
58+
- Added Set max filesize in attachment extension groups on migraton to 0.
59+
- Fixed Don't work in none standard attachment extension groups
60+
5761
### v1.4.3 (20-02-2024)
5862
- Fixed [Error in Post](https://www.phpbb.de/community/viewtopic.php?p=1426071#p1426071)
5963

imcger/imgupload/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This extension can change the image size and/or the image file size. It rotate i
4040
Copy the extension to `phpBB3/ext/imcger/imgupload`.
4141
Go to "ACP" > "Customise" > "Manage extensions" and enable the "Image upload use ImageMagick" extension.
4242

43-
For full functionality "Maximum file size" in "ACP" > "Posting" > "Attachment settings" must be set to 0. This is done automatically during the migration.
43+
For full functionality "Maximum file size" in "ACP" > "Posting" > "Attachment settings" must be set to 0 and in "ACP" > "Posting" > "Manage attachment extension groups" > "Settings in Images" > "Maximum file size" must be set to 0. This is done automatically during the migration.
4444

4545
For full functionality "Maximum image dimensions" in "ACP" > "Posting" > "Attachment settings" must be set to 0. This is done automatically during the migration.
4646
For full functionality "Maximum avatar file size" in "ACP" > "Board configuration" > "Avatar settings" must be set to 0. This is done automatically during the migration.
@@ -54,6 +54,10 @@ For full functionality "Maximum avatar file size" in "ACP" > "Board configuratio
5454

5555
## Changelog
5656

57+
### v1.4.4 (19-06-2024)
58+
- Added Set max filesize in attachment extension groups on migraton to 0.
59+
- Fixed Don't work in none standard attachment extension groups
60+
5761
### v1.4.3 (20-02-2024)
5862
- Fixed [Error in Post](https://www.phpbb.de/community/viewtopic.php?p=1426071#p1426071)
5963

imcger/imgupload/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"type": "phpbb-extension",
44
"description": "Using ImageMagick php librarie for resize image attachments and creating thumbnails.",
55
"homepage": "https://github.com/IMC-GER/phpBB-Image-upload-use-ImageMagick/tags",
6-
"version": "1.4.4-b1",
7-
"time": "2024-06-18",
6+
"version": "1.4.4",
7+
"time": "2024-06-19",
88
"license": "GPL-2.0-only",
99
"authors": [
1010
{

imcger/imgupload/event/main_listener.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,22 @@ public function set_template_vars()
113113
$allowed_images = [];
114114
$img_max_thumb_width = $this->config['imcger_imgupload_img_max_thumb_width'];
115115

116-
$sql_ary = 'SELECT group_id FROM ' . EXTENSION_GROUPS_TABLE . ' WHERE group_name = "IMAGES"';
117-
$result = $this->db->sql_query($sql_ary);
118-
$arry = $this->db->sql_fetchrow($result);
119-
$this->db-> sql_freeresult();
116+
// Get image groups
117+
$sql_ary = 'SELECT group_id FROM ' . EXTENSION_GROUPS_TABLE . ' WHERE cat_id = 1';
118+
$result_group = $this->db->sql_query($sql_ary);
120119

121-
$sql_ary = 'SELECT extension FROM ' . EXTENSIONS_TABLE . ' WHERE group_id = ' . $arry['group_id'];
122-
$result = $this->db->sql_query($sql_ary);
123-
124-
while ($row = $this->db->sql_fetchrow($result))
120+
while ($group_row = $this->db->sql_fetchrow($result_group))
125121
{
126-
$allowed_images[] = $row['extension'];
122+
// Get extension from image groups
123+
$sql_ary = 'SELECT extension FROM ' . EXTENSIONS_TABLE . ' WHERE group_id = ' . $group_row['group_id'];
124+
$result_ext = $this->db->sql_query($sql_ary);
125+
126+
while ($row = $this->db->sql_fetchrow($result_ext))
127+
{
128+
$allowed_images[] = $row['extension'];
129+
}
127130
}
128-
$this->db-> sql_freeresult();
131+
$this->db->sql_freeresult();
129132

130133
$metadata_manager = $this->ext_manager->create_extension_metadata_manager('imcger/imgupload');
131134

imcger/imgupload/migrations/v144.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function update_data()
3232

3333
public function reset_max_filesize()
3434
{
35-
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET max_filesize = 0 WHERE group_name = "IMAGES";';
35+
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET max_filesize = 0 WHERE cat_id = 1;';
3636
$this->db->sql_query($sql);
3737
}
3838
}

imgupload_version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"stable": {
33
"1.0": {
4-
"current": "1.4.3",
4+
"current": "1.4.4",
55
"announcement": "https://www.phpbb.de/community/viewtopic.php?t=246009",
66
"download": "https://github.com/IMC-GER/phpBB-Image-upload-use-ImageMagick/tags",
77
"eol": null,

0 commit comments

Comments
 (0)