It looks like you're using an Ad Blocker.

Please white-list or disable AboveTopSecret.com in your ad-blocking tool.

Thank you.

 

Some features of ATS will be disabled while you continue to use an ad-blocker.

 

Dynamic Avatars?

page: 1
0

log in

join
share:

posted on Aug, 17 2005 @ 03:03 PM
link   



posted on Aug, 17 2005 @ 03:44 PM
link   
Awesome!

Well, at the very least pretty cool.



posted on Aug, 17 2005 @ 03:54 PM
link   
cool Dulcimer. I wish I had one of those for my sig.



posted on Aug, 17 2005 @ 05:45 PM
link   
Dulcimer, did you use PHP for that or some other langauge to create the image? Would be awesome if you showed off your code for the rest of us geeks to see.



posted on Aug, 17 2005 @ 05:52 PM
link   

Originally posted by Striker122
cool Dulcimer. I wish I had one of those for my sig.


Did you see mine. It tells my current weather...(Another php nerd)



posted on Aug, 17 2005 @ 07:10 PM
link   
Yeah, I saw it. I want all of em!!!!!!



posted on Aug, 17 2005 @ 08:11 PM
link   
The code that displays my IP address and ISP scares me because of occasions that I bring my laptop around wireless, strangers that are next to me can get that info. Otherwise I find that they are pretty cool.




posted on Aug, 17 2005 @ 08:17 PM
link   
Ill give out the source in a bit.

For some reason the counter reset itself, and I didnt see when.



posted on Aug, 18 2005 @ 12:40 AM
link   
Here is the source.

Zip file of the entire thing: Here

This includes a folder called counter that contains:

-index.php ( the script that displays the image, this is what you link to when showing the image)
-arb.ttf (the font used in the image Arial Rounded Bold)
-counter.txt (the text file that stores the views)
-counterpic.png (the background image, in this case a white rectangle with a black border)

To use this you have to have php access on your webspace, gd library.
www.php.net...

To use the script

1-Change the lines in index.php to what you want displayed, in my case it says Dulcimer, my user name.

You can also edit colors etc, if you know php. Values are in RGB.

2-Upload the files. I keep mine in the directory "counter" and use index.php as the name of the script.

3-Change the file attributes of counter.txt to 777 so it can write the views.

4-Link to the script, index.php to display the image.

If you are interested in the source and not the download, here it is:







$TextFile = "counter.txt";
$Count = trim(file_get_contents($TextFile));
$FP = fopen($TextFile, "r");
$Count=fgets($FP, 10240);
fclose ($FP);
settype($Count, "integer");
$Count++;
if ($FP = fopen ($TextFile, "w"))[
fwrite ($FP, $Count);
fclose ($FP);
]

$image = "counterpic.PNG";
$im = imagecreatefrompng($image);
$font = 'arb.ttf';
$green = ImageColorAllocate ($im, 0, 128, 0);
$black = imagecolorallocate ($im, 0, 0, 0);
$hit = "$Count";



imagettftext ($im, 8, 0, 8, 20, $black, $font, "Dulcimer's Posts Viewed ");
imagettftext ($im, 8, 0, 5, 40, $green, $font, " $hit Times");
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);



Thats php remember, so add the tags.

Changing counterpic.PNG to lowercase causes errors.

$Count=fgets($FP, 10240); This line will be how many digits you can store. I seem to have troubles with it. I think it will work up to 1,000,000,000 though.




top topics



 
0

log in

join