getMessage()); exit; } $jid_md5 = md5($jid); // On récupère le statut dans tous les cas try { list($status, $img_status) = webStatus::getStatus($jid); } catch (Exception $e) { webStatus::sendErrorImage($e->getMessage()); exit; } // On essaye de récupérer le cache en fonction du statut $cache_file = webStatus::getCacheName('signature', $jid, $status); if (webStatus::isCached($cache_file, 3600)) { webStatus::redirectImage($cache_file); } // Récupérons l'avatar try { $avatar = webStatus::getAvatar($jid, 96); } catch (Exception $e) { $avatar = webStatus::getDummyAvatar(96); } $st_msg = webStatus::getStatusMsg($status); $message = file_get_contents('http://presence.jabberfr.org/'.$jid_md5.'/message.txt'); $message = html_entity_decode($message); $message = str_replace("'", "'", $message); $image = imagecreatetruecolor(400, 66); $noir = imagecolorallocate($image, 0, 0, 0); $blanc = imagecolorallocate($image, 255, 255, 255); $gris = imagecolorallocate($image, 150, 150, 150); $autre = imagecolorallocate($image, 150, 0, 0); imagefill($image, 0, 0, $blanc); imagerectangle($image, 0, 0, 399, 65, $noir); $width = imagesx($avatar); $height = imagesy($avatar); if ($height < $width) { $new_height = 64; $new_width = round($width * ($new_height / $height)); } else { $new_width = 64; $new_height = round($height * ($new_width / $width)); } imagecopyresampled($image, $avatar, 1, 1, 0, 0, $new_width, $new_height, $width, $height); imagerectangle($image, 0, 0, 65, 65, $noir); imagefilledrectangle($image, 66, 1, 398, 64, $blanc); imagecopy($image, $img_status, 70, 5, 0, 0, imagesx($img_status), imagesy($img_status)); imagettftext($image, 10, 0, 90, 18, $noir, get_font('FreeSansBold'), $st_msg); imagettftext($image, 8, 0, 70, 33, $noir, get_font('FreeSans'), 'Jabber / XMPP : '.$jid); imagettftext($image, 8, 0, 70, 45, $gris, get_font('FreeSans'), 'Pour en savoir plus sur comment me contacter : www.jabberfr.org'); imagettftext($image, 9, 0, 70, 60, $autre, get_font('FreeSansBold'), $message); webStatus::displayImage($image, $cache_file); ?>