Jump to content

GD help


mike1313

Recommended Posts

OK so I want it to display all the players but for some reason its only displaying one any suggestions?

 

$url = "images/Eden_ISOtest_VIEW.jpg";
$url_admin = "images/admin_body.png";
$im = @imagecreatefromjpeg($url) or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
$red = imagecolorallocate($im, 255, 0, 0);
$yellow = imagecolorallocate($im, 173, 255, 47);
$white = imagecolorallocate($im, 255,255,255);
$black = imagecolorallocate($im, 0,0,0);
imagerectangle($im, 0, 0, 504, 504, $black);


$query = mysql_query("select * from players");
while ($pos = mysql_fetch_array($query)){
$coords = "($pos[x], $pos[y])";
imageString($im, 1, ($pos[x]+3), ($pos[y]-6), $pos[username], $black);
imageString($im, 1, ($pos[x]+2), ($pos[y]+3), $coords, $black);

  if ($pos[pos] == "Admin") { 

  $insert32 = imagecreatefrompng("images/devil.png"); 
  $insert_x32 = imagesx($insert32); 
  $insert_y32 = imagesy($insert32); 

  imagecopymerge($im,$insert32,$pos[x],$pos[y],0,0,12,$insert_y32,100); 


  imagepng($im,"",100); 

  } 
   
else {
  $insertx = @imagecreatefrompng("images/devil.png"); 
  $insert_xx = imagesx($insertx); 
  $insert_yx = imagesy($insertx); 

  imagecopymerge($im,$insertx,$pos[x],$pos[y],0,0,12,$insert_yx,100); 


  imagepng($im,"",100); 
  
  }
}

imagepng($im);

imagedestroy($im);

Link to comment
https://forums.phpfreaks.com/topic/44795-gd-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.