Minimal PHP Script to host a simple Image Hosting, like http://www.imageshack.us.
Some demo:
Version: 1.1 (04/04/2009)
Download: Link (HTTP)
License: LGPL
Requisites: PHP5, GD Library
Author: Clodo (Contact me with a PM in Osiris Forum)
$baseUrl | Base url of installation. |
$homeUrl | Same as $baseUrl. It's the logo link. |
$title | Title |
$subtitle | Subtitle. Specify here if is a private file hosting. |
$maxSize | Maximum allowed size, in bytes, of uploaded file. Default: "2000000" |
$thumbWidth | Width, in pixel, of generated thumbnail. Default: "200" |
$imagesPath | Path of images directory. Must be writable. Default: "images/" |
$thumbsPath | Path of thumbnail directory. Must be writable. Default: "thumbs/" |
$tempPath | Path of temporary directory. Must be writable. Default: "temp/" |
$listAllowed | If true, anyone can view the hosted files with Default: "true" |
$thumbsCols | If List are enabled, specify the number of columns in Thumbnails List. Default: "7" |
$password | If specified, a password is required to upload files. Can be useful for private repository. Default: none |
$logo | The path of the logo image. Default: "logo.png" |
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.mydomain.ex/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.frienddomain.ex/.*$ [NC] RewriteCond %{REQUEST_URI} !^/stolen.png [NC] RewriteRule \.(gif|GIF|jpg|JPG)$ http://www.mydomain.ex/host/stolen.png [R]The example above will redirect any image request to an image "http://www.mydomain.ex/host/stolen.gif" if the request don't come from domains www.mydomain.ex or www.frienddomain.ex.