Jump to content
xisto Community
Sign in to follow this  

Themed Scripts (weekly) the theme changes each week

Recommended Posts

ok the way this is gonna work is ... from monday to saturday you will be asking for scripts that go along with the theme... then on sunday every one will vote on a new theme for the next week... any one can ask for a script... any one can post a script...


the script DOESN'T NECESSARILY NEED TO BE ASKED FOR inorder for you to post it... just make sure it goes along with the theme... or you will loose all respect :P


any ways this weeks theme is





So for the first script i thought i would show you how to make the randomly generated number images that you see on most registration pages....


i am not going to go into too much detail because this post would be a mile long if i did so here is the code:


<?php  Header("(anti-spam-(anti-spam-content-type:)) image/gif");  $fface = "fonts/TIMES.TTF";  if(!$_GET['num'])	 $text = rand(100,999);  else	 $text = $_GET['num'];  if(!isset($s)) $s=25;  $size = imagettfbbox($s,0,$fface,$text);  $dx = abs($size[2]-$size[0]);  $dy = abs($size[5]-$size[3]);  $xpad=9;  $ypad=9;  $im = imagecreate($dx+$xpad,$dy+$ypad);  $background = ImageColorAllocate($im, 0,0,0);imagesetthickness($im,1);$typeis = "circle";for($i = 0; $i <= 10; $i++){$mycol = ImageColorAllocate($im, rand(0,255),rand(0,255),rand(0,255));if($typeis == "line")ImageLine($im, rand(0,$dx+$xpad),rand(0,$dy+$ypad),rand(0,$dx+$xpad),rand(0,$dy+$ypad), $mycol);elseImageEllipse($im, rand(0,$dx+$xpad),rand(0,$dy+$ypad), 20,20, $mycol);}  $shadow = ImageColorAllocate($im, 100,100,100);  $textcol = ImageColorAllocate($im, 150,150,150);  ImageTTFText($im, $s, 0, (int)($xpad/2)+2, $dy+(int)($ypad/2), $shadow,$fface, $text);  ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-2, $textcol,$fface, $text);  ImageGif($im);  ImageDestroy($im);?>

Ok... some of the nice features of this script is that it allows you to pass in a number generated from the client page or you can just have one randomly generated... if you want to check for validity, i would pass it in... but here are previews of both:


here is a preview Tsunami's number generator

Go ahead.. reload the page... or try it on your own site...

To do a randomly generated number... just use this as an image tag: http://forums.xisto.com/no_longer_exists/


to use your own... put a number in like so: http://forums.xisto.com/no_longer_exists/?num=YOUR#HERE


right click and save as... ITS A PICTURE!!!


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.