Файл: load/jad.php
Строк: 28
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
$row = $db -> query("SELECT TRIM(`path`),`name`,`load` FROM `load_files` WHERE `id`='".$id."'") -> fetch_assoc();
if (file_exists($row['path'])) {
if (!isset($_COOKIE['jar_'.$id]) && isset($_GET['load'])) {
$up=$row['load']+1;
$db -> query("UPDATE `load_files` SET `load`='$up' WHERE `id`='".$id."'");
setCookie('jar_'.$id, time(), time() + 3600 * 24 * 365, '/');
}
require_once(ROOT.'system/lib/pclzip.lib.php');
$zip = new PclZip($row['path']);
$content = $zip->extract(PCLZIP_OPT_BY_NAME, 'META-INF/MANIFEST.MF', PCLZIP_OPT_EXTRACT_AS_STRING);
header('Content-type: text/vnd.sun.j2me.app-descriptor');
header('Content-Disposition: attachment; filename="'.basename($row['path']).'.jad";');
echo $content[0]['content']."n".'MIDlet-Jar-Size: '.$row['name']."n".'MIDlet-Jar-URL: '.$row['path'];
} else header('location: index.php');
?>