Просмотр файла games/jar.php

Размер файла: 1.09Kb
<?
include('modul/pclzip.lib.php'); include('modul/config.php');
$id=intval($_GET['id']);  
$query=mysql_query("SELECT * FROM `files` WHERE id=$id"); $d=mysql_fetch_array($query);
$jar=new PclZip(''.$d['infolder'].'/'.$d['name'].'');
$content=$jar->extract(PCLZIP_OPT_BY_NAME,"META-INF/MANIFEST.MF", PCLZIP_OPT_EXTRACT_AS_STRING); 
$cont=$content[0]['content'];
if(preg_match('|MIDlet-Icon: (.*)
|',$cont,$result)) { $icon=$result[1]; }
$array=array("logo.png","icon.PNG","icon.png","ico.png","i.png","icono.png","Icon.png","Ico.png","I.png","Icono.png","ICON.png","ICO.png","I.png","ICONO.png","ICON.PNG","ICO.PNG","I.PNG","ICONO.PNG","icons/icon.png","icons/ico.png","icons/i.png","icons/icono.png","i","I");
if($string=$jar->extract(PCLZIP_OPT_BY_NAME,$array, PCLZIP_OPT_EXTRACT_AS_STRING)){
$str=$string[0]['content'];
$image=imagecreatefromstring($str);
}
else { $image=imagecreatefrompng('image/xpmelogo.png'); }
$width=imagesx($image); $height=imagesy($image);
$img=imagecreatetruecolor(80,95); imagecopyresampled($img, $image,0,0,0,0,80,95,$width,$height);
header('Content-type: image/png');
imagepng($img);
?>