mealexme Posted February 5, 2012 Share Posted February 5, 2012 Anyone know where I can get a count down clock to put in my sig? I did one, but it had too many characters when I pasted it into my sig. I tried tinyurl, but it didnt work Quote Link to comment Share on other sites More sharing options...
XmisterIS Posted February 5, 2012 Share Posted February 5, 2012 just write one in php using gd2.0 and upload it to freewebs. that's what i did when i had one! 30 min job, if that. Quote Link to comment Share on other sites More sharing options...
TC Posted February 6, 2012 Share Posted February 6, 2012 just write one in php using gd2.0 and upload it to freewebs. that's what i did when i had one! 30 min job, if that. I read this after reading your thread about your mum with computers.Then felt just like your Mum Age is a horrible thing. Quote Link to comment Share on other sites More sharing options...
mealexme Posted February 6, 2012 Author Share Posted February 6, 2012 I have to admit, I'm feeling rather old right now! Quote Link to comment Share on other sites More sharing options...
XmisterIS Posted February 6, 2012 Share Posted February 6, 2012 I have to admit, I'm feeling rather old right now! You're considerably younger than me! (I think ...) Quote Link to comment Share on other sites More sharing options...
XmisterIS Posted February 6, 2012 Share Posted February 6, 2012 Here you go, I found the code I wrote - I put it on limedomains not freewebs (my mistake!)Anyway, it would seem that limedomains was sold to a bunch of incompetents and has since gone bust, so just do a google search for "free PHP hosting" and modify the following script as you require. The bits you'll need to change are indicated by *** ... *** comments. It's not difficult to figure it out with a bit of help from Google even if you're not a programmer. <?php //Create the image resource. $im = @imagecreate(400, 30) // *** INCREASE THE VALUE OF THE SECOND PARAMETER FOR LONGER MESSAGES *** or die("Cannot Initialize new GD image resource"); //Derestriction date and difference from now. $derestime = mktime(0, 0, 0, 3, 23, 2011); //23-03-11 *** MODIFY THE COUNTDOWN DATE HERE *** $difftime = $derestime - time(); $months = date("m", $difftime); $days = date("j", $difftime);; // *** CONSTRUCT THE MESSAGE TO BE DISPLAYED *** $remmsg = ">>> ".$months." months, ".$days." days to derestriction! <<<"; //Randomise the colour scheme. $col[0] = rand(0, 255); $col[1] = 255 - $col[0]; $col[2] = rand(127, 255); shuffle($col); list($red, $green, $blue) = $col; $text_color = imagecolorallocate($im, $red, $green, $blue); //Set the background colour. $rect_color = imagecolorallocate($im, 0x66, 0x66, 0x66); //Draw the image. imagesetthickness($im, 2); imagerectangle($im, 0, 0, 399, 29, $rect_color); imagestring($im, 5, 6, 7, $remmsg, $text_color); //Write the image as a PNG to STDOUT. header("Content-type: image/png"); imagepng($im); //Clean up. imagecolordeallocate($text_color); imagecolordeallocate($rect_color); imagedestroy($im); ?> Quote Link to comment Share on other sites More sharing options...
XmisterIS Posted February 8, 2012 Share Posted February 8, 2012 It's not OO - imagecolordeallocate is a function that requires a resource that is returned by imagecolorallocate. (GD was written long before PHP became OO).But ... Ooops! I made an error there - it's obviously a back up file that I copied from by mistake - you need to pass $im as the first arg and the colour resource as the second arg.imagecolordeallocate($im, $text_color);imagecolordeallocate($im, $rect_color);That should do the trick!What is arboresence? I have never heard of it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.