PDA

View Full Version : Last Time Signature Was Seen



timROGERS
04-03-2006, 05:25 PM
I was bored this afternoon so I randomly made a script that I could use as a signature. It records when the signature is viewed and then prints when it was onto the image. If you want the code here it is, if you know what your doing you'll be able to work out how to change things on it :P If your dumb look in my signature!


<?php
header("Content-type: image/png");
$datafile = "last-seen.dat";
$loadfile = fopen($datafile, 'r');
$data = fread($loadfile, filesize($datafile));
fclose($loadfile);

$im = imagecreatefrompng("template.png");
$textcolour = imagecolorallocate($im, 255, 255, 255);
$font = "verdana.ttf";
imagettftext($im, 10, 0, 140, 7, $textcolour, $font, $data);

$writing = fopen($datafile, 'w');
$towrite .= date('d');
$towrite .= " ";
$towrite .= date('F');
$towrite .= " ";
$towrite .= date('Y');
$towrite .= " at ";
$towrite .= date('H');
$towrite .= ":";
$towrite .= date('i');
$towrite .= ":";
$towrite .= date('s');

fwrite($writing, $towrite);
fclose($writing);
imagepng($im);
?>

Flisker
04-03-2006, 05:29 PM
Cool nice script

D3stroyer
04-03-2006, 05:30 PM
O.O nice work Tim thanks again,

Dam It won't let me rep you i already repped you today.

-Daza

timROGERS
04-03-2006, 05:31 PM
If your stupid and you just paste it in it wont work :P Because it needs last-seen.dat, template.png and verdana.ttf

:Edzy
05-03-2006, 07:14 PM
i nicked all your files and they didnt work :'(

nets
05-03-2006, 07:36 PM
Would be faster:

fwrite(date('d F Y \a\t H:i:s'), $towrite);
Also, why use a DAT file as it's not accepted, and will be treated as TXT (I think?).

:Edzy
05-03-2006, 07:41 PM
yeh it was lol, what are u supposed 2 use?

Want to hide these adverts? Register an account for free!