Threesixtee- question about your avatars... - http://www.mmcafe.com/ Forums


Original message (1402 Views )

Undead Fred
2055th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Threesixtee- question about your avatars..." , posted Sat 29 Jan 06:52post reply

I know I'd asked before, but I couldn't remember the details and I can't seem to look at your script file, but how do you do random tags again? I was wanting to randomize my tags (unless the load times got irritating for everyone, then I'd go back to normal).

I know you have to make a directory and set your tag or avatar as the script file, but I can't remember the exact commands. If you could share those again, I'd appreciate it.






Replies:

threesixtee
842th Post



user profileedit/delete message

Red Carpet Regular Member+



"Re(1):Threesixtee- question about your avatar" , posted Sat 29 Jan 08:01:post reply

quote:
I know I'd asked before, but I couldn't remember the details and I can't seem to look at your script file, but how do you do random tags again? I was wanting to randomize my tags (unless the load times got irritating for everyone, then I'd go back to normal).

I know you have to make a directory and set your tag or avatar as the script file, but I can't remember the exact commands. If you could share those again, I'd appreciate it.



wow. I'm surprised people remembered that I had random scripts for my avatars.

let me see if I can remember how it works, its been a while since I made anything new.

1) have a directory, not necessary, but makes stuff easier to manage. keep all the images and other files inside of it.

2) I use this script, wasn't made by me, but all the credits are included and intact.

<?php

//uberRandom Image Script,
//by Ryan Lukasik (ryan@uberpolak.tk), Jan. 12, 2003
//Free to use, just please leave this block intact.
//Call this script with <IMG SRC="whateveryousavethisas.php">

//"images.dat" will contain the name of each image file
$imgs = file("images.dat");

header("Location: " . $imgs[rand(0,sizeof($imgs) - 1)]);

?>

save this script as randimg.php
whenever you want to use this as a random image, just plug in randimg.php. for example in html it'd say <img src=randimg.php>

3. have a text file named images.dat and list all the files you want randomized therein. mine looks like this:

mmcafe-av-lh.jpg
mmcafe-av-stormtrooper.jpg
mmcafe-av-rikku.jpg
mmcafe-av-hale.jpg

that should be it. you never have to touch the script itself, just change what files you want in the images.dat file. sorry if my explanation is confusing, I can go on AIM later and I can try to explain better later on if you want.

note to self: I should make more sigs and avs.


EDIT: upon further review, it looks like the script doesn't work in firefox (back when I started using the script I was using IE).





[this message was edited by threesixtee on Sat 29 Jan 08:09]

Undead Fred
2057th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(2):Threesixtee- question about your avatar" , posted Sat 29 Jan 08:11post reply

quote:
let me see if I can remember how it works, its been a while since I made anything new.

Cool, thanks. Hopefully I'll have mine set up soon (and make a few more "Undead Fred brain cam" tags).





Undead Fred
2060th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"One more question..." , posted Sat 29 Jan 08:52:post reply

Am I not doing something right? I copied that script into a file called "randimg.php" and all that, and I've got the .dat file set up, but it's not working. You set your avatar or tag as the randimg.php file, right?





[this message was edited by Undead Fred on Sat 29 Jan 09:44]

threesixtee
844th Post



user profileedit/delete message

Red Carpet Regular Member+



"Re(1):One more question..." , posted Sat 29 Jan 15:08:post reply

quote:
Am I not doing something right? I copied that script into a file called "randimg.php" and all that, and I've got the .dat file set up, but it's not working. You set your avatar or tag as the randimg.php file, right?



hm... that is odd. sounds like you did everything right. and yes my avatar is set to being http:.../mmcafe/randimg.php

EDIT AGAIN: it does work with firefox. I just can't constantly refresh it to get different results. avatar will change per visit I guess.





[this message was edited by threesixtee on Sat 29 Jan 15:10]

Undead Fred
2063th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(2):One more question..." , posted Sat 29 Jan 17:04:post reply

quote:
hm... that is odd. sounds like you did everything right. and yes my avatar is set to being http:.../mmcafe/randimg.php

EDIT AGAIN: it does work with firefox. I just can't constantly refresh it to get different results. avatar will change per visit I guess.

So, you've submitted your php file as your avatar on the Cafe servers, or set it to look on your site? I'd assume setting it at the Cafe wouldn't work...

EDIT: Oh yeah, whenever I go to link directly to your file, I see a random image, but when I go to mine, I get part of the script-

//"images.dat" will contain the name of each image file $imgs = file("images.dat"); header("Location: " . $imgs[rand(0,sizeof($imgs) - 1)]); ?>





[this message was edited by Undead Fred on Sat 29 Jan 17:48]

CharlesProphony
1th Post


user profileedit/delete message

New Customer

"Re(3):One more question..." , posted Sun 30 Jan 00:46post reply

just copy and paste the code in a notepad and save it, then rename it "something".php and send to your server :


<?php
//change "$dir_imgs" to the name of directory where your images are
$dir_handle = @opendir("./imgs/");
//this part will read the directory
while ($file = readdir($dir_handle)) {
if ($file!="." && $file!="..") {
$data[]=$file;
}
}
//the header that will redirect the browser to the random file in the "dir_imgs" directory
header("Location: ./imgs/".$data[array_rand($data)]);
?>

then just link directly to the php where you want to appear the image...
(well, the directory specified by you shouldn't contain anything other than images(jpg, gif, png), because this script will try to load any file in the directory and can end up behaving very strangely...)





Nate
426th Post



user profileedit/delete message

Gold Customer


"Re(3):One more question..." , posted Sun 30 Jan 02:17post reply

OH JEEZ. You have Guy Blank as an avatar. I think you earned about a million cool points with me. Wow. I didn't know anyone else here liked that show.





THIS IS DWARF INVASION!

Undead Fred
2063th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(4):One more question..." , posted Sun 30 Jan 08:12post reply

Thanks, Charles. I'll give it a try later on.

quote:
OH JEEZ. You have Guy Blank as an avatar. I think you earned about a million cool points with me. Wow. I didn't know anyone else here liked that show.

Heh heh heh. Yeah, I wanted a shot of Guy with his hands up, but this was the best I could do. Guy with the violin would have been awesome.





Evenor
124th Post



user profileedit/delete message

Regular Customer

"Re(5):One more question..." , posted Sun 30 Jan 09:49post reply

quote:
Heh heh heh. Yeah, I wanted a shot of Guy with his hands up, but this was the best I could do. Guy with the violin would have been awesome.




"I'VE GOT SOMETHING TO SAY!"

Jerri Blank is pure sex.





肝臓入りのオレンジジュース!
腎臓混じりの甘口カレー!
膵臓仕込みのペスカトーレ!
愛しの愛しのサイコホラー

Undead Fred
2066th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(6):One more question..." , posted Sun 30 Jan 11:39:post reply

quote:
Jerri Blank is pure sex.

PEE ON ME

Heh heh. Just watch out, or you'll catch a mean case of syphilis.





[this message was edited by Undead Fred on Sun 30 Jan 16:19]

Iggy
5655th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(4):One more question..." , posted Sun 30 Jan 19:20post reply

quote:
I didn't know anyone else here liked that show.

I've been wanting to buy the DVDs for 3 month now...
It sucks to be poor.





「とにかく、それは愛のムチよ。
愛しいXXX先生は君を愛弟子として愛するがゆえの厳しさよ」だって。

Undead Fred
2067th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(5):One more question..." , posted Mon 31 Jan 08:31post reply

quote:
I've been wanting to buy the DVDs for 3 month now...
It sucks to be poor.

You may as well save up and get the first season at least... that'll at least tide you over until you can get the rest (unless you'd rather get them all at once so you don't wear any of them out).





Iggy
5660th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(6):One more question..." , posted Mon 31 Jan 21:23post reply

quote:
(unless you'd rather get them all at once so you don't wear any of them out).


That was my master plan from the beginning.
let's try next month.





「とにかく、それは愛のムチよ。
愛しいXXX先生は君を愛弟子として愛するがゆえの厳しさよ」だって。

threesixtee
845th Post



user profileedit/delete message

Red Carpet Regular Member+



"Re(7):One more question..." , posted Tue 1 Feb 07:24post reply

so did you get it to work? sorry if I'm not around much... -_-





Undead Fred
2068th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(8):One more question..." , posted Tue 1 Feb 07:28post reply

quote:
so did you get it to work? sorry if I'm not around much... -_-

Nah, I could never get that script you used to work (kept getting part of that script on a direct link instead of an image), and I hadn't tried that other script yet. I'll let you know...





Nate
430th Post



user profileedit/delete message

Gold Customer


"More Strangers With Candy Nonsense!" , posted Tue 1 Feb 07:33post reply

quote:
(unless you'd rather get them all at once so you don't wear any of them out).

That was my master plan from the beginning.
let's try next month.


You know, the movie's coming out soon too...oh, to see the Strangers With Candy movie with dear Iggy...

P.S.- Season 2 is the best, if only for the two-part cult episode.





THIS IS DWARF INVASION!

Evenor
129th Post



user profileedit/delete message

Regular Customer

"Re(1):More Strangers With Candy Nonsense!" , posted Tue 1 Feb 07:42post reply

There was a Strangers with candy Movie?!?!?

I've probably have seen it thinking it was just a long episode...





肝臓入りのオレンジジュース!
腎臓混じりの甘口カレー!
膵臓仕込みのペスカトーレ!
愛しの愛しのサイコホラー

Nate
431th Post



user profileedit/delete message

Gold Customer


"Re(2):More Strangers With Candy Nonsense!" , posted Tue 1 Feb 07:51post reply

quote:
There was a Strangers with candy Movie?!?!?

I've probably have seen it thinking it was just a long episode...



No, no, they just showed it at Sundance and Warner Brothers picked it up for distribution. They'd been filming it since sometime in 2003, I think. But yes, it's finally done and hitting theatres soon. I hope.





THIS IS DWARF INVASION!

Evenor
130th Post



user profileedit/delete message

Regular Customer

"Re(3):More Strangers With Candy Nonsense!" , posted Tue 1 Feb 07:57post reply

quote:
No, no, they just showed it at Sundance and Warner Brothers picked it up for distribution. They'd been filming it since sometime in 2003, I think. But yes, it's finally done and hitting theatres soon. I hope.



Oh I see....

Im all excited now! Thanks Nate!





肝臓入りのオレンジジュース!
腎臓混じりの甘口カレー!
膵臓仕込みのペスカトーレ!
愛しの愛しのサイコホラー

Undead Fred
2069th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(2):More Strangers With Candy Nonsense!" , posted Tue 1 Feb 09:23post reply

quote:
There was a Strangers with candy Movie?!?!?

I had no idea... well, good to hear they're doing more Strangers With Candy. So, it hadn't come to theaters yet? Or is it going to DVD instead?





Nate
432th Post



user profileedit/delete message

Gold Customer


"Re(3):More Strangers With Candy Nonsense!" , posted Tue 1 Feb 10:12post reply

quote:
There was a Strangers with candy Movie?!?!?
I had no idea... well, good to hear they're doing more Strangers With Candy. So, it hadn't come to theaters yet? Or is it going to DVD instead?


Nope, it's not in theaters yet. It does have distribution, though, so it's only a matter of time.





THIS IS DWARF INVASION!

CharlesProphony
3th Post



user profileedit/delete message

New Customer

"Re(4):More Strangers With Candy Nonsense!" , posted Wed 2 Feb 05:32:post reply

just testing my script....





just improving my english...

[this message was edited by CharlesProphony on Wed 2 Feb 05:38]

Undead Fred
2074th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(5):More Strangers With Candy Nonsense!" , posted Wed 2 Feb 06:36post reply

quote:
just testing my script....

Is that white strip on the side a part of the image files, or is it making some kind of little placeholder or something because of the script you used? I've had it do that to me on an old embedded MP3 thing I did... it's annoying. I couldn't figure out how to get rid of it.





CharlesProphony
3th Post



user profileedit/delete message

New Customer

"Re(6):More Strangers With Candy Nonsense!" , posted Wed 2 Feb 09:01post reply

quote:

Is that white strip on the side a part of the image files, or is it making some kind of little placeholder or something because of the script you used? I've had it do that to me on an old embedded MP3 thing I did... it's annoying. I couldn't figure out how to get rid of it.



no, it's because I made the animated one some months ago to use in othe forum and I forgot to crop using the same size in both axis and when I made this script some days ago, I started to make new avatars and discovered about it...
something I will try to correct in the next few days...





just improving my english...

Undead Fred
2077th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(7):More Strangers With Candy Nonsense!" , posted Wed 2 Feb 15:32:post reply

ARGH. I must just be screwing up something somehow... I tried your script too, and it's not working either. I replaced "imgs" with the directory I needed, and it still just shows the text when I link to the file. I don't get it....

This doesn't have to be in unicode or any other format like that, does it? I just left it on the default, but it's just refusing to work.





[this message was edited by Undead Fred on Wed 2 Feb 15:46]

Gojira
1618th Post



user profileedit/delete message

Red Carpet V.I.P- Platinum Member





"Re(8):More Strangers With Candy Nonsense!" , posted Wed 2 Feb 20:22post reply

quote:
ARGH. I must just be screwing up something somehow... I tried your script too, and it's not working either. I replaced "imgs" with the directory I needed, and it still just shows the text when I link to the file. I don't get it....

This doesn't have to be in unicode or any other format like that, does it? I just left it on the default, but it's just refusing to work.



Be sure you're including everything from <?php to the ?> and all the line breaks in between. If anything appears on the same line as a // it is considered a comment and does not process.





Off with your nose

Undead Fred
2077th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"More Candy With Strangers Nonsense!" , posted Wed 2 Feb 22:05post reply

quote:
Be sure you're including everything from <?php to the ?> and all the line breaks in between. If anything appears on the same line as a // it is considered a comment and does not process.

I've been doing that, actually... I knew about the //, so I'd been leaving it in (and taking it out here and there to see if that was magically interfering, even though it's not supposed to), but I STILL can't seem to get it to work. I've been copy/pasting the entire <?php to the ?> and still no luck. I just don't get what's happening...





CharlesProphony
4th Post



user profileedit/delete message

New Customer

"Re(1):More Candy With Strangers Nonsense!" , posted Thu 3 Feb 04:05post reply

ok, the basic question :
are you sure that the server where you're uploading the files supports php?





just improving my english...

Undead Fred
2079th Post



user profileedit/delete message

Platinum Carpet V.I.P- Board Master





"Re(2):More Candy With Strangers Nonsense!" , posted Thu 3 Feb 07:11post reply

quote:
ok, the basic question :
are you sure that the server where you're uploading the files supports php?

Ahhh... I'm wondering if that may be the problem. I'll have to check on it, but I'm thinking that may be why neither script is working.