Description: Adds a link to topic forms to allow the user to upload files to the server. A link is also added the avatar popup to allow the user to upload a custom avatar. In the upload popup, the user has the ability to delete previously uploaded files through an 'upload manager'.
All of these settings are controlled through the CP. (primary settings -> general), where the admin can set what user groups can upload files and/or avatars, how big of files they can upload, and how many each group can store. The admin can also set the type of files/avatars that can be uploaded, and the upload paths.
Also added is a field to the properties of each forum details to allow or turn off file uploads. And a field is added to each profile to override user group settings to either allow or completely block a user.
Files are loaded to the uploads_dir/user_number. You can put it into a new directory, as it will attempt to create it, as long as the parent directory exists.
A little bonus, (gizzy's idea ), was the ability, through upload manager, to go into other user directories and delete files in there. Right now, only administrators have the privilages. To change it, go to the ManagePage function, and change the "$user_profile[8] eq 'Administrator'" part.
If your behind a firewall/router; it may be blocking the ability for the server reading your referer, thus disabling the uploader. Click below for a version without the referer check.
[ link removed, link above does the job ]
Credits: Allen Ayres, LK and freeTV, and Ely_M, Ian Spence(for some of the manager code )
A somewhat strict security precaution was added to prevent users from impersonating fields, like forum numbers. This is done through the user referal. It will strip/shred it, and the user coming from the host or a valid forum number, it will give an error. If it smells a foreign host, it'll pull posthackdetails. You can't also just call ubb_upload.cgi through the address bar.
In other words, it won't function without a referer. If you encounter problems with it, when it's not supposed to error out. Please post here if you do.
To test it out on my board. username: ubbtest password: test
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.