hash); if ($the_name == $the_block->hash) $the_name =''; $bandeau = 50; $marge = 25; $text_border = 20; $width = GRAPH_WIDTH; $height = GRAPH_HEIGHT; // Pour que l'image simple ait les proportions que l'image full $width = $marge + ($width*2) + (2*$text_border); $height = $marge + ($height*2); $img_w = $width; $img_h = $height+(2*$bandeau); $type=2; if (count($the_block->tx)==1) $type=4; // création d'une image plus haute pour inclure bandeaux haut et bas $img = imagecreatetruecolor($img_w, $img_h); $param0 = blockchain::DrawBlockHeaderFooter($the_block, $img, $bandeau); $parametres = []; $parametres['x'] = 0; $parametres['y'] = $bandeau; $parametres['width'] = $width; $parametres['height'] = $height; $parametres['methode'] = $mode; $parametres['type'] = $type; $parametres['transparent_color'] = $param0[0]; $parametres['background_color'] = $param0[1]; $parametres['font_color'] = $param0[2]; $parametres['fontname'] = $param0[3]; $parametres['font_RGB'] = $param0[4]; $parametres['background_RGB'] = $param0[5]; switch($methode) { case 'veraMolnar': require_once APP_PATH.'/methode/veraMolnar/inc/treemap.php'; topisto_veraMolnar::DrawBlock($the_block, $img, $parametres); break; case 'treemapV2': require_once APP_PATH.'/methode/treemapV2/inc/treemap.php'; topisto_treemap::DrawBlock($the_block, $img, $parametres); break; case 'treemap_fuzzy': require_once APP_PATH.'/methode/treemap_fuzzy/inc/treemap.php'; topisto_treemap_fuzzy::DrawBlock($the_block, $img, 0, $bandeau, $width, $height, $mode, $type); break; case 'spline': require_once APP_PATH.'/methode/spline/inc/splines.php'; topisto_spline::DefaultDrawBlock($the_block, $img, 0, $bandeau, $width, $height, $mode, $type); break; case 'spline_2': require_once APP_PATH.'/methode/spline/inc/splines.php'; topisto_spline::DrawBlock($the_block, $img, 0, $bandeau, $width, $height, $mode, 200, $type); break; case 'treemap' : default: require_once APP_PATH.'/methode/treemap/inc/treemap.php'; topisto_treemap::DrawBlock($the_block, $img, 0, $bandeau, $width, $height, $mode, $type); break; } // Les textes /* * INUTILE depuis que blockchain::DrawBlockHeaderFooter ajoute elle-même les textes * putenv('GDFONTPATH='.RESS_PATH.'/fonts/'); $font = 'DS-DIGIB.TTF'; $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; if ($type == 4) $the_texte = "Reward : ".$the_block->topisto_reward; imagettftext($img,15, 0, 5, $bandeau+$height+18, $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); ?>