<?php
require_once 'inc/core.php'; //ядро
if(isset($id))
{
header("Content-type: image/gif");
$count = mysql_fetch_array(mysql_query("SELECT `pr`,`cy`,`lastUp`,`link` FROM `site` WHERE `id` = '$id'"));
$img = 'img/data.gif';
$image = imagecreatefromgif($img);
$textcolor = imagecolorallocate($image, 250, 250, 250);
ImageString($image,3,21,1,$count['pr'],$textcolor);
ImageString($image,3,27,12,$count['cy'],$textcolor);
imagegif($image);
imageDestroy($image);
if (($count['lastUp'] + 24*60*60) < $realtime)
{
require_once $inc.'pr.php';
$count['pr'] = getPageRank($count['link']);
$count['cy'] = cy($count['link']);
mysql_query("UPDATE `site` SET
`lastUp`='" .$realtime. "',
`cy` = '".$count['cy']."',
`pr` = '".$count['pr']."'
WHERE `id` = '$id';");
}
}
?>