What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Random Image Script (Not KSMAS)

Random Image Script (Not KSMAS)
Author: Message:
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
35 / Male / –
Joined: Jun 2004
RE: Random Image Script (Not KSMAS)
Heres the one i coded myself for my avatar.
code:
<?php
$dir = "imgs";
$dh = opendir($dir);
$files = array();
while (false !== ($filename = readdir($dh))) {
$files[] = $filename;
}
sort($files);
array_splice($files, 0, 2);
$filesnum = count($files);
srand( (double) microtime()*1000000 );
$randnum = rand(0, $filesnum - 1);
readfile($dir . "/" . $files[$randnum]);
?>
It basically randomly pics a file from the imgs folder and uses that as the image.
Note: The file structure has to be
avatar.php
imgs/
and dont stick anyother files in the imgs folder, as it uses them all.

This post was edited on 01-20-2005 at 06:45 PM by Plik.
01-19-2005 09:34 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Random Image Script (Not KSMAS) - by user27089 on 01-19-2005 at 09:31 PM
RE: Random Image Script (Not KSMAS) - by Plik on 01-19-2005 at 09:34 PM
RE: Random Image Script (Not KSMAS) - by user27089 on 01-19-2005 at 09:37 PM
RE: Random Image Script (Not KSMAS) - by Plik on 01-20-2005 at 06:43 PM
RE: Random Image Script (Not KSMAS) - by fluffy_lobster on 01-20-2005 at 06:47 PM
RE: Random Image Script (Not KSMAS) - by user27089 on 01-20-2005 at 09:34 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