Relevante stukjes uit het script:
// Skype Status plaatje van de Skype Status URL. Blangrijk: kies de balloon button voor de status omdat uit dit plaatje een kleur wordt gekozen die gebruikt wordt om met de index te vergelijken$im = LoadPNG("http://mystatus.skype.com/balloon/" . $skype_user_id . ".png"); function LoadPNG ($imgname) { $im = @imagecreatefrompng ($imgname); if (!$im) { $im = imagecreate (182, 44); $bgc = imagecolorallocate ($im, 255, 255, 255); $tc = imagecolorallocate ($im, 0, 0, 0); imagefilledrectangle ($im, 0, 0, 10, 10, $bgc); imagestring ($im, 1, 5, 5, "Error loading $imgname", $tc); } return $im; }
function LoadPNG ($imgname) { $im = @imagecreatefrompng ($imgname); if (!$im) { $im = imagecreate (182, 44); $bgc = imagecolorallocate ($im, 255, 255, 255); $tc = imagecolorallocate ($im, 0, 0, 0); imagefilledrectangle ($im, 0, 0, 10, 10, $bgc); imagestring ($im, 1, 5, 5, "Error loading $imgname", $tc); } return $im; }
// kleur bepalen $start_x = 50; $start_y = 36; $color_index = imagecolorat($im, $start_x, $start_y); if ($color_index>58 && $color_index<60) { echo $online; // image + url Skype staat aan } else if ($color_index>69 && $color_index<71) { echo $skypeme; // image + url Skype mij } else if ($color_index>43 && $color_index<45) { echo $away; // image + url Skype afwezig } else if ($color_index>11 && $color_index<13) { echo $unavailable; // image + url Skype niet beschikbaar } else if ($color_index>34 && $color_index<36) { echo $donotdisturb; // image Skype niet storen } else if ($color_index<5) { echo $offline; // image Skype staat uit } else { echo $unknown; // image Skype status onbekend }
if ($color_index>58 && $color_index<60) { echo $online; // image + url Skype staat aan } else if ($color_index>69 && $color_index<71) { echo $skypeme; // image + url Skype mij } else if ($color_index>43 && $color_index<45) { echo $away; // image + url Skype afwezig } else if ($color_index>11 && $color_index<13) { echo $unavailable; // image + url Skype niet beschikbaar } else if ($color_index>34 && $color_index<36) { echo $donotdisturb; // image Skype niet storen } else if ($color_index<5) { echo $offline; // image Skype staat uit } else { echo $unknown; // image Skype status onbekend }