PHP/MySQL | Вывод изображений
Не могу понять где ошибка тут !
Было пару багов уже исправил , вывод стоит только на No Ava ,а хотя должна быть собрана картинка
Если кто поможет в долгу не останусь !
Вот код :
Код в 3 посте !
________
посл. ред. 16.06.2015 в 13:40; всего 2 раз(а); by MobiEx
Было пару багов уже исправил , вывод стоит только на No Ava ,а хотя должна быть собрана картинка
Если кто поможет в долгу не останусь !
Вот код :
Код в 3 посте !
________
посл. ред. 16.06.2015 в 13:40; всего 2 раз(а); by MobiEx
MobiEx, если што с утра помогу тебе с кодом
Вот этот код нужно править !!!
<?
require_once("inc/mysql.php");
if(isset($_GET['tk'])){
$tk = $_GET['tk'];
$tk = explode("_",$_GET['tk']);
}
if(isset($tk['1'])){
if(file_exists($_SERVER['DOCUMENT_ROOT']."/instalscript/images/angar/".abs($tk['1']).".jpg") == null){
$aimg = "/instalscript/images/angar/standart.jpg";
}else{
$aimg = "/instalscript/images/angar/".abs($tk['1']).".jpg";
}
}else{
$aimg = "/instalscript/images/angar/standart.jpg";
}
$background = imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'].$aimg);
$background_sy = imagesy($background);
$background_sx = imagesx($background);
if(isset($tk['0'])){
$tankq = mysql_query("SELECT * FROM `tank` WHERE `id` = '".intval($tk['0'])."' ");
if(isset($tankq)){
if(isset($tankq['img'])){
if(file_exists($_SERVER['DOCUMENT_ROOT'].$tankq['img']) == null){
$tankimg = '/instalscript/images/tank/empty.png';
}else{$tankimg = $tankq['img'];}
}else{$tankimg = '/instalscript/images/tank/empty.png';}
if($tankq != null){
$img = "/instalscript/images/tank/flag/".$tankq['country'].".png";
$flag = imagecreatefrompng($_SERVER['DOCUMENT_ROOT'].$img);
$flag_sy = imagesy($flag);
$flag_sx = imagesx($flag);
imagecopy($background, $flag,$background_sx-$flag_sx-0,$background_sx-$background_sy-60,0,0,$flag_sx,$flag_sy);
}
}
}else{$tankimg = '/instalscript/images/tank/empty.png';}
if(file_exists($_SERVER['DOCUMENT_ROOT'].$tankq['img']) == null){
$tankimg = '/instalscript/images/tank/empty.png';
}else{
$tankimg = '/instalscript/images/tank/empty.png';
$tank = imagecreatefrompng($_SERVER['DOCUMENT_ROOT'].$tankimg);
}
$tankimg = '/instalscript/images/tank/empty.png';
$tank = imagecreatefrompng($_SERVER['DOCUMENT_ROOT'].$tankimg);
$tank_sy = imagesy($tank);
$tank_sx = imagesx($tank);
imagecopy($background, $tank,$background_sx-$tank_sx+0,$background_sx-$background_sy-60,0,0,$tank_sx,$tank_sy);
if(isset($tankq)){
if($tankq != null){
# $textcolor_black = imagecolorallocate($background, 0, 0, 0); # цвет текста в системе RGB
$textcolor_white = imagecolorallocate($background, 255, 255, 255); # цвет текста в системе RGB
$text_sample = ($tankq['name']); # Текст
imagefttext($background,10,0,5,95,$textcolor_white,$_SERVER['DOCUMENT_ROOT']."/instalscript/main/fonts/arial.ttf","$text_sample");
}
}
header('content-type:image/jpg');
imagejpeg($background);
imagedestroy($background);
?>
require_once("inc/mysql.php");
if(isset($_GET['tk'])){
$tk = $_GET['tk'];
$tk = explode("_",$_GET['tk']);
}
if(isset($tk['1'])){
if(file_exists($_SERVER['DOCUMENT_ROOT']."/instalscript/images/angar/".abs($tk['1']).".jpg") == null){
$aimg = "/instalscript/images/angar/standart.jpg";
}else{
$aimg = "/instalscript/images/angar/".abs($tk['1']).".jpg";
}
}else{
$aimg = "/instalscript/images/angar/standart.jpg";
}
$background = imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'].$aimg);
$background_sy = imagesy($background);
$background_sx = imagesx($background);
if(isset($tk['0'])){
$tankq = mysql_query("SELECT * FROM `tank` WHERE `id` = '".intval($tk['0'])."' ");
if(isset($tankq)){
if(isset($tankq['img'])){
if(file_exists($_SERVER['DOCUMENT_ROOT'].$tankq['img']) == null){
$tankimg = '/instalscript/images/tank/empty.png';
}else{$tankimg = $tankq['img'];}
}else{$tankimg = '/instalscript/images/tank/empty.png';}
if($tankq != null){
$img = "/instalscript/images/tank/flag/".$tankq['country'].".png";
$flag = imagecreatefrompng($_SERVER['DOCUMENT_ROOT'].$img);
$flag_sy = imagesy($flag);
$flag_sx = imagesx($flag);
imagecopy($background, $flag,$background_sx-$flag_sx-0,$background_sx-$background_sy-60,0,0,$flag_sx,$flag_sy);
}
}
}else{$tankimg = '/instalscript/images/tank/empty.png';}
if(file_exists($_SERVER['DOCUMENT_ROOT'].$tankq['img']) == null){
$tankimg = '/instalscript/images/tank/empty.png';
}else{
$tankimg = '/instalscript/images/tank/empty.png';
$tank = imagecreatefrompng($_SERVER['DOCUMENT_ROOT'].$tankimg);
}
$tankimg = '/instalscript/images/tank/empty.png';
$tank = imagecreatefrompng($_SERVER['DOCUMENT_ROOT'].$tankimg);
$tank_sy = imagesy($tank);
$tank_sx = imagesx($tank);
imagecopy($background, $tank,$background_sx-$tank_sx+0,$background_sx-$background_sy-60,0,0,$tank_sx,$tank_sy);
if(isset($tankq)){
if($tankq != null){
# $textcolor_black = imagecolorallocate($background, 0, 0, 0); # цвет текста в системе RGB
$textcolor_white = imagecolorallocate($background, 255, 255, 255); # цвет текста в системе RGB
$text_sample = ($tankq['name']); # Текст
imagefttext($background,10,0,5,95,$textcolor_white,$_SERVER['DOCUMENT_ROOT']."/instalscript/main/fonts/arial.ttf","$text_sample");
}
}
header('content-type:image/jpg');
imagejpeg($background);
imagedestroy($background);
?>