Example #1
0
/**
 * @param $matches preg_replace_callback matches array, where index 1
 *        is the filename to include
 */
function replace_includes_callback($matches)
{
    $file = $matches[1];
    // PHP 5 only file
    if ($file == 'HTMLPurifier/Lexer/DOMLex.php') {
        return $matches[0];
    }
    if (isset($GLOBALS['loaded'][$file])) {
        return '';
    }
    $GLOBALS['loaded'][$file] = true;
    create_blank($file);
    return replace_includes(remove_php_tags(file_get_contents($file)));
}
Example #2
0
        $im = imagecreatefrompng('./char.png');
    }
    return $im;
}
$img = load_player_skin('http://www.minecraft.net/skin/' . $player . '.png');
if ($usage == 'list') {
    $myhead = imagecreate(15, 15);
    $color = imagecolorallocate($myhead, 250, 250, 250);
    imagefill($myhead, 0, 0, $color);
    imagecopyresized($myhead, $img, 1, 1, 8, 8, 13, 13, 8, 8);
}
if ($usage == 'marker') {
    $myhead = create_blank(32, 37);
    $mymarker = imagecreatefrompng('./marker_blank.png');
    imagecopy($myhead, $mymarker, 0, 0, 0, 0, 32, 37);
    imagecopyresized($myhead, $img, 8, 8, 8, 8, 16, 16, 8, 8);
}
if ($usage == 'info') {
    $myhead = create_blank(48, 96);
    imagecopyresized($myhead, $img, 12, 0, 8, 8, 24, 24, 8, 8);
    imagecopyresized($myhead, $img, 12, 24, 20, 20, 24, 26, 8, 12);
    imagecopyresized($myhead, $img, 12, 50, 0, 20, 12, 26, 4, 12);
    imagecopyresized($myhead, $img, 24, 50, 8, 20, 12, 26, 4, 12);
    imagecopyresized($myhead, $img, 2, 24, 44, 20, 10, 26, 4, 12);
    imagecopyresized($myhead, $img, 36, 24, 52, 20, 10, 26, 4, 12);
    imagecopyresized($myhead, $img, 6, 6, 32, 10, 6, 3, 2, 1);
    imagecopyresized($myhead, $img, 36, 6, 32, 10, 6, 3, 2, 1);
}
imagepng($myhead);
imagedestroy($img);
imagedestroy($myhead);