From 866658cded5b92ddb2681dead1ebaf111d712fcc Mon Sep 17 00:00:00 2001 From: cassiopc Date: Mon, 6 Aug 2012 11:09:10 +0200 Subject: init --- boca-1.5.0/src/fballoon.php | 60 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 boca-1.5.0/src/fballoon.php (limited to 'boca-1.5.0/src/fballoon.php') diff --git a/boca-1.5.0/src/fballoon.php b/boca-1.5.0/src/fballoon.php new file mode 100644 index 0000000..ffe6596 --- /dev/null +++ b/boca-1.5.0/src/fballoon.php @@ -0,0 +1,60 @@ +. +//////////////////////////////////////////////////////////////////////////////// +// Last modified 21/jul/2012 by cassio@ime.usp.br +function balloonpng($dir,$get_s,$get_color=null,$get_file=null) { + if($get_s) + $smile=imagecreatefrompng($dir . "/images/smallballoontransp.png"); + else + $smile=imagecreatefrompng($dir . "/images/bigballoontransp.png"); + + imageSaveAlpha($smile, true); + if($get_color != null) { + $r = hexdec( substr($get_color, 0, 2) ); + $g = hexdec( substr($get_color, 2, 2) ); + $b = hexdec( substr($get_color, 4, 2) ); + + $kek=imagecolorallocate($smile,$r,$g,$b); + if($get_s) + imagefill($smile,5,5,$kek); + else + imagefill($smile,12,25,$kek); + } + if($get_file != null) + imagepng($smile,$get_file); + else + imagepng($smile); +} + +function balloonurl($color) { + $locr=$_SESSION['locr']; + $loc=$_SESSION['loc']; + $ds = DIRECTORY_SEPARATOR; + if($ds=="") $ds = "/"; + if(!is_readable($locr . $ds . 'balloons' . $ds . md5($color) . '.png')) { + if($color<0 || $color=='') + @copy($locr. $ds . 'images' . $ds . 'bigballoonboca1.png', $locr . $ds . 'balloons' . $ds . md5($color) . '.png'); + else + balloonpng($locr,false,$color,$locr . $ds . 'balloons' . $ds . md5($color) . '.png'); + if(!is_readable($locr . $ds . 'balloons' . $ds . md5($color) . '.png')) { + return $loc . "/images/bigballoontransp.png"; +// return $loc . "/balloon.php?color=" . $color; + } + } + return $loc . "/balloons/" . md5($color) . '.png'; +} +?> -- cgit v1.2.3