Pages: [1] 2 3 4 5 :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Joshua Calvert
|
Posted - 2005.06.13 21:38:00 -
[1]
Step 1)
Gather your collection of sigs.
Step 2)
Put them all in one folder on your webserver.
Step 3)
Cut and paste the below code in tyour favourite text editor:
<?php
*/
$extList = array(); $extList['gif'] = 'image/gif'; $extList['jpg'] = 'image/jpeg'; $extList['jpeg'] = 'image/jpeg'; $extList['png'] = 'image/png';
// You don't need to edit anything after this point.
// --------------------- END CONFIGURATION -----------------------
$img = null;
if (substr($folder,-1) != '/') { $folder = $folder.'/'; }
if (isset($_GET['img'])) { $imageInfo = pathinfo($_GET['img']); if ( isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) && file_exists( $folder.$imageInfo['basename'] ) ) { $img = $folder.$imageInfo['basename']; } } else { $fileList = array(); $handle = opendir($folder); while ( false !== ( $file = readdir($handle) ) ) { $file_info = pathinfo($file); if ( isset( $extList[ strtolower( $file_info['extension'] ) ] ) ) { $fileList[] = $file; } } closedir($handle);
if (count($fileList) > 0) { $imageNumber = time() % count($fileList); $img = $folder.$fileList[$imageNumber]; } }
if ($img!=null) { $imageInfo = pathinfo($img); $contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ]; header ($contentType); readfile($img); } else { if ( function_exists('imagecreate') ) { header ("Content-type: image/png"); $im = @imagecreate (100, 100) or die ("Cannot initialize new GD image stream"); $background_color = imagecolorallocate ($im, 255, 255, 255); $text_color = imagecolorallocate ($im, 0,0,0); imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color); imagepng ($im); imagedestroy($im); } }
?>
Save it with whatever name you like with the extension of .php
Step 4)
Point your signature to http://www.yourwebserver.com/rotate.php
LEEEEERRRRRRRRRRROOOOOOOOOYYYYYYYYYYYYYYY! |
|
Chribba
|
Posted - 2005.06.14 07:24:00 -
[2]
Almost like I done :) Good description.
www.eve-files.com | www.myevebay.com |
|
Fredbob
|
Posted - 2005.06.14 09:08:00 -
[3]
I found similar .php code to do this, and failed, I tried this code and got the same problem - so it's probably something simple:
Instead of getting the images show up, I get the code.. Even though in dreamweaver it looks all correct (i.e. no code in normal view).
Any ideas?
http://www.fredbob.co.uk/Siggy/rotate.php is where it should be, but clearly it's just displaying the code rather than using it. ___________ ~Fredbob~
|
Vanamonde
|
Posted - 2005.06.15 00:36:00 -
[4]
have a sticky for a bit.
EVE Forum Rules |
|
Chribba
|
Posted - 2005.06.15 08:44:00 -
[5]
And for the lame and simple ASP way :)
<% Randomize Num = Int((Rnd * 4) + 1) If Num = 1 Then Response.Redirect("http://foo.com/image1.jpg") ElseIf Num = 2 Then Response.Redirect("http://foo.com/image2.jpg") ElseIf Num = 3 Then Response.Redirect("http://foo.com/image3.jpg") Else Response.Redirect("http://foo.com/image4.jpg") End If %>
EVE-Files | EVE-Search | Get Email if thread updates |
|
Ray McCormack
|
Posted - 2005.06.16 21:03:00 -
[6]
Originally by: Fredbob Instead of getting the images show up, I get the code.. Even though in dreamweaver it looks all correct (i.e. no code in normal view).
Does your server have PHP installed?
| The BIG Lottery | BIG Sales | 88934 | |
Fredbob
|
Posted - 2005.06.17 07:51:00 -
[7]
Seems either php and asp are either not on there, or I don't have permission . Am looking around to see if there is a free one that does ___________ ~Fredbob~
|
Ricky Baby
|
Posted - 2005.06.18 14:48:00 -
[8]
Edited by: Ricky Baby on 18/06/2005 14:49:12 fred - email or msn me @ smifffy at smith-net.org.uk and ill host it for you, that goes for anyone who wants it. - plus that is a overly complex way of doing it.
|
Devric
|
Posted - 2005.06.22 12:55:00 -
[9]
Originally by: Fredbob I found similar .php code to do this, and failed, I tried this code and got the same problem - so it's probably something simple:
Instead of getting the images show up, I get the code.. Even though in dreamweaver it looks all correct (i.e. no code in normal view).
Any ideas?
http://www.fredbob.co.uk/Siggy/rotate.php is where it should be, but clearly it's just displaying the code rather than using it.
Guess PHP isn't installed on the server? What else could it be? Some providers have ASP support installed, some have PHP. I haven't seen anyone that supports both yet. __________________________________________________________ Knowledge is when you don't know what you don't know. |
Charleston
|
Posted - 2005.07.11 06:56:00 -
[10]
For all those that want hosting space and cool random sig images - visit sig.aftermath.cx and sign up. It's very basic at the moment - but it works. Just sign up, upload your images - then set up your sig to include the image http://sig.aftermath.cx/<username>.jpg
Should support .jpg, .gif and .png images - but outputs as a .jpg
|
|
Ellisa Annasan
|
Posted - 2005.07.11 21:37:00 -
[11]
test
|
Ellisa Annasan
|
Posted - 2005.07.11 21:40:00 -
[12]
test 2
|
Ellisa Annasan
|
Posted - 2005.07.11 21:44:00 -
[13]
test3
|
Ander
|
Posted - 2005.07.24 01:25:00 -
[14]
Now to find all IP's of forum mods and exclude them from my php-siggy rotation script using IP-exclude... Mohwhaha...
*slabs on a 5mb siggy*
http://www.eve-pirate.com |
PaulAtreides
|
Posted - 2005.07.24 05:12:00 -
[15]
If you have multiple sigs and you post many times on the same page, you may want a different sig to load per post.
If so add the red part to the end of your signature: http://www.yoursite.com/sig/rotate.php?random=563549
You may have to quote it to see it correctly.
Work for me! |
Kaeten
|
Posted - 2005.07.26 00:17:00 -
[16]
THANKS!!!!!!! Just what I needed
|
poisoner orbius
|
Posted - 2005.07.29 09:52:00 -
[17]
I followed your instructions and I get this
Parse error: parse error, unexpected '*' in /home/mafia/public_html/images/sigs/rotate.php on line 3
it's exactly copy and paste hehe, also 2 sigs in the same folder.
|
Xen Gin
|
Posted - 2005.07.29 10:15:00 -
[18]
I get this error when i click "view image" on the image placeholder.
CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Any resoution to this?
Also do the sigs have to be labeled anything special like image1.gif, or do the images have to be manually entered into an array?
|
Xen Gin
|
Posted - 2005.08.29 04:51:00 -
[19]
I found this one, does the same job and has HELPFULL Comments.
Quote: <?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! ?>
|
Tekran
|
Posted - 2005.09.19 03:29:00 -
[20]
hmm.. lets see how this works..
|
|
ivoryfire
|
Posted - 2005.09.30 04:18:00 -
[21]
|
Garramon
|
Posted - 2005.10.06 03:04:00 -
[22]
Originally by: Chribba And for the lame and simple ASP way :)
<% Randomize Num = Int((Rnd * 4) + 1) If Num = 1 Then Response.Redirect("http://foo.com/image1.jpg") ElseIf Num = 2 Then Response.Redirect("http://foo.com/image2.jpg") ElseIf Num = 3 Then Response.Redirect("http://foo.com/image3.jpg") Else Response.Redirect("http://foo.com/image4.jpg") End If %>
Well, I know it is not really the place to discuss it, but the same could be done with php, except with 1 line of code:
<?php header("Location: http://www.yoursite.com/im".(rand(1, 4)).".jpg"); ?>
The cool thing about JC's is that it will autosearch directory for all images. ------------------------------------------------ http://www.mypmtsite.com/rd/images/banner.png |
Raem Civrie
|
Posted - 2005.10.16 03:00:00 -
[23]
Thanks Joshua.
Oh, and... uh... lolbanned? :/
---
Is this a constructive post? |
Raem Civrie
|
Posted - 2005.10.16 18:46:00 -
[24]
Btw, Does this require server MySQL support or similar databases? If so, is there some version that can be run on plain vanilla servers?
I'm a complete nublet when it comes to internet programming.
---
Is this a constructive post? |
xXBeatnikXx
|
Posted - 2005.11.12 19:39:00 -
[25]
sig test
|
Isayo Arkindra
|
Posted - 2005.11.25 13:21:00 -
[26]
Originally by: Raem Civrie Btw, Does this require server MySQL support or similar databases? If so, is there some version that can be run on plain vanilla servers?
I'm a complete nublet when it comes to internet programming.
No, it only needs PHP, or ASP - depedning on what version you'll use :) __________
|
Branco
|
Posted - 2005.12.19 01:38:00 -
[27]
-
|
Cassie Opia
|
Posted - 2006.01.09 15:30:00 -
[28]
Edited by: Cassie Opia on 09/01/2006 15:32:49
|
Tiryth Malik
|
Posted - 2006.01.09 15:31:00 -
[29]
|
wolfyman
|
Posted - 2006.01.12 10:38:00 -
[30]
Edited by: wolfyman on 12/01/2006 10:38:37
|
|
|
|
|
Pages: [1] 2 3 4 5 :: one page |
First page | Previous page | Next page | Last page |