Img48 is a very simple image hosting site written in PHP with a script that will remove images after 48 hours. It uses flat CSV database files instead of a MySQL database to simplify site requirements.
- PHP 5 (Developed under PHP 5.3.2-1ubuntu4.14 - Ubuntu 10.04)
Img48 is licensed under the MIT license. See LICENSE for details.
Installation and Usage
Place the entire directory structure in the site directory from which you want it to run. Ensure that the db, images, and thumbs directories are read/writeable by your web server and tada! That's all there is to it.
If you want the "Delete after 48 hours" functionality, add a crontab entry to run cleanup.php however often you feel is appropriate (using cron of course assumes you're on a Linux host). Make sure that the script runs as the same user as your web server, otherwise a problem will occur where the db_lock file stays and the index cannot be updated.
Description of Files and Operation
globals.php - contains file/directory path constants and should be edited if you desire to change the directory structure/file names.
index.php - main page, has upload form.
uploaded.php - page displayed after a user has uploaded an image, with links and such.
recent.php - page that displays recently uploaded images.
cleanup.php - script that should be run periodically to remove outdated images.
banned.html - page user is forwarded to if they are banned for abuse by the IPlogger class.
db/imageindex.csv - CSV database containing information about uploaded images. The row data is in the following format: uploader-ip,upload-timestamp,filename.
db/iplog.csv - Used by IPlogger.class.php and other parts of the site. Keeps data on users by IP, tracking number of visits and ban information if they send too many requests in too short a time (DOS attack).