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

Pages: (2): « First [ 1 ] 2 » Last »
Hosting Random Images!
Author: Message:
.Roy
Veteran Member
*****

Avatar

Posts: 1526
Reputation: 11
20 / Male / –
Joined: Aug 2004
O.P. Undecided  Hosting Random Images!
Well this time im not hosting it using KSMAS so you will need to send me your images via email.


Add me to msn messenger : blattr[at]gmail.com

and ill host it.
06-01-2006 01:15 PM
Profile PM Web Find Quote Report
M73A
Veteran Member
*****

Avatar


Posts: 3213
Reputation: 37
34 / Male / Flag
Joined: Jul 2004
RE: Hosting Random Images!
(L) ROY (L)

lol:P

yay random avatar up again.

This post was edited on 06-01-2006 at 01:16 PM by M73A.

[Image: lost7ru.gif]
06-01-2006 01:15 PM
Profile E-Mail PM Find Quote Report
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
.Roy
Veteran Member
*****

Avatar

Posts: 1526
Reputation: 11
20 / Male / –
Joined: Aug 2004
O.P. RE: Hosting Random Images!
thats what im doing traxor im using your script =.=.
06-01-2006 01:32 PM
Profile PM Web Find Quote Report
user27089
Disabled Account


Posts: 6321
Joined: Nov 2003
Status: Away
RE: Hosting Random Images!
The script isn't mine, I think it was made by Plik a few years ago.
06-01-2006 04:11 PM
Profile PM Find Quote Report
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
34 / Male / –
Joined: Jun 2004
RE: Hosting Random Images!
Please don't use tractors version, but us this one insted:
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);
    header("location: $dir/".$files[$key]);
    ?>

The difference?
This version allows give the browsers a chance to cache the images :P
06-01-2006 06:25 PM
Profile PM Find Quote Report
ayjay
Senior Member
****

Avatar

Posts: 850
Reputation: 58
– / Male / Flag
Joined: Mar 2004
RE: Hosting Random Images!
Plik, I am now about to tell you what you need to do:

Are you ready?...

Comment it!

"Why?" I hear you ask. Here's the answer...

So ajd can leeeeeeearn!!!
06-01-2006 09:27 PM
Profile PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: Hosting Random Images!
you people use too much code :(

code:
<?
$images = glob("./images/{*.gif,*.jpg,*.png}", GLOB_BRACE);
header("Location: ".$images[rand(0,count($images)-1)]);
?>

:cheesy:
06-02-2006 07:57 AM
Profile PM Find Quote Report
John Anderton
Elite Member
*****

Avatar

Posts: 3908
Reputation: 80
37 / Male / Flag
Joined: Nov 2004
Status: Away
RE: Hosting Random Images!
quote:
Originally posted by Eljay
you people use too much code :(

code:
<?
$images = glob("./images/{*.gif,*.jpg,*.png}", GLOB_BRACE);
header("Location: ".$images[rand(0,count($images)-1)]);
?>

:cheesy:
(Y)

Mine is better but lets just leave that for another time shall we :P

Should i comment it (plik's thingo) for you gayjaydee ? :P

This post was edited on 06-02-2006 at 09:13 AM by John Anderton.
[

KarunAB.com
]

[img]http://gamercards.exophase.com/459422.png[
/img]
06-02-2006 09:10 AM
Profile E-Mail PM Web Find Quote Report
ayjay
Senior Member
****

Avatar

Posts: 850
Reputation: 58
– / Male / Flag
Joined: Mar 2004
RE: Hosting Random Images!
NO
06-02-2006 12:57 PM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


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