momento,
this is my code(guild war)
$main_content .= "<tr style=\"background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\">
<td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$a->getId()."\"><img src=\"guilds/".$alogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$a->getName()."</a><
and this my guild php
<?php
$mysqli = new mysqli("127.0.0.1", "root", "xxxxxx", "xxxx");
if(mysqli_connect_errno())
{
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = $mysqli->query("SELECT `logo`, OCTET_LENGTH(`logo`) as `length` FROM `guilds` WHERE `id` = " . intval($_GET['id']) . " LIMIT 1;");
if(!empty($query) && $row = $query->fetch_object())
{
$sizex = 64;
$sizey = 64;
if(!empty($row->length))
{
$src = imagecreatefromstring($row->logo);
if($src !== false)
{
$img = imagecreatetruecolor($sizex, $sizey);
imagealphablending($img, false);
imagesavealpha($img, true);
imagecopyresized($img, $src, 0, 0, 0, 0, $sizex, $sizey, imagesx($src), imagesy($src));
header('Content-Type: image/png');
imagepng($img);
imagedestroy($img);
}
}
else
{
$src = imagecreatefromstring(file_get_contents("./default.png"));
if($src !== false)
{
$img = imagecreatetruecolor($sizex, $sizey);
imagealphablending($img, false);
imagesavealpha($img, true);
imagecopyresized($img, $src, 0, 0, 0, 0, $sizex, $sizey, imagesx($src), imagesy($src));
header('Content-Type: image/png');
imagepng($img);
imagedestroy($img);
}
}
}
else
{
die("This guild doesn't exists.");
}
$mysqli->close();
?>