I manage a number of PHPBB bulletin boards and one such board receives quite alot of image uploads from users who let's say aren't the most tech saavy. Some of the users know nothing about image file sizes and resolution and they end up uploading enormous images. Rather than instruct each user how they can resize images I figured it would be better if PHPBB would just resize the image on the fly so that the dimensions ensure better file sizes and don't break the layout of the site. I checked the PHPBB administration control panel and it seems that this simple requirement's not possible out of the box. Googling a little for it didn't show up much so I dived in to the source..
How to get PHPBB to automatically resize uploaded images?
I applied this mod to PHPBB3, it would not surprise me thou if this also applied cleanly to a PHPBB2 installation. Open ./includes/functions_posting.php and locate the following line (~ line 434):
1
|
|
Insert the following code BEFORE this line:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
Success! This patch worked a treat; no more oversized images!