This question keeps coming up, but it's always impossible to find the old threads on it for some reason. So here's a complete walkthru:
1) Sign up for free web hosting that supports PHP scripts. One popular example is ripway.com.
2) Create a folder in your webspace called avatar.png or sig.png.
3) In that folder, create a new text file called index.php. Copy the stuff in this code box into that file:
Code:
<?php
$folder = '.';
$extList = array();
$extList['gif'] = 'image/gif';
$extList['jpg'] = 'image/jpeg';
$extList['jpeg'] = 'image/jpeg';
$extList['png'] = 'image/png';
$extList['PNG'] = 'image/PNG';
// You don't need to edit anything after this point.
// --------------------- END CONFIGURATION -----------------------
$img = null;
if (substr($folder,-1) != '/') {
$folder = $folder.'/';
}
if (isset($_GET['img'])) {
$imageInfo = pathinfo($_GET['img']);
if (
isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) &&
file_exists( $folder.$imageInfo['basename'] )
) {
$img = $folder.$imageInfo['basename'];
}
} else {
$fileList = array();
$handle = opendir($folder);
while ( false !== ( $file = readdir($handle) ) ) {
$file_info = pathinfo($file);
if (
isset( $extList[ strtolower( $file_info['extension'] ) ] )
) {
$fileList[] = $file;
}
}
closedir($handle);
if (count($fileList) > 0) {
$imageNumber = time() % count($fileList);
$img = $folder.$fileList[$imageNumber];
}
}
if ($img!=null) {
$imageInfo = pathinfo($img);
$contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
header ($contentType);
readfile($img);
} else {
if ( function_exists('imagecreate') ) {
header ("Content-type: image/png");
$im = @imagecreate (100, 100)
or die ("Cannot initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 0,0,0);
imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color);
imagepng ($im);
imagedestroy($im);
}
}
?>
4) Add whatever images you want (that conform to forum rules) into that folder. Note: On ripway, you have to upload them to the main folder first and then transfer them to the one with the .png or whatever on the end.
5) For avatars: In the "Link to offsite avatar" box in your profile, put the URL of the folder. It'll look something like
Code:
http://h1.ripway.com/username/avatar.png
(but "username" and maybe "h1" will be different).
For signatures: Put something like this into the signature box in your profile:
Code:
[img]http://h1.ripway.com/username/sig.png[/img]
Obviously replacing "username" with your username, and "h1" if ripway tells you it's something else.
Don't hesitate to ask questions here in this thread!
EDIT history: Simplified the wording. Changed out "directory" in favor of "folder" so as not to confuse all the peeps that didn't happen to be a computer nerd in the 90s.