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))
- {
- header("Content-type: image/png");
- $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["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"];
- }
- $user["avatar"] = preg_match("|<div class=\"avatar-profil\"> <img src=\"http://avatars.atelier801.com/(.*?)\"|is", $usr, $a) ? "http://avatars.atelier801.com/".$a[1] : false;
- $img = imagecreatetruecolor(600, 400);
- $colorfondo = imagecolorallocate($img, 28, 59, 64);
- $colortexto = imagecolorallocate($img, 150, 159, 176);
- $colortitulo = imagecolorallocate($img, 169, 173, 49);
- $negro = imagecolorallocate($img, 0, 0, 0);
- imagefilledrectangle($img, 0, 0, 600, 399, $colorfondo);
- $fuente = "./soopafre.ttf";
- $fuentetexto = "./arialbd.ttf";
- imagettftext($img, 20, 0, 12, 32, $negro, $fuente, $user["name"]);
- imagettftext($img, 20, 0, 8, 28, $negro, $fuente, $user["name"]);
- imagettftext($img, 20, 0, 10, 30, $colortitulo, $fuente, $user["name"]);
- $todoeltexto = "Título: ".$user["title"]."\r\nExperiencia: ".$user["experience"]."\r\nFirsts: ".$user["first"]."\r\nBootcamps: ".$user["bootcamp"]."\r\nRondas: ".$user["round_played"]."\r\nQuesos conseguidos como chamán: ".$user["shaman_cheese"]."\r\nRatones salvados: ".$user["saved_mice"]."\r\nRatones salvados en modo difícil: ".$user["saved_mice_hard"]."\r\nRatones salvados en modo divino: ".$user["saved_mice_divine"]."\r\nQuesos conseguidos: ".$user["cheese_gathered"]."\r\nFecha de matrimonio: ".$user["marriage_date"]."\r\nSexo: ".$user["gender"]."\r\nTribu: ".$user["tribe"]."\r\nPareja: ".$user["spouse"]."";
- imagettftext($img, 12, 0, 10, 60, $colortexto, $fuentetexto, $todoeltexto);
- if ($user["avatar"] != false)
- {
- $img_a = imagecreatefromjpeg($user["avatar"]);
- imagecopy($img, $img_a, 480, 20, 0, 0, 100, 100);
- }
- imagepng($img);
- imagedestroy($img);
- }
- else
- {
- echo "El usuario no existe.";
- }
- }
- else
- {
- echo "Especifique un usuario.";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement