<?php
/*****************************************************************\
* Copyright (C) 2007, Nindra (nindrag (a) gmail.com)              *
*                                                                 *
* This program is free software; you can redistribute it and/or   *
* modify it under the terms of the GNU General Public License     *
* as published by the Free Software Foundation; either version 2  *
* of the License, or (at your option) any later version.          *
*                                                                 *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of  *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   *
* GNU General Public License for more details at:                 *
* http://www.gnu.org/copyleft/gpl.html                            *
\*****************************************************************/

$rawdata = file('reset.info');
$infot = explode(' ',$rawdata[0]);

$from = $infot[0];

$since = $infot[1];
$since = time()-$since;
if($since < 60)
    $since = "$since seconds";
else if($since < 3600)
{
    $since = floor($since/60);
    $since = "$since minutes";
}
else if($since < 86400)
{
    $since = floor($since/3600);
    $since = "$since hours";
}
else
{
    $since = floor($since/86400);
    $since = "$since days";
}

$image=imagecreate(400,10);
$white=imagecolorallocate($image,255,255,255);
$musta=imagecolorallocate($image,0,0,0);
imagestring($image,1,0,0,"Somebody from $from reset the counter $since ago",$musta);
header("Content-Type: image/png");
imagepng($image);
imagedestroy($image);
exit();
?>