Jump to content

Random sig script


Stephanie

Recommended Posts

Since the database is gone (-_-;;)

 

 

 

I can't use search.. On the old scape there was this guy named

 

 

 

Alex -something and he had a random image script. Does anyone have something simmillar (sp?) to that? I'd like my old sigs in a random image script again :)

 

 

 

 

 

 

 

Thanks,

 

 

 

Steph

Link to comment
Share on other sites

www.cutandpastescripts.com << register and u can use the random image thingy there :)

 

 

 

Actually, no you cant. It dosnt display your image size, so it isnt allowed.

~M

Link to comment
Share on other sites

Remember.. google is your friend

 

 

 

 

 

 

 




<?php



/*



   By Matt Mullenweg > http://photomatt.net



   Inspired by Dan Benjamin > http://hiveware.com/imagerotator.php



   Latest version always at:



   http://photomatt.net/scripts/randomimage



*/







// Make this the relative path to the images, like "../img" or "random/images/".



// If the images are in the same directory, leave it blank.



$folder = '';







// Space seperated list of extensions, you probably won't have to change this.



$exts = 'jpg jpeg png gif';







$files = array(); $i = -1; // Initialize some variables



if ('' == $folder) $folder = './';



$handle = opendir($folder);



$exts = explode(' ', $exts);



while (false !== ($file = readdir($handle))) {



   foreach($exts as $ext) { // for each extension check the extension



       if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive



           $files[] = $file; // it's good



           ++$i;



           }



       }



   }



closedir($handle); // We're not using it anymore



mt_srand((double)microtime()*1000000); // seed for PHP < 4.2



$rand = mt_rand(0, $i); // $i was incremented as we went along







header('Location: '.$folder.$files[$rand]); // Voila!



?>



 

 

 

 

 

 

 

;)

Link to comment
Share on other sites

... except .php sigs no longer work, because they were removed from this version of phpbb ;) (apparently there were security issues)

 

 

 

 

 

 

 

RaenonD has a random signature, that's not .php, but it doesn't display file size, so nobody but him will be allowed to use it :roll:

Link to comment
Share on other sites

Since the database is gone (-_-;;)

 

 

 

I can't use search.. On the old scape there was this guy named

 

 

 

Alex -something and he had a random image script. Does anyone have something simmillar (sp?) to that? I'd like my old sigs in a random image script again :)

 

 

 

 

 

 

 

Thanks,

 

 

 

Steph

 

 

 

 

 

 

 

Hehe it was me :)

 

 

 

 

 

 

 

Well since they don't allow php, I don't know what other options there are for making do a random script, unless someone knows how to link to a graphics file and then make it read it as php? Dunno if that's possible?

Upload your sigs here and have it randomise or progress through all your sigs for free.

alexi02.jpeg

Link to comment
Share on other sites

Remember.. google is your friend

 

 

 

 

 

 

 

-blah-

 

 

 

 

 

 

 

;)

 

 

 

 

 

 

 

Yeah.. except I have no idea how that works. Too bad the php thing doesnt work anymore :( Ill just switch every now and then I guess.

 

 

 

 

 

 

 

Thanks anyway

Link to comment
Share on other sites

Bah my poor poor script cant work here no more :'(

 

 

 

I guess ill have to open up notepad and make one that exports to png or something :D lol

612d9da508.png

Mercifull.png

Mercifull <3 Suzi

"We don't want players to be able to buy their way to success in RuneScape. If we let players start doing this, it devalues RuneScape for others. We feel your status in real-life shouldn't affect your ability to be successful in RuneScape" Jagex 01/04/01 - 02/03/12

Link to comment
Share on other sites

If you change the MIME type on your server so that an image extension is parsed as PHP, it'll work. I did that for my sig.

sigon4.jpg

handed me TWO tissues to clear up. I was like "i'm going to need a few more paper towels than that luv"
Link to comment
Share on other sites

... except .php sigs no longer work, because they were removed from this version of phpbb ;) (apparently there were security issues)

 

 

 

 

 

 

 

RaenonD has a random signature, that's not .php, but it doesn't display file size, so nobody but him will be allowed to use it :roll:

 

 

 

 

 

 

 

Do you mean, display the file size to an automated script, or when you right click on it? Because when I right click on it and choose "Image Properties," it comes up with all the stats of the image.

Link to comment
Share on other sites

If you change the MIME type on your server so that an image extension is parsed as PHP, it'll work. I did that for my sig.

 

 

 

 

 

 

 

Hmm I've tried putting a .htaccess file in. It works when I put the link in the web browser but doesn't do anything when I put it on these forums.

 

 

 

Are you sending any headers in your file?

Upload your sigs here and have it randomise or progress through all your sigs for free.

alexi02.jpeg

Link to comment
Share on other sites

 

If you change the MIME type on your server so that an image extension is parsed as PHP, it'll work. I did that for my sig.

 

 

 

 

 

 

 

Hmm I've tried putting a .htaccess file in. It works when I put the link in the web browser but doesn't do anything when I put it on these forums.

 

 

 

Are you sending any headers in your file?

 

 

 

 

 

 

 

No, I modified it in cPanel so that jpegs are parsed as PHP. I try not to mess with headers whenever I can.

sigon4.jpg

handed me TWO tissues to clear up. I was like "i'm going to need a few more paper towels than that luv"
Link to comment
Share on other sites

 

 

 

No, I modified it in cPanel so that jpegs are parsed as PHP. I try not to mess with headers whenever I can.

 

 

 

 

 

 

 

After various tests, I've found that these forums don't like the ? (question mark after the file name, i.e to select the user).

 

 

 

So they only way to have the random script is just to link to the file (e.g .jpg) and not have anything after it = no more random scrips unless I have a file/directory for each user :|

Upload your sigs here and have it randomise or progress through all your sigs for free.

alexi02.jpeg

Link to comment
Share on other sites

 

 

 

 

No, I modified it in cPanel so that jpegs are parsed as PHP. I try not to mess with headers whenever I can.

 

 

 

 

 

 

 

After various tests, I've found that these forums don't like the ? (question mark after the file name, i.e to select the user).

 

 

 

So they only way to have the random script is just to link to the file (e.g .jpg) and not have anything after it = no more random scrips unless I have a file/directory for each user :|

 

 

 

 

 

 

 

I know there's something in Apache and PHP where you can have a script generate directories temporarily. See pastebin.com and look at how the URL for each code snippet is - it's a subdirectory. The subdirectories aren't actually there; there virtual and made by the script. You could look at the source. Or switch to CGI.

sigon4.jpg

handed me TWO tissues to clear up. I was like "i'm going to need a few more paper towels than that luv"
Link to comment
Share on other sites

 

 

 

I know there's something in Apache and PHP where you can have a script generate directories temporarily. See pastebin.com and look at how the URL for each code snippet is - it's a subdirectory. The subdirectories aren't actually there; there virtual and made by the script. You could look at the source. Or switch to CGI.

 

 

 

 

 

 

 

The webhosting that I have of course won't allow me to edit the Apache config file :/ so I'm just gonna do everything manually.

 

 

 

 

 

 

 

http://forum.tip.it/viewtopic.php?p=54479#54479

Upload your sigs here and have it randomise or progress through all your sigs for free.

alexi02.jpeg

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.