##############################################################
####                                                      ####
##                                                          ##
#   Simple File Sharer                                       #
#   V2.27                                                    #
#   2016 March 22nd                                          #
#   http://codecanyon.net/user/themac                        #
#   http://codecanyon.net/item/simple-file-sharer/4562987    #
##                                                          ##
####                                                      ####
##############################################################
#
#
#
# update 2016- [2.27]
#
# - improved: added some security checks for direct uploads ("hidden feature") to prevent 
#		+ uploads of more files then allowed
#		+ uploads of files with unwanted/unallowed extensions
#		+ uploades of oversized files
#
# update 2015-12-31 [2.26]
#
# - updated: to Bootstrap 3.3.6
# - updated: to Font Awesome 4.5.0
# - fixed: added connection resource $db for mysqli_error/mysqli_errno to get detailed debugging information on SQL-errors
# - added: robots.txt to protect from unwanted indexing operations from search engines
# - improved: replacing of eventually occurring backslashes with simple slashes in pathgenerations on windows servers (in some rare cases)
# - improved: hiding already considered mysql connection troubles during setup routine
# - improved: direct downloads of admin's won't be counted anymore (download and traffic counter)
# - added: possibility to only allow uploads for logged SFS administrator
#
# update 2015-04-20 [2.25]
#
# - updated: jquery file upload plugin (JS) to 9.9.3
# - updated: to Bootstrap 3.3.4
# - added; responsive behaviour for admin files table
# - improvement: "rebuilt" auto-re-calculation of upload size limit (based on php's post_max_size and upload_max_filesize)
# - fixed: admin statspage -> considering time changes (summer/standard time switch) (step 2, winter->summer)
# - smaller fixes
# - smaller improvements: extended mail header information and added possibility to use additional_parameters (http://php.net/manual/de/function.mail.php)
#
# update 2015-02-06 [2.24]
#
# - updated: updated deprecated usage of php-mysql to php-mysqli
#	make sure to update all your mysql-regarding modifications to mysqli or update other just differences by hand
# - fixed: another Android-Blackberry-IOS fixes again (i.e. Download counter)
# - some corrections: bgcolor in admin's filestable, Bootswatch' Yeti & Readable adaptions
# - added: google ShortUrl Support (as site owner you can choose between adfly, google and bitly, or disable shortener)
# - update: updated to Font Awesome 4.3.0
# - update: updated to Bootstrap 3.3.2
#
# update 2015-01-21 [2.23]
#
# - fixed: multiple mailto email addresses weren't removed after successfully sent multiple file upload information
# - fixed: Android-Download-Troubles with XSendFile
# - fixed: some Android Devices weren't identifying themself as Android devices, considered them now
# - correction: displayed useless "max_file_uploads" instead of essential "upload_max_filesize" on justUpload.php
# - added: adfly Support (as site owner you can choose between adfly and bitly, or disable shortener)
# - update: updated to Font Awesome 4.2.0
# - update: updated to Bootstrap 3.3.1
#
# update 2014-11-17 [2.22]
#
# - fixed: admin statspage -> considering time changes (summer/standard time switch) (step 1, summer->winter)
# - changed: dynamic javascript variables only accessible through POST method
# - fixed: admin filestable -> removed line with wrong linked css file
#
# update 2014-11-05 [2.21]
#
# - fixed (minor): added missing dev file ZeroClipboard.min.map (no impact on functionality)
# - changed: removed html-conversion on faqs.php - now you're able to use HTML-Tags in faqs.lang.php
# - fixed (minor): admin filestable -> displaying correct title when hovering delete button
# - fixed (minor): admin filestable display troubles on IE 8
# - fixed: admin filestable -> sorting/searching by/for filenames was refering to the crypted filenames (SFS 2.15) - fixed now
# - fixed (optical): admin filestable -> wrap superlong filenames (CSS ellipses)
# - fixed: when removing description of single uploaded items success message was be shown 3 times (whyever :) ) - fixed now
# - added: possibility to send upload information to multiple recipients at once
# - improved/added: eleborated hidden SFS feature when dragging files to upload success/result pages
# - improved: considered some MSIE in-compatibilities
# - changes: showing Upload API errors now, if they're happen, but bypassed it's main internal validation :)
# - fixed: considering hours in upload estimations
# - improved: removing orphan database entries of non existing files automatically when running cleanUp (shouldn't happen, but just in case ...)
# - added: admin filestable -> added information about max downloads and deletion date on hovering filename
#
# update 2014-10-10 [2.20]
#
# - fixed: replaced crypted with real filenames on filesgroup page
# - added: possibility to add files to current upload session
# - improved: some status messages can be translated with the language files now
# - added: possibility to add short description to each uploaded file
# - added: possibility to show sent message on download pages too
# - added: file name on download pages now part of the HTML-Title
# - added: possibility to protect files from beeing autodeleted inside the administration
# - improved: detailed and tailored nginx informations to setup routines
# - some smaller fixes and corrections
#
# update 2014-09-26 [2.17]
#
# - fixed (again): new issue occured with Android's doublecall of download links ( more on http://code.google.com/p/android/issues/detail?id=1978 )
# - added: mysql timezone helper, to correct time differences between Webserver and Database-Server
# - added: showing message when finishing upload (especially for bigger files on slower servers - when moving uploaded file into target directory)
# - improved: language switcher is dynamic now
# - changed: using "readfile" instead of "fpassthru" for image previews now
# - fixed: removed HTML Warnings on HTML CODE
#
# update 2014-09-23 [2.16]
#
# - fixed: crypted filenames instead of the origin ones were shown in the emails
# - fixed: removed dashed lines from multiple upload mails when sending no message
# - improved: disabling send-button and showing animated icon when sending download information
#
# update 2014-09-16 [2.15]
#
# - additional optical fix: super long image names fix on download and deletion pages for NON-Image-downloads too
# - fixed: removed mistakenly used PHP "short open tags" (admin/files)
# - added: displaying upload speed
# - added: displaying estimated time and elapsed time during upload
# - optical fix: truncating superlong file names on dashboards "The Last File"-section
# - added: uploaded files will be named on server with a crypted name
# - optimized: using origin filename to display on dashboards "The Last File"-section instead of used name on server
# - optimized: using origin filename to display on admin's files table instead of used name on server
#
# update 2014-08-23 [2.1]
#
# - optical fix: super long image names fix on download and deletion pages
# - added: copy to clipboard function for flash enabled devices
# - added: social shares on download pages
# - added: social shares after uploads (multiple and single uploads)
# - optical fix: optical corrections for the datatables inside the administration
# - improvement: jquery uploader using RENAME for moving instead of COPY to move file into it's target directory (faster and spacesaving) 
# - fixed: datatables fix for staying on same page when deleting items
#
# update 2014-08-19 [2.01]
#
# - fixed: fixed footer width on smaller devices (responsive issue)
# - fixed: button (follow link) functionality was not given on filesgroup page
#
# update 2014-08-15 [2.0]
#
# Initial release based on SFS 1.63
# - improved: updated the whole project to Bootstrap 3.2.0 with 17 themes
# - improved: nicier layout (as I think :) )
# - added: possibility to generate Bitly short URLS
# - added: possibility to generate scanable QR-Codes
# - added: CAPTCHA protection for contact and abuse form
# - added: HTML Emails instead of plain text ones
# - improved: updated various javascript plugins
# - refinement: allover :)
# 
#
#
#
#########################################################################################
#                                                                                       #
#   here's a cut between SFS 1.x and 2.x                                                #
#                                                                                       #
#########################################################################################
#
# update 2014-02-22 [1.63]
#
# - fixed: MSIE download click button doesn't work on some versions of MSIE
# - improved: disconnect when trying to reconnect to lost mysql connections
#
# update 2014-01-12 [1.62]
#
# - fixed: an old version of the setup routine was used (1.55) with SFS 1.61
#
# update 2014-01-06 [1.61]
#
# - fixed: combination of disabled autodeletion (delDays set to -1) and enabled user defined deletion caused deletion of all files
# - added: information about maximum downloads on download page if set by uploader
# 
# update 2013-12-27 [1.6]
#
# - refinement: layout modifications for Smartphones
# - fixed: androids double calls URLs (http://code.google.com/p/android/issues/detail?id=1978)
#  Session or password protected downloads were not possible
# - fixed: download has started information after clicking donload button
# - refinement: maximum filesize (database field) was 2GB, now maximum filesizes up to 8 Exabytes are possible
# - added: uploaders can now define the maximum age of uploaded files
# - added: uploaders can now define the maximum number of downloads for uploaded files
# - refinement: automatically database reconnection if needed (mysql server has gone ...)
#
# update 2013-10-22 [1.55]
#
# - fixed: combination of download timer and password protection stopped working with SFS 1.53
#
# update 2013-10-16 [1.54]
#
# - fixed: overall stats stops at 2GB totals, now values up to 8 Exabytes are possible
#  update calculates approximate values for the previous up- and downloads
#
# update 2013-10-05 [1.53]
#
# - fixed: download troubles on Microsoft Internet Explorer when using the download timer
#
# update 2013-10-04 [1.52]
#
# - fixed: upload button was not clickable everywhere on safari browsers
# - fixed: safari on Windows platforms is not able to handle multiple file uploads
#  so the multi upload will be disabled autmomatically for Safari Browsers on Windows platforms
# - fixed: drag and drop for Safari Browsers on Windows platforms
# - fixed: added missing language keys to german language files
# - refinement: moved all multi-upload resets to config.php
# - refinement: disabled drag and drop functionality for Microsoft Internet Explorer lower 10.0
#
# update 2013-09-19 [1.51]
#
# - fixed: re-upload after cancel with cancel button was only possible on multiple uploads
# - fixed: JS debug message
# - added filesize progress in bytes during upload ( Size uploaded / Size to upload)
#
# update 2013-09-11 [1.5]
#
# - added cancel button to break current upload process
# - added: stats data for deleted files are avail after deletion furthermore
# - added TB and PB for file size calculations
# - added support for utf encoded mail subjects
# - refinement: origin filenaming for downloads through XSendFile
# - refinement: additional file existing check
#
# update 2013-08-21 [1.42]
#
# - fixed: on multiple uploads the displaying of the downloadlinks was shown too early (after the first upload), 
#   this effect was visualy when uploading greater files
#
# update 2013-08-10 [1.41]
#
# - fixed: removed XSendFile Debug Message from download handler
# - refinement: displaying date without time for deletion point of time
#
# update 2013-07-29 [1.4]
#
# - added .htaccess directory browsing protection for not secured installations
# - added possibility to use [delDays] in the mails for the users
# - added possibility to upload multiple files
#  - can be turned on/off in the config
#  - number of max files can be defined in config
#  - link to group of files will be generated
# - added to administration: external source for the files datatables
# - added to the administration: possibility to bypass confirm dialog on file deletion
# - added protection of mistaken leaving the "Upload succeeded" site without saving or sending download links
# - added possibility to disable autodeleter
# - added responsive behaviour by default with fix for the max-width effect
# - fixed generating preview image for PNG files
# - added enhanced direct download protection, should now work for higher usage too
# - added naming download files with the original one during the download process
# - added transforming of download button after download has started (preventing of double call the download page by clicking the download button twice)
# - fixed inside the administration: chart generation w/o enough data for calculations (i.e. just one file type, just one day) - next fix :)
#
# update 2013-06-21 [1.3]
#
# - fixed cleanUp function, it was deleting from database just regarding time of upload
# - max upload size in byte now multiplicated with 1024 * 1024 instead of 1000 * 1000
# - cutting (ellipsis) supperlong file names on
#  - download page (headline)
#  - delete page (headline)
#  - name of last file table on admin's dashboard
# - G (Gigabyte) values of post_max_size and upload_max_filesize are possible now too, no need to convert to Megabyte any longer
# - supporting mod_xsendfile for Apache2/Apache2.2 - built to handle download of bigger files w/o running into performance troubles (https://tn123.org/mod_xsendfile/)
# - bandwidth throtteling(define the kbps in the config)
# - no memory usage any longer on dowloads, so memory_limit doesn't have to be increased
# - sorting by upload time desc in admin's file table by default 
# - updated to Bootstrap v2.3.2 (shift and middle click corrections for Firefox)
#
# update 2013-05-27 [1.2]
#
# - fix for chart generation w/o enough data for calculations (i.e. just one file type, just one day)
# - replaced crystalproject Icons with EdenIcons Bright Icons (http://www.iconeden.com)
# - added countdown function to set waiting seconds before download is possible (can be configured and disabled in the config)
# - added possibility to display preview of image on download page (requires GD Library)
# - delDays depending on last download or age
# - download link and delete link input fields are readonly now
# - possibility to password protect files
# - FIX: now considering telephone number in contact form  
# - reportig file function implemented on download page
# - possibility to add message to receipient
#
# update 2013-04-23 [1.11]
#
# - added number of days remaing until deletion to delete and download page
# - added drop down menue with language switcher
# - fixed bug on displaying expiration date
#
# update 2013-04-21 [1.1]
#
# - added missing possibility to logout from admin interface
# - admin area: new strategy to display filetypes in the pie chart
# - fix for too long filenames (extensions were cutted)
# - added possibility to disable direct downloads via IP or SESSION, can be disabled too
# - list of filextensions can be denied
# - list of filextensions can be allowed
# - percentage values are displayed inside the progressbar too
# - added age information to download and deletion page
#
# released 2013-04-19 [1.0]
#