PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2013-05-09 21:39:16

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Automatic Image Upload with Thumbnails 1.4

Code:

##
##        Mod title:  Automatic Image Upload with Thumbnails
##
##      Mod version:  1.4.1
##   Works on PunBB:  1.2.*
##     Release date:  2013-06-04
##           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. 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:  New table:
##                       'uploadimg'
##                    New columns in 'users' table:
##                       'upload_usage'
##                       'upload_count'
##
##            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.4.1 : added additional check to sync tool
##         made fix to orphans check tool
## 1.4.0 : added admin plugin for changing settings
##         uploaded image info now stored in the database
##         can now set upload usage limit for all user groups
##         made fix to preserve the transparency of resized GIF and PNG images
##         new option to display usage percentage bar in uploadimg.php
##         new option to display usage percentage bar in uploadimg_stats.php
## 1.3.8 : replaced all instances of the deprecated split() function with explode()
##         moved a </div> bracket in uploadimg_view.php to it's correct location
##         added a blank index.html file to the /upload and /upload/thumbs directories
## 1.3.7 : fixed a sql injection vulnerability
##         some layout fixes
## 1.3.6 : preserves transparency when resizing transparent GIF and PNG images
##         now sorts images according to modification time instead of inode change time
##         BBCode now shown as in the gallery after image upload
##         truncates filenames longer than 100 characters
##         other minor changes
## 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 
################################################################################

Download here

Offline

 

#2 2013-05-09 21:41:44

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Automatic Image Upload with Thumbnails 1.4

This is the "database" version of the Automatic Image Upload mod.

Here are the changes made:
*Added admin plugin for changing settings
*Uploaded image info now stored in the database
*Can now set upload usage limit for all user groups
*Made fix to preserve the transparency of resized GIF and PNG images
*New option to display usage percentage bar in uploadimg.php
*New option to display usage percentage bar in uploadimg_stats.php

Upgrade instructions:
To upgrade from previous versions, just follow the same instructions as in the readme.

Offline

 

#3 2013-05-14 11:24:19

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.4

thanks koos for the update! Great job doing the refresh function. It captures all the existing images uploaded in the previous version of this mod.

by the way koos. I think the uploadimg_config.php should not be included in the package since configurations are now stored in the database. Please confirm. Thanks

Last edited by doki (2013-05-14 11:28:01)

Offline

 

#4 2013-05-15 14:03:37

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.4

hi koos, is the automatic image upload mod can be integrated in the post.php? somewhere like the EZBBC toolbar by jojaba? When a user click a button there will be a popup window that enable them to upload an image after the submission it will automatically insert the bbcode of the uploaded image to the post php textbox.

Offline

 

#5 2013-05-15 20:47:01

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Automatic Image Upload with Thumbnails 1.4

The config is still saved to the uploadimg_config.php file. You just now have the option to save it from the mod's plugin.

Regarding integration with post.php: I have had others requesting this before. If I get some time I might create an add-on for this.

Offline

 

#6 2013-05-16 02:23:01

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.4

thanks koos for clarifying smile I'm also looking forward for the post integration smilesmile

by the way the upload stats seems not working. It shows "Totals:  0 uploaders"

Offline

 

#7 2013-05-16 20:31:00

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Automatic Image Upload with Thumbnails 1.4

Make sure to run the 'Orphans', 'Synchronize' and 'Refresh' tools in the mod's plugin after installation or upgrade, as it says in the last step of the readme.

Offline

 

#8 2013-05-18 10:55:52

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.4

deleting orphans gives me an error sad however when i return to upload image plugin and check the orphan,  the image was deleted already.

http://s24.postimg.org/mf6ktzjlx/error.jpg

Last edited by doki (2013-05-18 11:00:35)

Offline

 

#9 2013-06-04 20:50:07

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Automatic Image Upload with Thumbnails 1.4

There was a little bug in the orphans check tool. I have fixed it in v.1.4.1. See if that works for you.

Here's what's new in v1.4.1:
* Added additional check to sync tool
* Made fix to orphans check tool

Remember to to run the 'Orphans', 'Synchronize' and 'Refresh' tools (found in the mod's admin plugin) after upgrade.

Offline

 

#10 2013-09-12 14:31:41

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.4

koos works perfect now... Thanks for fixing the bug.

Regarding integration with post.php: I have had others requesting this before. If I get some time I might create an add-on for this.

By the way have you create integration? smile sorry koos for asking too much sad

Offline

 

#11 2013-09-18 22:25:34

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Automatic Image Upload with Thumbnails 1.4

I will try to put something together for you based on the EZBBC toolbar mod. Hopefully I will get a chance over the weekend to have a look at it.

Offline

 

#12 2013-09-18 22:46:58

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.4

thank koos in advance ... I was also trying to update the gallery add-on mod by FSX (http://www.punres.net/viewtopic.php?id=3557) to work with the latest version of automatic image uplad mod. but I have no success sad

Offline

 

#13 2013-10-07 14:09:18

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.4

hi koos, have you check the integration? Thanks!

Offline

 

#14 2013-10-08 23:12:41

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Automatic Image Upload with Thumbnails 1.4

Yes, I am almost done. Will try to finish it this weekend.

Offline

 

#15 2013-10-13 12:13:38

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.4

thanks koos! smile

Offline

 

#16 2013-10-21 17:40:02

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Automatic Image Upload with Thumbnails 1.4

I'm finally done with the post integration add-on. It is based on the EZBBC Toolbar mod's image upload feature. You can download the add-on here: Automatical Image Upload Post Integration v1.0.2. Let me know how it works for you.

I've integrated everything I could think of, e.g. image type restrictions, usage limit, permissions etc. Settings for this add-on can be set in the top part of the file uploadimg_post.php.

Changelog:
v1.0.2 Added settings to specify the width and height images should be resized to when uploading images via this add-on. Also added option to "rename duplicates". This allows the user to upload an image with the same filename as previously uploaded by the user. A number is just added to the end of the filename (as is done in Windows for example), e.g. filename(1).jpg. So enabling this will prevent the user from getting the message "The file already exists - you cannot replace an existing file".
v1.0.1 Made add-on compatible with all versions of PunBB 1.2.
v1.0 Initial release

Last edited by Koos (2013-11-06 23:00:31)

Offline

 

#17 2013-10-29 08:36:36

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.4

Thanks a lot koos for taking time to create this add-on. By the way where can I change the default size of 640x480?


ps. Appreciate your effort to create this mod! smile

Offline

 

#18 2013-11-06 23:03:12

Koos
Administrator
Registered: 2007-01-14
Posts: 525
Website

Re: Automatic Image Upload with Thumbnails 1.4

I've added an option in v1.0.2 of the add-on that allows you to specify the resize width and height.

Offline

 

#19 2014-02-27 14:52:26

doki
Member
Registered: 2007-04-30
Posts: 225

Re: Automatic Image Upload with Thumbnails 1.4

Possible bug on Foreign file detection tool... It detects upper cased extension (ex. .JPG) as foreign file. I'm not sure if this is normal on the tool.

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.