Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_GET["user"]))
- {
- $usr = file_get_contents("http://atelier801.com/profile?pr=".$_GET["user"]);
- if (preg_match("|<img src=\"img/icones/16/on-offbis|is", $usr))
- {
- $user = array("name" => $_GET["user"]);
- // Rellenar todas estas variables:
- $link = mysql_connect("91.121.68.87", "mices_es", "FryYgZKhdSp6QFGe");
- mysql_select_db("statistiques", $link);
- $result = mysql_query("SELECT * FROM player WHERE name='".$_GET["user"]."'", $link);
- $result2 = mysql_query("SELECT * FROM member WHERE name='".$_GET["user"]."'", $link);
- while($row = mysql_fetch_array($result)) {
- if ($row["title"] == 81) { $user["title"] = "It's Over 9000"; }
- else { $user["title"] = $row["title"]; }
- $user["experience"] = (string) $row["experience"];
- $user["first"] = (string) $row["first"];
- $user["color1"] = (string) $row["color1"];
- $user["color2"] = (string) $row["color2"];
- $user["bootcamp"] = (string) $row["bootcamp"];
- $user["round_played"] = (string) $row["round_played"];
- $user["shaman_cheese"] = (string) $row["shaman_cheese"];
- $user["saved_mice"] = (string) $row["saved_mice"];
- $user["saved_mice_hard"] = (string) $row["saved_mice_hard"];
- $user["saved_mice_divine"] = (string) $row["saved_mice_divine"];
- $user["cheese_gathered"] = (string) $row["cheese_gathered"];
- }
- while($row2 = mysql_fetch_array($result2)) {
- $user["id_spouse"] = $row2["id_spouse"];
- $user["id_tribe"] = $row2["id_tribe"];
- $user["marriage_date"] = $row2["marriage_date"];
- if ($row2["id_gender"] == 0) { $user["gender"] = "Ninguno";}
- elseif ($row2["id_gender"] == 1) { $user["gender"] = "Femenino"; }
- else { $user["gender"] = "Masculino"; }
- }
- $result3 = mysql_query("SELECT * FROM tribe WHERE id=".$user["id_tribe"]);
- while($row3 = mysql_fetch_array($result3)) {
- $user["tribe"] = $row3["name"];
- }
- $result4 = mysql_query("SELECT * FROM player WHERE id=".$user["id_spouse"]);
- while ($row4 = mysql_fetch_array($result4)){
- $user["spouse"] = $row4["name"];
- }
- if (preg_match("|Date d'inscription : (.*?)</span>|is", $usr, $abc)) $user["registration_date"] = $abc[1];
- else $user["registration_date"] = "";
- $user["avatar"] = preg_match("|<div class=\"avatar-profil\"> <img src=\"http://avatars.atelier801.com/(.*?)\"|is", $usr, $a) ? "http://avatars.atelier801.com/".$a[1] : false;
- $a = array();
- $b = 0;
- while (true)
- {
- if ($b == 0) { $a[$b+1] = 32; $c = 32; }
- elseif ($b > 0 && $b < 29) { $a[$b+1] = ($c+2*($b+1))+$a[$b]; $c = $c+2*($b+1); }
- elseif ($b > 28 && $b < 59) { $a[$b+1] = ($c+10*($b+1))+$a[$b]; $c = $c+10*($b+1); }
- else { $a[$b+1] = ($c+15*($b+1))+$a[$b]; $c = $c+15*($b+1); }
- if ($a[$b+1] > $user["experience"]) { $user["level"] = $b+1; break; }
- if ($b == 887) { $user["level"] = 888; break; }
- $b++;
- }
- ######## Crear Imagen ########
- $width = 419;
- $height = 364;
- $img = ImageCreateTrueColor($width,$height);
- imagesavealpha($img, true);
- $bg = ImageColorAllocateAlpha($img, 0, 0, 0, 127);
- ImageFill($img,0,0,$bg);
- ######## Asignar Fondo ########
- $bg1 = imagecreatefrompng('base.png');
- $right_margin = 0;
- $bottom_margin = 0;
- $sx = imagesx($bg1);
- $sy = imagesy($bg1);
- imagecopy($img, $bg1, imagesx($img) - $sx - $right_margin, imagesy($img) - $sy - $bottom_margin, 0, 0, imagesx($bg1), imagesy($bg1));
- ######## Propiedades Titulo ########
- $font_color = ImageColorAllocate($img, 0, 161, 161);
- $font = 'soopafre.ttf';
- $font_color_texto = ImageColorAllocate($img, 194, 194, 218);
- $font_color_sexo = ImageColorAllocate($img, 152, 226, 235);
- $font_color_normal = ImageColorAllocate($img, 0, 157, 157);
- $font_color_dificil = ImageColorAllocate($img, 186, 189, 47);
- $font_color_divino = ImageColorAllocate($img, 203, 84, 107);
- $stats = ImageColorAllocate($img, 108, 119, 193);
- $tribe = ImageColorAllocate($img, 186, 189, 47);
- $separador = ImageColorAllocate($img, 96, 96, 144);
- $font_texto = 'ARIALN.TTF';
- ######## Imprimir Texto ########
- imagettftext($img,20,0,125,50,$font_color,$font,$_GET["user"]);
- imagettftext($img,10,0,22,118,$font_color_texto,$font_texto,'Sexo : ');
- $masculino = imagecolorallocate($img, 152, 226, 235);
- $femenino = imagecolorallocate($img, 254, 177, 252);
- $ninguno = imagecolorallocate($img, 108, 119, 193);
- if ($user["gender"] == "Masculino") imagettftext($img,10,0,55,118,$masculino,$font_texto,"Masculino");
- elseif ($user["gender"] == "Femenino") imagettftext($img,10,0,55,118,$femenino,$font_texto,"Femenino");
- else imagettftext($img,10,0,55,118,$ninguno,$font_texto,"Ninguno");
- imagettftext($img,10,0,22,132,$font_color_texto,$font_texto,'Pareja :');
- imagettftext($img,10,0,63,132,$stats,$font_texto,$user["spouse"]);
- imagettftext($img,10,0,22,146,$font_color_texto,$font_texto,'Fecha de registro :');
- imagettftext($img,10,0,115,146,$stats,$font_texto,$user["registration_date"]);
- imagettftext($img,10,0,22,160,$font_color_texto,$font_texto,'Tribu :');
- imagettftext($img,10,0,58,160,$tribe,$font_texto,$user["tribe"]);
- imagettftext($img,10,0,22,180,$font_color_texto,$font_texto,'Nivel');
- imagettftext($img,10,0,50,180,$tribe,$font_texto,$user["level"]);
- imagettftext($img,10,0,22,194,$font_color_texto,$font_texto,'Título actual : ');
- imagettftext($img,10,0,92,194,$tribe,$font_texto,$user["title"]);
- imagettftext($img,10,0,22,214,$font_color_texto,$font_texto,'Chaman');
- imagettftext($img,10,0,25,228,$stats,$font_texto,'• Ratones salvados :');
- imagettftext($img,10,0,32,242,$font_color_normal,$font_texto,$user["saved_mice"]);
- imagettftext($img,10,0,72,242,$font_color_dificil,$font_texto,$user["saved_mice_hard"]);
- imagettftext($img,10,0,112,242,$font_color_divino,$font_texto,$user["saved_mice_divine"]);
- imagettftext($img,10,0,25,256,$stats,$font_texto,'• Quesos conseguidos como chamán : ');
- imagettftext($img,10,0,210,256,$font_color_normal,$font_texto,$user["shaman_cheese"]);
- imagettftext($img,10,0,22,276,$font_color_texto,$font_texto,'Ratón');
- imagettftext($img,10,0,25,290,$stats,$font_texto,'• Quesos conseguidos siendo primero : ');
- imagettftext($img,10,0,215,290,$font_color_normal,$font_texto,$user["first"]);
- imagettftext($img,10,0,25,304,$stats,$font_texto,'• Quesos conseguidos : ');
- imagettftext($img,10,0,139,304,$font_color_normal,$font_texto,$user["cheese_gathered"]);
- imagettftext($img,10,0,25,318,$stats,$font_texto,'• Bootcamp : ');
- imagettftext($img,10,0,87,318,$font_color_normal,$font_texto,$user["bootcamp"]);
- ######## Agregar Avatar ########
- if ($user["avatar"] != false)
- {
- $img_a = imagecreatefromjpeg($user["avatar"]);
- $img_a = imagescale($img_a, 87);
- imagecopy($img, $img_a, 8, 9, 0, 0, 87, 87);
- }
- ######## Estructurar Imagen ########
- header('Content-Type: image/png');
- ImagePNG($img);
- imagepng($img);
- imagedestroy($img);
- }
- }
- else
- {
- echo "Especifique un usuario.";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement