setUserSession($_GET['id']); } //setcookie("counter", 'counter', time()+30); //header('Content-Type: text/html; charset=utf-8'); //echo $_COOKIE['counter']; // die(); //} $object=$mainclass->get_button_object($id_site); if($object) { $button=$object->knopka; if(is_file("images/$button")) $im = ImageCreateFrompng("images/$button"); else $im = ImageCreateFrompng("images/default.png"); $color = ImagecolorAllocate($im,$object->desc,$object->desc,$object->desc); if($object->hostsx!=0 && $object->hostsy!=0) Imagestring($im,1,$mainclass->sm($object->hostsx,$object->hosts),$object->hostsy,$object->hosts,$color); if($object->hitsx!=0 && $object->hitsy!=0) Imagestring($im,1,$mainclass->sm($object->hitsx,$object->hits),$object->hitsy,$object->hits,$color); if($object->rankx!=0 && $object->ranky!=0) Imagestring($im,1,$mainclass->sm($object->rankx,$object->rank),$object->ranky,$object->rank,$color); if($object->allx!=0 && $object->ally!=0) Imagestring($im,1,$mainclass->sm($object->allx,$object->all),$object->ally,$object->all,$color); if($object->usersx!=0 && $object->usersy!=0) Imagestring($im,1,$mainclass->sm($object->usersx,$object->users),$object->usersy,$object->users,$color); if($object->prx!=0 && $object->pry!=0) Imagestring($im,1,$mainclass->sm($object->prx,$object->pr),$object->pry,$object->pr,$color); if($object->ticx!=0 && $object->ticy!=0) Imagestring($im,1,$mainclass->sm($object->ticx,$object->tic),$object->ticy,$object->tic,$color); if(empty($_GET['page'])) $_GET['page']=''; // GET PLATFORM INFO require 'lib/phpbrowscap/Browscap.php'; $bc = new Browscap('./logs/'); $bc->localFile = './logs/browscap.ini'; $browserIni = $bc->getBrowser(); if($mainclass->check_allow_button_in_page($_GET['page'],$object->url)) $mainclass->insert_but_hit($id_site,$browserIni); elseif ($mainclass->check_allow_button_in_mirror($_GET['page'],$id_site)) $mainclass->insert_but_hit($id_site,$browserIni); } } if(empty($im)) { $im = ImageCreateFrompng("images/default.png"); Header("Content-type: image/png"); imagesavealpha($im, true); // thx to redesign2000 Imagepng($im); } header('Content-Type: image/png'); imagepng($im); ?>