###############################################################################
# File Attachment Mod ReadMe File                                             #
###############################################################################
# YaBB: Yet another Bulletin Board                                            #
# Mod Author: Dave Baughman	                                              #
# =========================================================================== #
# Current Version:  Beta 2.5                                                  #
# Release Date: 5/15/03                                                       #
# Please report bugs and comments directly to oxide@comcast.net		      #
###############################################################################


Allows the attachment of a file to a post. Filesize, types, and paths all must be edited in the admin center after applying this mod before file attaching will work. If settings are not applied immediately, uers may experience errors when trying to post until you define all the variables for the mod. Directory and URL paths should be without trailing '/'. The directory you create for attachments should be world readable and writeable, also (chmod 666, 766, or 777).
The paperclip.gif file should be placed into your YaBBImages folder or wherever you keep all your YaBB images. The Attachments.pl file should be put into your Sources folder (leave as is, dont chmod to anything), and upload attachments.txt, oldestattach.txt, and maxattachsize.txt to your variables folder and chmod all of them to 666. Make sure you upload everything but the paperclip.gif image in ASCII mode.

A few things to be aware of:

- Recommend naming attachments directory "attachments" and placing in your main documents folder to facilitate auto-configure feature's operation in admin center
- Your attachment directory MUST be world writeable (that means either 666, 766, or 777) and you must write out the FULL path to the directory. (ie, no ../../attachments type paths). If auto-config is sucessful, the path will be set for you.
- When attachments are made, they are automatically chmoded to 666 to prevent the possible execution of any scripts.
- Make sure your directory and url paths do not have a trailing '/'
- The filetypes should be entered with a space between each one, no period
- When attachments are made and then the post if previewed, the attachment must be reselected. The reason for this is the security settings on web browsers - having a file field that was automatically filled out could be a security risk as people could try and grab files off of other peoples computers without them being aware of it. Therefore, when previewing, you must reselect the attachment. Nothing I could do that change that one I finally found out, so you'll have to whine to web browser people if you want the value to be carried over.
- Users MUST be using a RFC1867 browser for this mod to work. Basically, that means  Netscape 2.0 and IE 3.0 and up. If your browser isnt RFC1867 compliant by now, you don't deserve to be let on the internet anyway and your teeth are probably gone.
- Before this mod will work, you MUST edit and save your settings in the admin center under Edit Preferences and Settings.

Beta Version 2.5 (For YaBB Gold SP 1.3.1 users)
------------------------------------
- Same features as 2.4, but made compatible for SP 1.3.1
- Additional features planned before final release of v2.5, but want to make sure initial port to SP 1.3.1 works fine before adding features

Beta Version 2.4 (For YaBB Gold SP 1.1 users)
------------------------------------
- Fixed bugs (credits below), most involving the attachments log
- Added new server settings, temporary file settings, and attachments writing routine using FILE::Copy
- Added auto-configuration figure
- Thanks to Jake for finding an attachments log bug and posting a fix
- Thanks to Boris Cornet and Jason Sutherland for finding and posting fixes for the move thread bug with the attachments log
- Thanks to Exxon Tigermart for $1.29 extra large cappuchinos. 

Version 2.3 (For YaBB Gold SP users)
------------------------------------
- Thanks to Jason Sutherland (BHRA Webmaster) for bug fixing - specifically in Attachments.pl - and some great new ideas, Mike Perron (Demonslayer) for beta testing the mod, and thanks to Homey for compatibility testing
- First version compatible with the new YaBB SP versions of YaBB. If you are using a non-SP version of YaBB (ie, YaBB 1 Gold Release), you should use the Old YaBB 1 Gold Release version of this mod included in the zip file (which is v2.2b).

Version 2.2b (Included for users still using YaBB 1 Gold Release)
------------------------------------
- Merged Windows and Unix/Linux versions of mod into one mod file. Webserver type is now selectable via Edit Preferences in the Admin Center. If you have problems, try selecting the other webserver type before reporting to http://boardmod.xnull.com
- Small change to stop file attachment directory url from getting written unnecessarily to posts when no attachment was made.


Version 2.2a
------------------------------------
- Fixed error when using password reminder function. Added in use CGI; to executable files (Reminder.pl and Printpage.pl)

Version 2.2
------------------------------------
- Packaged two version of the mod: one for people on unix flavor hosting and one for people on windows hosting.
- Fixed the writing bug (stupid oversight, really) in the unix version mod.

Version 2.1
------------------------------------
- Extensively beta tested by codehammer and Monty Burns before release - many, many thanks. Couldn't have done it without you.
- Improved write routine for attachments and added in clean up checks for temp files left over (native Windows problem).
- Added ability to give attachments folder a max capacity. Useful for sites with less webspace so directory doesn't get too large if you forget to check up on it for a long time.
- Added an attachment statistics and functions area in the admin center. Tells total attachments in directory, total space they take up, and how much space is left if you've set a max capacity on your attachments directory. Also includes an attachment log where attachments can be deleted individually or all at once. Logs gives detailed stats on when file was uploaded, what thread (with link), by who, etc. Thanks to StarSaber for the log idea.
- Attachments can now be deleted from attachment section in admin center by date or size.
- Attachments are now deleted if the post, thread, board, or category they are located in is deleted. If a single post is deleted, only an attachment on that post will be removed as well; all other attachments in the thread remain until they are deleted.
- Added an option to turn on/off file uploading in admin center.
- Add an option to turn on/off guest uploading in admin center.
- Picture attachments are displayed in the post they are attached to (can be turned off in admin center).
- If an attachment gets deleted, links to it will instead become normal text with the message "(attachment deleted)" next to them.
- Error messages made much more informative

-> Planned upgrade
------------------------------------
- Ability to allow uploading only in specified boards.

Version 2.0 Beta (non-public)
------------------------------------
- Total rewrite of attachment mod, most importantly of the reading routines of the forms. The old routine caused many servers (mostly IIS) to hang or timeout when trying to post. The new routine uses CGI.pm to parse the form now, which has yielded 100% success rate when uploading, currently.
- Beta tested by PostDeals and Forced_Vengance. Many thanks.

Patch Releases for v1.0 (by DaveG)
------------------------------------
- Fixed "ghost paperclip" error which occured because of previously modified posts having a different file structure.
- Put attachment writing routine in a more logical place so attachment wasnt written if posting of message timed out.
- Many, many thanks to DaveG of http://www.cafetropico.com for releasing these patches for the community while I was away.

Version 1.0
------------------------------------
- Attaching of files made possible
- Can specify max size of attachments in KB (optional)
- Can specify allowed filetypes or allow all types
- Overwriting check made so user doesn't overwrite another user's attachment.
- Error messages outputed when user exceeded max attachment size or attempted upload of invalid filetype.