Topic: Attachment Mod 1.0.1 by Frank H
##
##
## Mod title: Attachment Mod
##
## Mod version: 1.0.1
## Works on PunBB: 1.1.1
## Release date: 2004-01-21
## Author: Frank Hagstrom (frank_n05pam@hotmail.com)
##
## Description: This mod will add the ability for attachments beeing
## posted in PunBB 1.1.1
##
## Affected files: admin_forums.php
## delete.php
## edit.php
## post.php
## viewtopic.php
## commonadmin.php
##
## Affects DB: Yes
##
## Notes: This mod stores the files in the database, thus you must
## configure it to accept large querys. You must set this
## alittle larger than the files you accept. Settings for
## mysql can be found in my.cnf (or in windows my.ini).
## Furthermore you also need to let php accept large posts,
## and files attached. Set this in php.ini.
##
## The attachment mod can be configured by altering the
## /include/attach.php file, in there you will find the
## following variables:
##
## $attach_use_icon - Set this to false if you don't
## want icons next to your
## attachments. Users that don't want
## to view images, don't see icons.
## $attach_max_size - Set this to the max allowed
## filesize you want to be uploaded.
## Will be dependent on what you have
## set in the configuration of PHP
## and SQL. This is for the whole mod
## and each forum is then configured
## with it's own max size, that cannot
## be larger than this.
## $attach_always_deny - These are the files the attachment
## mod will deny from everyone but
## the Administrators. So if you
## allow all files on a forum, these
## will still be rejected, and it's
## impossible to override by setting
## the forum to allow them. Good for
## the forum owner that he has the
## control, and not the admins.
## $attach_mime_types - This holds different mime types if
## the browser fail to supply them.
## $attach_icon_mime - This array links each mime to an
## icon. Option to link to extentions
## might be added at a later version.
##
## Generated with ModGenerator (http://modgen.cactuz.nu/)
## on: 2003-09-06 20:26:03
## Modified manually to comply with PunBB update
## on: 2004-01-21 15:12:15
##
## 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.
##
##
If you use another language you need to copy en_attachments.php into that language directory and rename the two first letters to match. And then you can edit the language file and if you'd like, e-mail it to me and I will post in on the download page.
On that same link, you will also find a zip containing more colors for the icons, and it also has a template for your own board if you want something other.
Have fun, and remember to make backups
IF YOU UPDATE:
Then you should skip step "2. RUN" when you run the install_mod.php, this is only needed for fresh installs!, sorry all for not making a test if it was already there. Thanks to JohnS for noticing this.
BUG! IMPORTANT!!!!
Guests are recognized as registered users, and can thus post and download attachments that normal registered users are allowed to!!! This is a security risk, and you should update some files according to this post I did a little bit down this thread. I will replace the code and make a version update, as this is an important bug to be ironed out... but if you have installed it, do this fix ASAP!
Sorry all, but the fix is quite simple to perform. And thanks JohnS for bringing this to my attention!
More tweaks to do for later versions
* To get filenames with spaces work better on some browsers (not all), this script change renames some characters to url format.
* For 1.1.5 you need to do a modification in attachment.php. Read this post by me, for information about how you get it to run.
* Furthermore, you need to modify install_mod.php and set 1.1.5 as version number, or whatever the version you're installing it on is. (seems to work with these fixes up to 1.1.5)
When will the new version be released?
I'm not going to rewrite the mod before PunBB1.2 is released. I have come to this conclusion after starting to rewrite it for 1.1.5, but there would just be too much work for nothing, as 1.2 seems to have modifications more or less everywhere, a group system, other output to browser etc.
So, the big rewrite will happen after 1.2 is released, and will take a little while aswell (lots of code to do)
(The rewrite has begun, not much will be the same between the two mods, as rights handling has changed, and I will no longer store files in the database, so pretty much everything is changed...therefore next release will be 2.0)
IIS users!
Important! If you're installing this on an IIS machine, there has once been a problem where the admins are the only ones allowed to post files. So you therefore may ge tthis problem aswell. I have no idea what's wrong, and why it does this. So I haven't come up with a fix for this.
The files that work fully on an apache machine fail on an IIS machine. I'm sorry to say this, but I haven't a clue what's wrong. When I write the new version I'll try to figure out what may have caused it and how to bypass it.
Either way, uploads and downloads still work for administrators.