Topic: Automatic Image Upload with Thumbnails
##
## Mod title: Automatic Image Upload with Thumbnails
##
## Mod version: 1.3.5
## Works on PunBB: 1.2.*
## Release date: 2008-06-15
## Author: Koos (pampoen10@yahoo.com)
##
## Description: This tool allows users to upload images and automatically
## creates thumbnails for them which can then be displayed
## in your forum posts. Clicking the thumbnail shows the
## original image. By only displaying thumbnails pages load
## quicker. This is not really a "MOD" since no punbb files
## have to be modified and the database is not affected.
## This makes for very easy installation and removal if
## needed. Also no changes are necessary when upgrading
## your punbb forum.
##
## Affected files: none
##
## Affects DB: no
##
## Notes: Requires the GD library on your Web server. Script can
## upload JPEG, PNG AND GIF images.
##
## DISCLAIMER: Please note that "mods" are not officially supported by
## PunBB. Installation of this modification is done at your
## own risk. Backup your forum database and any and all
## applicable files before proceeding.
##
################################################################################
## CHANGELOG:
## 1.3.5 : made the necessary changes so that sorting will work in PHP5
## fixed a serious vulnerability
## other minor changes
## 1.3.4 : rewrote the 'uploadimg.php' page
## fixed a vulnerability
## all pages now valid XHTML 1.0 Strict
## stats totals now also include thumb size
## 1.3.3 : fixed thumbnail creation bug
## - previously, when width<twidth and height>theight: no resize
## removed dimensions column in list view
## other minor fixes
## 1.3.2 : added statement allocating all necessary memory for image processing
## transliterates filenames with umlauts, accents, ligatures and runes
## added dimensions column to list of uploaded images
## fixed bug resulting in interrupted uploads being saved
## other minor changes
## 1.3.1 : much improved thumbnail and image resize quality
## improved 'resize image' function
## more efficient use of PHP memory - can now resize larger images
## removed user id from statistics table
## other minor changes
## 1.3.0 : strips all non-alphanumeric characters in filename
## fixed image resize aspect ratio problem
## added delete functionality
## added option to resize images on upload
## added option to view image URL link below thumbnail in the gallery
## thumbnail now shown on the results page after upload
## other minor fixes and improvements
## 1.2.2 : totals now shown in the 'upload statistics' table
## added language support
## fixed: upload not saved if thumbnail can not be created
## fixed: PNG Image file interpretation problem in IE
## - (ie6 sends image/x-png instead of image/png)
## other minor changes
## 1.2.1 : BBCode now generated below each thumbnail in the gallery
## - like Photobucket/ImageShack
## 1.2.0 : changed layout to conform more closely to the punbb standard
## added an 'upload statistics' feature
## added flickr style gallery feature - with latest upload displayed first
## added full permission control
## all spaces in filenames of uploaded images now replaced with _ (underscore)
## dates in upload list now displayed as in the rest of your forum
## other minor improvements
## 1.1.1 : fixed compatibility problem with Internet Explorer
## some other minor fixes
## 1.1.0 : added support for PNG and GIF files
## simplified configuration (don't have to specify absolutepath or forumurl)
## 1.0 : initial release
################################################################################
I have recently completed an 'upload with automatic thumbnail creation' tool. The great thing about this "MOD" is that you don't have to make any changes to your punbb files or the database.
Features:
* Extremely easy to install and remove
* Can view a list and gallery of all your uploaded images
* Can not replace a file with same filename
* Can create thumbnails of JPEG, PNG and GIF files (depending on your GD version)
* Can specify maximum file size to upload
* Can view upload statistics of users who have uploaded images
How it works:
1. You select an image file to upload e.g. image.jpg
2. The image is uploaded with your pun user id used as the prefix e.g. 12_image.jpg - this is to differentiate your uploads from the uploads of other users.
3. Thumbnail is created in the thumbnails directory
4. You are supplied with the code which you must copy and paste into your post. This allows the thumbnail of your uploaded image to be displayed in your post. Clicking the thumbnail shows the original image.
Note:
The easiest way to see whether the GD library has been installed on your Web server and which file types it supports is to create a small file (e.g. test.php) containing:
<?php phpinfo() ?>
and look at it using a web browser. There you will also be able to see what your PHP memory limit is (see the memory_limit parameter). It is recommended that this is at least 16MB for proper thumbnail creation operation. Ask your system administrator to raise it for you. With 16MB of PHP memory you will be able to create thumbnails of images of up to about 2000x1500 pixels in size. Uploading larger images you get a blank screen (symptom of memory max-out).
Update:
Added statement in v1.3.2 for allocating all necessary memory for image processing. On some servers this will allow you to upload and resize any size image.