Welcome to Gaia! :: *ALMOST* Every Random Sig Method Known To Gaia! | Forum

Register FaceBook Login Login

 

 
GST

Welcome to Gaia's forums, where millions of members gather to discuss random stuff, make new friends,
complain about life, argue about nothing, laugh at dumb pictures, discuss serious issues and/or curse like sailors.

Lurking is creepy. Quit skulking in the shadows and join the conversation!

Register to reply

Advertisement
Share:  
forum:92, topic:4400804
<< < 1 2 ... 9 10 11 12 13 14 15 16 ... 23 24 25 > >>
Peng
R A M Z A
Androphobia
How about random text signatures (like off of cutandpastescripts)? I would like to do that, but it has yet to work. XP
random text runs off of javascript...
the only way to have random text woud be to make the text in an image...
then add it to a random image script


Or you could do some fancy PHP that would make a randomly-picked string of text into an image.


Either way, this may have been mentioned already, but I had to change Ag2S03's code a bit to get it to work right:

&lt;?php
$links = array(
"images",
"more images.jpg",
"blahblah.gif",
"myimage.png")

$howMany = count($links) -1; // number of images to randomize

srand ((double) microtime() * 948625) // seed the randomizer
$randNumber = rand(0,$howMany) // make the random Number

//select the image
header("Location: ".$links[$randNumber])
?&gt;


I had to make it subtract one from $howMany, and then make the minimum number rand could pick be zero instead of one. Otherwise the first image wouldn't ever show, and sometimes it would output absolutely nothing.


all of those lines are unnecessary anyway.....PHP has array_rand() to pick a random element from an array. and as of php 4.2 (long time ago), you don't need to seed the random number generator

so really, it can be shortened to this:


&lt;?php
$links = array("images","more images.jpg","blahblah.gif","myimage.png")
header('Location: ' . array_rand($links))
?&gt;
 
     
 
Myspoonistoobig
all of those lines are unnecessary anyway.....PHP has array_rand() to pick a random element from an array. and as of php 4.2 (long time ago), you don't need to seed the random number generator

so really, it can be shortened to this:


&lt;?php
$links = array("images","more images.jpg","blahblah.gif","myimage.png")
header('Location: ' . array_rand($links))
?&gt;


If I didn't seed the random number generator, it wasn't very random. Like it would show the same image three or four times in a row. confused

But it can be shortened that much? Cool. smile

Edit: That didn't work. razz It just tried to redirect to a random number in the directory the script was in, not the image 'assigned' that number. (IE it would redirect to http://www.domain.com/sig/7 instead of http://www.domain.com/sig/image7.png.) This works, though, and it feels a bit faster than the old code:

&lt;?php
$links = array("images","more images.jpg","blahblah.gif","myimage.png")
$randNum = array_rand($links)
header("Location: ".$links[$randNum])
?&gt;


Edit: Just out of curiosity, I tried this, and it worked, too:

&lt;?php
$links = array(
"image.png",
"other-image.jpg",
"blahblah.gif",
"myimage.png"
)
header("Location: ".$links[array_rand($links)])
?&gt;
     
*bumps the thread*

Must...get...stickied...eventually... gonk domokun
 
     
 
Thats really handy, thanks 3nodding
     
http://i32.tinypic.com/2sbjs6v.jpg
domokun heart
 
     
~I finally got my Staff of the Angels!!!~
Mya Moonlight wins epically at being an awesome friend. ;D <3

[Ye Olden Graphics Shoppeh]
 
Hmm..I can't get to blackfire...I hope it comes back soon.
     
@peng: oh yeah. oops, little mistake there sweatdrop
 
     
http://i34.tinypic.com/9r4z1c.jpg
 
Yeah.

For some reason black fire isn't working.

Is the site down or something? sweatdrop
     
err...i was told to come to this thread with my problem so...
i have a rotating image script with a single sigmap. the rotating images are a bunch of pets and my sigmap. the pets are showing up, but not the sigmap. i dont know whats wrong..perhaps someone here knows...heres the code..

Quote:
&lt;?php
$links = array(
"http://img.photobucket.com/albums/v451/leatrix/ImageMaps/mapstary.jpg",
"http://img.photobucket.com/albums/v451/leatrix/pets/ryukogrown1.jpg",
"http://img.photobucket.com/albums/v679/Gauze-Mizin/kyegg.jpg",
"http://img.photobucket.com/albums/v679/Gauze-Mizin/mitsukiegg.jpg" wink ;

$howMany = count($links); //4

srand ((double) microtime() * 948625); //seed the randomizer
$randNumber = rand(1,$howMany); //make the random Number

//select the image
header("Location: ".$links[$randNumber]);
header("Location: ".$links[$randNumber]);
header("Location: ".$links[$randNumber]);
header("Location: ".$links[$randNumber]);
header("Location: ".$links[$randNumber]);
header("Location: ".$links[$randNumber]);
header("Location: ".$links[$randNumber]);
?&gt;


and the code for my sig


http://frozen.t35.com/random.php?10,18
 
     
http://frozen.t35.com/random.php?10,18
 
Now let's see if I got it right. xp
     
I can't get it to work. crying
 
     
http://www.cutandpastescripts.com/cgi-bin/randomimages/randomimages.pl?username=NeoNeko
 
Black Fire nor Cut and Paste scripts are working for me.

They both just get stuck on one image.
     
I have a faint memory of somebody once telling me that the only way for one to live a good life is to act on their emotions.
http://tinyurl.com/2qsv3z
I used blackfire and its working great, thank you so much for this thread. smile
 
     
 
This has been bookmarked whee
     
Rika Lotus:

I can't really help you, but why do you have the header line there seven times? I see no point of doing that.... confused

....Wait, the image that's not showing up is the first one? See my previous posts in this thread for how to fix it. 3nodding
 
     
<< < 1 2 ... 9 10 11 12 13 14 15 16 ... 23 24 25 > >>

Quick Reply

Enter both words below, separated by a space:

Can't read the text? Click here

Submit

We will be phasing out support for your browser soon.

Please upgrade to one of these more modern browsers.