What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » General » General Chit Chat » Hosting Random Images!

Hosting Random Images!
Author: Message:
user27089
Disabled Account


Posts: 6321
Joined: Nov 2003
Status: Away
RE: Hosting Random Images!
Why don't you just use this script:

code:
<?php
$dir = "imgs";
$dh = opendir($dir);
$files = array();
while (false !== ($filename = readdir($dh))) {
$files[] = $filename;
}
sort($files);
array_splice($files, 0, 2);
srand( (double) microtime()*1000000 );
$key = array_rand($files);
readfile($dir . "/" . $files[$key]);
?>

Make a folder called "avatar" on your server, for example http://skarz.co.uk/avatar/ then in that folder put that code in a .php file (this is where you will link the image to, ie. http://skarz.co.uk/avatar/random.php will go in the avatar url box in the user cp). The images that you want shown should go in the "imgs" folder: http://skarz.co.uk/avatar/imgs.

I doubt it would be that hard to just make seperate folders for different people. You can't be hosting that many people :p.
06-01-2006 01:19 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Hosting Random Images! - by .Roy on 06-01-2006 at 01:15 PM
RE: Hosting Random Images! - by M73A on 06-01-2006 at 01:15 PM
RE: Hosting Random Images! - by user27089 on 06-01-2006 at 01:19 PM
RE: Hosting Random Images! - by .Roy on 06-01-2006 at 01:32 PM
RE: Hosting Random Images! - by user27089 on 06-01-2006 at 04:11 PM
RE: Hosting Random Images! - by Plik on 06-01-2006 at 06:25 PM
RE: Hosting Random Images! - by ayjay on 06-01-2006 at 09:27 PM
RE: Hosting Random Images! - by Eljay on 06-02-2006 at 07:57 AM
RE: Hosting Random Images! - by John Anderton on 06-02-2006 at 09:10 AM
RE: Hosting Random Images! - by ayjay on 06-02-2006 at 12:57 PM
RE: Hosting Random Images! - by callmegarfield on 04-04-2007 at 02:30 PM
RE: Hosting Random Images! - by Zahid™ on 04-04-2007 at 02:42 PM
RE: RE: Hosting Random Images! - by callmegarfield on 04-04-2007 at 02:59 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On