예제 #1
0
    $tc = imagecolorallocate($im, 0, 0, 0);
    imagefilledrectangle($im, 0, 0, $image_width, $image_height, $bgc);
    /* Output an error message */
    imagestring($im, 1, 5, 5, 'Error:', $tc);
    imagestring($im, 1, 5, 20, "Not found.", $tc);
    imagepng($im);
    imagedestroy($im);
    die;
}
// Get character attributes
$character_data = $q->fetch_array();
$internal_id = $character_data['internal_id'];
$character_id = $character_data['id'];
$image_mode = isset($_GET['show_name']) ? 'avatar_ingame' : 'avatar';
if (!isset($_GET['NO_CACHING'])) {
    ShowCachedImage($internal_id, $image_mode, $character_data['last_update'], false, '1 MINUTE');
}
$id = uniqid() . rand(0, 999);
if (!isset($_GET['NO_CACHING'])) {
    AddCacheImage($internal_id, $image_mode, $character_data['last_update'], $id);
}
// Create blank template
$im = imagecreatetruecolor($image_width, $image_height);
imagesavealpha($im, true);
$trans = imagecolorallocatealpha($im, 0, 0, 0, 127);
imagefill($im, 0, 0, $trans);
// Set everything null for the hash
$skin = $face = $hair = $hat = $mask = $eyes = $ears = $top = $pants = $overall = $shoe = $glove = $cape = $shield = $wep = $nxwep = NULL;
// Coordinates for center
$mainx = 58;
$mainy = 38;
예제 #2
0
if ($q->num_rows == 0) {
    $im = imagecreatetruecolor(192, 345);
    $bgc = imagecolorallocate($im, 255, 255, 255);
    $tc = imagecolorallocate($im, 0, 0, 0);
    imagefilledrectangle($im, 0, 0, 192, 345, $bgc);
    /* Output an error message */
    imagestring($im, 1, 5, 5, 'I AM ERROR', $tc);
    imagestring($im, 1, 5, 20, "No data found", $tc);
    imagepng($im);
    imagedestroy($im);
    die;
}
$row = $q->fetch_assoc();
$internal_id = $row['internal_id'];
if (!isset($_GET['NO_CACHING'])) {
    ShowCachedImage($internal_id, 'stats', $row['last_update'], false, '2 MINUTE');
}
$id = uniqid() . rand(0, 999);
AddCacheImage($internal_id, 'stats', $row['last_update'], $id);
$row['guildname'] = '-';
$q2 = $__char_db->query("\nSELECT\n\tg.name\nFROM\n\tcharacters c\nLEFT JOIN\n\tguild_members gm\n\tON\n\t\tgm.character_id = c.id\nLEFT JOIN\n\tguilds g\n\tON\n\t\tg.id = gm.guild_id\nWHERE\n\tc.internal_id = " . $row['internal_id']);
if ($q2->num_rows == 1) {
    // Try to fetch guildname
    $row2 = $q2->fetch_row();
    if ($row2[0] !== null) {
        $row['guildname'] = $row2[0];
    }
}
$q2->free();
$stat_addition = GetCorrectStat($row['internal_id'], CURRENT_LOCALE);
$potential_stat_addition = GetItemPotentialBuffs($row['internal_id'], CURRENT_LOCALE);