Размер файла: 3.42Kb
<?php
#---------------------------------------------------#
# #
# ********* AgS DOWNLOAD centre 1.0 ********* #
# #
# Author : Agris Cišs #
# E-mail : [email protected] #
# WAP-site : http://ags.h2m.ru #
# Home : LATVIA J-city #
# #
# Don't sell the skript! #
# If you do it, I will hit to your face! :D #
# #
#---------------------------------------------------#
include "sys/cons.php";
include "sys/cepumi.php";
include "sys/funct.php";
include "sys/lang/$language.php";
include "sys/msg.php";
include "sys/zip.php";
$d = @opendir('temp/img');
while($f = @readdir($d)) {
if($f != '.' && $f != '..') {
if(time() - filectime('temp/img/'.$f) > IMAGE_DELETE_SECONDS) {
unlink('temp/small/'.$f); }
}
} @closedir($f);
##############################
$d = @opendir('temp/mp3');
while($f = @readdir($d)) {
if($f != '.' && $f != '..') {
if(time() - filectime('temp/mp3/'.$f) > IMAGE_DELETE_SECONDS) {
unlink('temp/mp3/'.$f); }
}
} @closedir($f);
#######################################
@$fails = $_GET["fails"];
@$vards = $_GET["vards"];
@$height = $_GET["w"];
@$weight = $_GET["h"];
@$tip = $_GET["tips"];
if(preg_match("[http]",$fails)) exit(ERROR_MESAGE);
if(preg_match("[%]",$fails)) exit(ERROR_MESAGE);
if(preg_match("[http]",$vards)) exit(ERROR_MESAGE);
if(preg_match("[%]",$$vards)) exit(ERROR_MESAGE);
$er = strrchr($vards,'.');//formāts
//---------------- skaitam kachajumu -----------------\\
$counter = @file_get_contents("dati/$vards.count");
if(!empty($counter)) {
if(!preg_match("/[0-9]/i",$counter)){echo''.$lang['error'].''; exit;}
}
if(empty($counter)) {$counter = 0;}
if($fp=@fopen("dati/$vards.count","w+")){
@fputs($fp,$counter+1);
@fclose($fp);
} else{ echo ''.$lang['open_error'].'';exit;}
if(empty($tip)){
header("Location: $fails");exit;
}elseif($er==".jar" && $tip=="jad"){
//-------------------------------------
$vard = strrchr($vards,'.');
$neimss =$vard.'.jad';
$site=$_SERVER['SERVER_NAME'];
$zip = new PclZip($fails);
$ar = $zip->extract(PCLZIP_OPT_BY_NAME,"META-INF/MANIFEST.MF",
PCLZIP_OPT_EXTRACT_AS_STRING);
$ars = $ar[0]['content'];
$ars=trim(str_replace("\r\n","\n",$ars));
$ars=trim(str_replace("Manifest-Version: 1.0","",$ars));
$ars=trim(str_replace("Manifest-Version: 2.0","",$ars));
$ars=trim(str_replace("Manifest-Version: 2.1","",$ars));
$ars=trim(str_replace("Manifest-Version: 2.2","",$ars));
$ars=trim(str_replace("Manifest-Version: 2.3","",$ars));
$ars=trim(str_replace("Manifest-Version: 1.1","",$ars));
$ars=trim(str_replace("Manifest-Version: 1.2","",$ars));
$ars=trim(str_replace("Manifest-Version: 1.3","",$ars));
$ars .= "\nMIDlet-Jar-Size: ".filesize($fails)."\nMIDlet-Jar-URL: http://".$site.$folderscr.'/'.$neimss."\nMIDlet-Info-URL: http://$site\nNokia-MIDlet-Category: Game";
header("Content-Type: text/vnd.sun.j2me.app-descriptor");
header("Content-Disposition: attachment; filename=".$neimss);
header("Content-Length: ".strlen($ars));
$fp = fopen("$mape/$neimss","w");
fputs($fp,$ars);
fclose($fp);
header("Location: $mape/$neimss");exit;
}else{echo''.$lang['downer_error'].'';exit;}
?>