Файл: masteram_us/wm_infa/java.php
Строк: 76
<?php
require'../shaxty.php'; // waphp.ru - закрытый клуб вап мастеров!
$align='left';
check_login();
$title='Интересное';
include_once (H.'shaxty/head.php');
echo '<br />';
require (H.'shaxty/zip.php');
$isset = $_GET['isset'];
$dir = opendir('midlet');
while ($tt = readdir($dir)) {
if ($tt != "." && $tt != ".." && $tt != 'index.php') {
$tm[] = $tt;
}
}
closedir($dir);
$totalt = count($tm);
for ($it = 0; $it < $totalt; $it++) {
$filtime[$it] = filemtime("midlet/$tm[$it]");
$tim = $time;
$ftime1 = $tim - 300;
if ($filtime[$it] < $ftime1) {
unlink("midlet/$tm[$it]");
}
}
$inf = mysql_fetch_array(mysql_query("select * from `wm_infa` where `id` = '".$id."'"));
echo '<b>'.$inf['name'].'</b><br />';
$inf['msg'] = html_entity_decode(trim($inf['msg']), ENT_QUOTES, 'UTF-8');
$text = notags($inf['msg']);
$text=eregi_replace("((<br( ?/?)>)|n|r)+","n", $text);
$text = strtr($text, array (
chr(0)=> '',
chr(1)=> '',
chr(2)=> '',
chr(3)=> '',
chr(4)=> '',
chr(5)=> '',
chr(6)=> '',
chr(7)=> '',
chr(8)=> '',
chr(9)=> '',
chr(10)=> '',
chr(11)=> '',
chr(12)=> '',
chr(13)=> '',
chr(14)=> '',
chr(15)=> '',
chr(16)=> '',
chr(17)=> '',
chr(18)=> '',
chr(19)=> '',
chr(20)=> '',
chr(21)=> '',
chr(22)=> '',
chr(23)=> '',
chr(24)=> '',
chr(25)=> '',
chr(26)=> '',
chr(27)=> '',
chr(28)=> '',
chr(29)=> '',
chr(30)=> '',
chr(31)=> ''
));
$letters = array("а","б","в","г","д","е","ё","ж","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ч","ш","щ","ъ","ы","ь","э","ю","я","А","Б","В","Г","Д","Е","Ё","Ж","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ч","Ш","Щ","Ъ","Ы","Ь","Э","Ю","Я");
for ( $b=0; $b<66; $b++) {if(strstr($text,$letters[$b])!== false){$utf="ok";}}
if($utf=="ok"){$ish=utf_to_win($text);} else {$ish=$text;}
$kod=fopen('ishodnik/textfile.txt', 'w');
fputs($kod, $ish);
fclose($kod);
$filename = $imjasajta . '_infa_'.$inf['id'];
$manifest = 'Manifest-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
MIDlet-Name: '.$inf['name'].'
TCBR-Platform: Generic version (all phones)
Created-By: Apache Ant 1.5.1
MIDlet-Vendor: tequilacat
MIDlet-1: '.$inf['name'].','.$inf['name'].' , br.BookReader
MIDlet-Version: 1.5.5
MicroEdition-Profile: MIDP-1.0
';
$props_text = 'bgcolor=16777215
fgcolor=0
J/textfile.txt.label=book(2)
';
$open_props = fopen('ishodnik/props.ini', 'w');
fputs($open_props, $props_text);
fclose($open_props);
$op = fopen('ishodnik/META-INF/MANIFEST.MF', 'w');
fputs($op, $manifest);
fclose($op);
$new = new PclZip('midlet/'.$filename.'.jar');
$file = $new -> create('ishodnik', PCLZIP_OPT_REMOVE_PATH, "ishodnik");
$ofile = fopen('ishodnik/textfile.txt', 'w');
fclose($ofile);
echo 'Ссылки для скачивания доступны <b>5</b> минут!<br>';
echo 'Скачать jar:<br>';
echo '<a href="midlet/'.$filename.'.jar">http://'.$_SERVER['HTTP_HOST'].'/wm_infa/midlet/'.$filename.'.jar</a><br>';
echo 'Скопировать прямую ссылку:<br>';
echo '<form action =""><input style = "margin-bottom:3px;" type = "text" size = "15" value="http://'.$_SERVER['HTTP_HOST'].'/wm_infa/midlet/'.$filename.'.jar"</form><br>';
if(isset($_GET['upd'])){
mysql_query("UPDATE ".$_GET['users']." set ".$_GET['que']." = '".$_GET['que2']."' where `id` = '".abs(intval($_GET['upd']))."' limit 1");
}
echo '<br />';
echo $div1.'<a href="read.php?id='.$inf['id'].'">Назад</a>'.$div9;
echo $div1.'<a href="index.php">Инфо</a>'.$div9;
include_once (H.'shaxty/foot.php');
?>