hash); if ($the_name == $the_block->hash) $the_name =''; $bandeau = 50; $marge = 25; $text_border = 20; $width = GRAPH_WIDTH; $height = GRAPH_HEIGHT; $img_w = $marge + ($width*2) + (2*$text_border); $img_h = $marge + ($height*2) + (2*$bandeau); // création d'une image plus haute pour inclure bandeaux haut et bas $img = imagecreatetruecolor( $img_w, $img_h); // Les parties du block : inputs, outputs, fees, reward switch($methode) { case 'full_treemap_fuzzy': topisto_treemap_fuzzy::DrawBlock($the_block, $img, $text_border + 0, $bandeau, $width, $height, $mode, 2); topisto_treemap_fuzzy::DrawBlock($the_block, $img, $text_border+$marge+$width, $bandeau, $width, $height, $mode, 1); topisto_treemap_fuzzy::DrawBlock($the_block, $img, $text_border+0, $marge+$height + $bandeau, $width, $height, $mode, 3); topisto_treemap_fuzzy::DrawBlock($the_block, $img, $text_border+$marge+$width, $marge+$height + $bandeau, $width, $height, $mode, 4); break; case 'full_spline': $type=2; $x0 = $text_border; $y0 = $bandeau; topisto_spline::DefaultDrawBlock($the_block, $img, $x0, $y0, $width, $height, $type); $type=1; $x0 = $text_border+$marge+$width; $y0 = $bandeau; topisto_spline::DefaultDrawBlock($the_block, $img, $x0, $y0, $width, $height, $type); $type=3; $x0 = $text_border; $y0 = $marge+$height+$bandeau; topisto_spline::DefaultDrawBlock($the_block, $img, $x0, $y0, $width, $height, $type); $type=4; $x0 = $text_border+$marge+$width; $y0 = $marge+$height+$bandeau; topisto_spline::DefaultDrawBlock($the_block, $img, $x0, $y0, $width, $height, $type); break; case 'full_treemap': default: topisto_treemap::DrawBlock($the_block, $img, $text_border + 0, $bandeau, $width, $height, $mode, 2); topisto_treemap::DrawBlock($the_block, $img, $text_border+$marge+$width, $bandeau, $width, $height, $mode, 1); topisto_treemap::DrawBlock($the_block, $img, $text_border+0, $marge+$height + $bandeau, $width, $height, $mode, 3); topisto_treemap::DrawBlock($the_block, $img, $text_border+$marge+$width, $marge+$height + $bandeau, $width, $height, $mode, 4); break; } blockchain::DrawBlockHeaderFooter($the_block, $img, $bandeau); $fond = imagecolorallocate($img, 40, 40, 40); imagefilledrectangle($img, 0, $bandeau, $text_border, $img_h-$bandeau, $fond); imagefilledrectangle($img, $img_w-$text_border, $bandeau, $img_w, $img_h-$bandeau, $fond); imagefilledrectangle($img, $text_border+$width, $bandeau, $text_border+$marge+$width, $img_h-$bandeau, $fond); imagefilledrectangle($img, 0, $bandeau+$height, $img_w - $text_border, $bandeau+$marge+$height, $fond); // Les textes putenv('GDFONTPATH='.RESS_PATH.'/fonts/'); $font = 'DS-DIGIB.TTF'; $fontColor = imagecolorallocate($img, 158,227,253); $fontColor = imagecolorallocate($img, 227,253,158); $fontColor = imagecolorallocate($img, 227,227,153); $the_texte = "Height : ".$the_block->height; imagettftext($img,18, 0, 5, $bandeau-5, $fontColor, $font, $the_texte); $the_texte = "Inputs : ".$the_block->topisto_inputs; imagettftext($img,15, 90, $text_border-3, $bandeau+$height, $fontColor, $font, $the_texte); $the_texte = "Outputs : ".$the_block->topisto_outputs; imagettftext($img,15, 90, $text_border+$width+$marge-3, $bandeau+$height, $fontColor, $font, $the_texte); $the_texte = "Fees : ".$the_block->topisto_fees; imagettftext($img,15, 90, $text_border-3, $bandeau+(2*$height)+$marge-3, $fontColor, $font, $the_texte); $the_texte = "Reward : ".$the_block->topisto_reward; imagettftext($img,15, 90, $text_border+$width+$marge-3, $bandeau+(2*$height)+$marge-3, $fontColor, $font, $the_texte); if ($the_name == '') $the_name = date('Ymd H:m:s', $the_block->time); $bbox = imagettfbbox(14, 0, $font, $the_name); imagettftext($img, 14, 0, ($img_w-3)-($bbox[2]-$bbox[0]), ($bandeau-5), $fontColor, $font, $the_name); // Sauvegarder l'image et ajouter // - un lien sur le mode // - un lien dans le dossier "hasard" $imagefilename2 = str_replace(".png","-$mode.png", $imagefilename); imagepng($img,$imagefilename2); if (!file_exists($imagefilename)) link($imagefilename2, $imagefilename); $imagefilename2 = str_replace("methode/$methode/","methode/hasard/", $imagefilename); if (!file_exists($imagefilename2)) link($imagefilename, $imagefilename2); } $seconds_to_cache = 7200; $ts = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT"; header("Expires: $ts"); header("Pragma: cache"); header("Cache-Control: max-age=$seconds_to_cache"); header('Content-Type: image/png'); imagepng($img); imagedestroy($img); ?>