function ipcounter() { global $options; $xhandle = @opendir($this->tmp_dir); if ($xhandle) { while ($buin = readdir($xhandle)) { if (preg_match("@{$this->userip}@i", $buin)) { $this->heute = $this->heute + 1; } } $ckusr = decEnti((string) base64_decode(urldecode($_COOKIE['rxyzusr']))); $ckusr = is_numeric($ckusr) ? $ckusr : '******'; if ($ckusr != '' && $ckusr > $this->heute) { $this->heute = $ckusr; } else { setcookie('rxyzusr', base64_encode(encEnti((string) $this->heute)), TIME_NOW + $options['delay_per_ip'] * 3600); } closedir($xhandle); error_reporting(false); $xhandle = @opendir($this->tmp_dir); while ($buin = readdir($xhandle)) { if ($buin == "." || $buin == "..") { $buin = "fu"; } $xd = @filemtime($this->tmp_dir . $buin); $xd = getNowzone($xd); $altr = TIME_NOW - $xd; if ($altr > $options['delay_per_ip'] * 3600) { if (is_dir($this->tmp_dir . $buin)) { @rmdir($this->tmp_dir . $buin); } else { @unlink($this->tmp_dir . $buin); } } } closedir($xhandle); error_reporting(true); } }
function unrar_go_go() { global $options, $list, $L; ?> <script type="text/javascript"> /* <![CDATA[ */ function rar_st(elementid, st){ document.getElementById(elementid).innerHTML = st; return true; } /* ]]> */ </script> <?php for ($i = 0; $i < count($_GET["files"]); $i++) { $file = $list[$_GET["files"][$i]]; if (count($_GET['filestounrar'][$i]) == 0) { continue; } foreach ($_GET['filestounrar'][$i] as $rar_item) { flush(); $rar = new rlRar($file["name"], $options['check_these_before_unzipping'] ? $options['forbidden_filetypes'] : array('.xxx')); if ($rar->rar_return === false) { ?> <script type="text/javascript">rar_st('<?php echo 'unrar' . $_GET["files"][$i] . '-' . str_replace('=', '-', $rar_item); ?> ', '<?php echo $L->say['rar_disappear']; ?> ');</script> <?php } else { $rar_result = $rar->extract(base64_decode($rar_item), $options['download_dir'], $_GET['passwords'][$i], 'unrar' . $_GET["files"][$i] . '-' . str_replace('=', '-', $rar_item), $i); echo $rar_result; if (strpos($rar_result, ", 'OK')") !== false) { _create_list(); $rar_tolist = realpath($options['download_dir']) . '/' . basename(base64_decode($rar_item)); $time = getNowzone(@filemtime($rar_tolist)); while (isset($list[$time])) { $time++; } $list[$time] = array("name" => $rar_tolist, "size" => bytesToKbOrMbOrGb(filesize($rar_tolist)), "date" => $time); if (!updateListInFile($list)) { ?> <script type="text/javascript">var tmp = document.getElementById('rar_finished'); tmp.innerHTML = "<?php echo $L->say['couldnt_upd_list']; ?> <br /><br />" + tmp.innerHTML</script>; <?php } } } } } ?> <script type="text/javascript">document.getElementById('unrar_finished').style.display = '';</script> <?php }
$lastError = $_GET['auth'] = ''; // With $_GET['auth'] empty it will still using the $auth unset($ref, $purl); } } while ($redirectto && !$lastError); if ($lastError) { html_error($lastError, 0); } elseif ($file["bytesReceived"] == $file["bytesTotal"] || $file["size"] == "Unknown") { list($final_link, $current_time) = link_for_file(dirname($pathWithName) . "/" . basename($file["file"]), false, true); echo "<script type=\"text/javascript\">pr(100, '" . $file["size"] . "', '" . $file["speed"] . "')</script>"; if ($options['enable_stop_transload']) { echo "<script type=\"text/javascript\">\$('#stoptl').hide();</script>"; } echo $L->sprintf($L->say['_filesaved'], $final_link, $file["size"], $file["time"], $file["speed"]); // we do have base date from here, no need to reassign again in other.php for purge file $file["date"] = getNowzone($current_time); $tosave = array("name" => $file["file"], "size" => str_replace(" ", " ", $file["size"]), "date" => $file["date"], "age" => $L->say['less_a_minute'], "link" => $_GET["link"], "comment" => str_replace("\n", "\\n", str_replace("\r", "\\r", $_GET["comment"])), "ip" => $visitors->userip); //print_r($tosave); $result = write_file(FILES_LST, serialize($tosave) . "\r\n", 0); $result2 = $options['downloadLimitbyIP'] ? write_file($visitors->FN['leech_log'], serialize(array("name" => $file["file"], "date" => $file["date"], "ip" => $visitors->userip)) . "\r\n", 0) : ''; if (!$result || !$result2) { echo $L->say['error_upd_list'] . "<br />"; } if ($options["limitbytraffic"]) { if ($options["max_trafic"] > 0) { if (!is_numeric($traffic->total)) { $traffic->total = 0; } $traffic->total += $file["bytesReceived"]; $traffic->updTraffic(); }
function rar_go_go() { global $options, $list, $L; ?> <script type="text/javascript"> /* <![CDATA[ */ function rar_st(elementid, st){ document.getElementById(elementid).innerHTML = st; return true; } /* ]]> */ </script> <?php flush(); require_once CLASS_DIR . "rar.php"; if ($options['disable_to']['act_del']) { $_GET['rar_opts']['delete'] = 0; } if ($options['disable_to']['act_archive_compression']) { $_GET['rar_opts']['comp_lvl'] = 0; } if ($_GET['rar_opts']['separated']) { $am = count($_GET['rar_opts']['filestorar']); } else { $am = 1; } for ($i = 0; $i < $am; $i++) { $name = $_GET['rar_opts']['separated'] ? basename($list[$_GET['rar_opts']['filestorar'][$i]]['name']) . '.rar' : $_GET['rar_opts']['rarfilename']; $rar = new rlRar($name, $options['check_these_before_unzipping'] ? $options['forbidden_filetypes'] : array('.xxx')); if ($rar->rar_return !== 'rar') { ?> <script type="text/javascript">rar_st('rar_status<?php echo $i; ?> ', '<?php echo $L->say['rar_disappear']; ?> ');</script> <?php } else { $rar_opts_tmp = $_GET['rar_opts']; if ($_GET['rar_opts']['separated']) { $rar_opts_tmp['filestorar'] = array($_GET['rar_opts']['filestorar'][$i]); } $rar_result = $rar->addtoarchive($rar_opts_tmp, $options['download_dir'], 'rar_status' . $i, $i); echo $rar_result; if (strpos($rar_result, ", 'Done')") !== false) { _create_list(); clearstatcache(); if ($_GET['rar_opts']['delete'] == true) { foreach ($_GET['rar_opts']['filestorar'] as $rar_tounlist) { $rar_tounlist = basename($list[$rar_tounlist]['name']); if (empty($rar_tounlist)) { continue; } $rar_tounlist = realpath($options['download_dir']) . '/' . $rar_tounlist; if (is_file($rar_tounlist)) { continue; } foreach ($list as $list_key => $list_item) { if ($list_item['name'] === $rar_tounlist) { unset($list[$list_key]); } } } } $rar_tolist = realpath($options['download_dir']) . '/' . basename($rar->filename); if ($_GET['rar_opts']['vols'] && !is_file($rar_tolist)) { if (substr(strtolower($rar_tolist), -4) == '.rar') { $rar_tolist = substr($rar_tolist, 0, -4); } $tmp = basename(strtolower($rar_tolist)) . '.part'; $rar_dir = opendir(realpath($options['download_dir']) . '/'); while (false !== ($rar_f_dd = readdir($rar_dir))) { $rar_f_dd_ = basename(strtolower($rar_f_dd)); if ($tmp == substr($rar_f_dd_, 0, strlen($tmp)) && is_numeric(substr($rar_f_dd_, strlen($tmp), -4))) { $rar_f_dd = realpath($options['download_dir']) . '/' . basename($rar_f_dd); $time = getNowzone(@filemtime($rar_f_dd)); while (isset($list[$time])) { $time++; } $list[$time] = array("name" => $rar_f_dd, "size" => bytesToKbOrMbOrGb(filesize($rar_f_dd)), "date" => $time); } } closedir($rar_dir); } elseif (is_file($rar_tolist)) { $time = getNowzone(@filemtime($rar_tolist)); while (isset($list[$time])) { $time++; } $list[$time] = array("name" => $rar_tolist, "size" => bytesToKbOrMbOrGb(filesize($rar_tolist)), "date" => $time); } if (!updateListInFile($list)) { ?> <script type="text/javascript">var tmp = document.getElementById('rar_finished'); tmp.innerHTML = "<?php echo $L->say['couldnt_upd_list']; ?> <br /><br />" + tmp.innerHTML</script>; <?php } } } } ?> <script type="text/javascript">document.getElementById('rar_finished').style.display = '';</script> <?php }
function zip_go() { global $list, $options, $L; $saveTo = realpath($options['download_dir']) . '/'; $_POST["archive"] = strlen(trim(urldecode($_POST["archive"]))) > 4 && substr(trim(urldecode($_POST["archive"])), -4) == ".zip" ? trim(urldecode($_POST["archive"])) : "archive.zip"; $_POST["archive"] = $saveTo . basename($_POST["archive"]); for ($i = 0; $i < count($_POST["files"]); $i++) { $files[] = $list[$_POST["files"][$i]]; } foreach ($files as $file) { $CurrDir = ROOT_DIR; $inCurrDir = stristr(dirname($file["name"]), $CurrDir) ? TRUE : FALSE; if ($inCurrDir) { $add_files[] = substr($file["name"], strlen($CurrDir)); } } require_once CLASS_DIR . "pclzip.php"; $archive = new PclZip($_POST["archive"]); $no_compression = $options['disable_to']['act_archive_compression'] || isset($_POST["no_compression"]); if (file_exists($_POST["archive"])) { if ($no_compression) { $v_list = $archive->add($add_files, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_NO_COMPRESSION); } else { $v_list = $archive->add($add_files, PCLZIP_OPT_REMOVE_ALL_PATH); } } else { if ($no_compression) { $v_list = $archive->create($add_files, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_NO_COMPRESSION); } else { $v_list = $archive->create($add_files, PCLZIP_OPT_REMOVE_ALL_PATH); } } if ($v_list == 0) { echo $L->say['_error'] . ": " . $archive->errorInfo(true) . "<br /><br />"; return; } else { echo $L->say['_arcv'] . " <b>" . $_POST["archive"] . "</b> " . $L->say['success_created'] . "<br /><br />"; } if (is_file($_POST['archive'])) { $time = getNowzone(@filemtime($_POST['archive'])); while (isset($list[$time])) { $time++; } $list[$time] = array("name" => $_POST['archive'], "size" => bytesToKbOrMbOrGb(filesize($_POST['archive'])), "date" => $time); if (!updateListInFile($list)) { echo $L->say['couldnt_upd_list'] . "<br /><br />"; } } }
$RL_VER = 'Rx08.ii' . $rev_num; $PHP_SELF = $_SERVER['SCRIPT_NAME']; define('PATH_SPLITTER', strstr(realpath("./"), "\\") !== false ? "\\" : "/"); define('ROOT_DIR', realpath("./") . PATH_SPLITTER); define('HOST_DIR', 'pluginz/'); define('STATIC_DIR', 'static/'); define('BINARY_DIR', 'binary/'); define('CLASS_DIR', 'classes/'); define('CONFIG_DIR', 'configs/'); define('LANG_DIR', CLASS_DIR . 'languages/'); //check config.php is exist or not, run setup file only if needed require_once CONFIG_DIR . 'setup.php'; // Load function and class require_once CLASS_DIR . "other.php"; // Set server timezone; TIME_NOW will set here $tzone = getNowzone(); define("TIME_NOW", $tzone); require_once CLASS_DIR . "timers.class.php"; $maintimer = new timer(); $maintimer->timer(); // $download_dir should always end with '/' if (substr($options["download_dir"], -1) != '/') { $options["download_dir"] .= '/'; } define('DOWNLOAD_DIR', substr($options["download_dir"], 0, 6) == "ftp://" ? '' : $options["download_dir"]); define('TEMPLATE_DIR', 'tpl/' . $options['template_used'] . '/'); define('IMAGE_DIR', TEMPLATE_DIR . 'skin/' . $options["csstype"] . '/'); // Language initialisation require_once CLASS_DIR . "lang.class.php"; $L = new RxLang(); $charSet = $L->settings["charset"];
function unzip_go() { global $list, $options, $L; require_once CLASS_DIR . "unzip.php"; $any_file_unzippped = false; for ($i = 0; $i < count($_POST["files"]); $i++) { $file = $list[$_POST["files"][$i]]; if (file_exists($file["name"])) { $zip = new dUnzip2($file["name"]); $allf = $zip->getList(); $file_inside_zip_exists = false; $forbidden_inside_zip = false; foreach ($allf as $k => $properties) { if (file_exists($options['download_dir'] . basename($properties['file_name']))) { $file_inside_zip_exists = true; break; } } if ($options['check_these_before_unzipping']) { foreach ($allf as $k => $property) { $zfiletype = strrchr($property['file_name'], "."); if (is_array($options['forbidden_filetypes']) && in_array(strtolower($zfiletype), $options['forbidden_filetypes'])) { $forbidden_inside_zip = true; break; } } } if ($file_inside_zip_exists) { echo 'Some file(s) inside <b>' . htmlentities(basename($file["name"])) . '</b> already exist on download directory'; echo "<br /><br />"; } elseif ($forbidden_inside_zip) { echo $L->sprintf($L->say['_err_filetype'], $zfiletype) . "<br /><br />"; } else { $zip->unzipAll($options['download_dir']); if ($zip->getList() != false) { $any_file_unzippped = true; echo '<b>' . htmlentities(basename($file["name"])) . '</b> unzipped successfully<br /><br />'; foreach ($allf as $k => $properties) { $efile = realpath($options['download_dir']) . '/' . basename($properties['file_name']); if (is_file($efile)) { $time = getNowzone(@filemtime($efile)); while (isset($list[$time])) { $time++; } $list[$time] = array("name" => $efile, "size" => bytesToKbOrMbOrGb(filesize($efile)), "date" => $time); } } if (!updateListInFile($list)) { echo $L->say['couldnt_upd_list'] . "<br /><br />"; } } else { echo "File <b>" . $file["name"] . "</b> not found!<br /><br />"; } } } } }
function _create_list($lynx = false, $medic = false, $d_showall = false) { global $list, $_COOKIE, $options; $glist = array(); $showall = $options['show_all'] && (isset($_COOKIE['showAll']) && $_COOKIE['showAll'] || $d_showall) || $medic ? true : false; // if (!$d_showall) $d_showall = (isset($_COOKIE["showAll"]) ? $_COOKIE["showAll"] : false); // if (($options["show_all"] && ($d_showall == 1)) || $medic) { if ($showall) { // Show Everything $totsize = 0; $cnt = 0; $dir = @dir(DOWNLOAD_DIR); while (false !== ($file = $dir->read())) { if ($file != "." && $file != ".." && is_array($options["forbidden_filetypes"]) && !in_array("." . get_extension($file), $options["forbidden_filetypes"]) && is_file(DOWNLOAD_DIR . $file) && basename($file) != basename(FILES_LST) && basename($file) != 'index.html' && basename($file) != 'index.php') { $file = DOWNLOAD_DIR . $file; if (($tmp = file_data_size_time($file)) === false) { continue; } list($size, $time) = $tmp; $time = getNowzone($time); while (isset($glist[$time])) { $time++; } $agefile = TIME_NOW - $time; $glist[$time] = array("name" => realpath($file), "size" => bytesToKbOrMbOrGb($size), "date" => $time, "age" => count_age($agefile)); if ($options["show_column_sfile"]["md5"] && !$lynx) { $glist[$time]["md5"] = md5_file($file); } $totsize += $size; $cnt++; } } $dir->close(); @uasort($glist, "_cmp_list_enums"); if ($cnt > 0) { $glist["files"]["totalsize"] = $totsize; $glist["files"]["totalfile"] = $cnt; $glist["files"]["misc"] = "files"; } } else { // Show Downloaded if (@file_exists(FILES_LST)) { $glist = file(FILES_LST); $glistReformat = null; foreach ($glist as $key => $record) { $recfile = @unserialize($record); if (is_array($recfile)) { foreach ($recfile as $field => $value) { if (in_array($field, array("date", "age", "misc"))) { $time = @filemtime($recfile["name"]); $time = getNowzone($time); //$unix_zone = ($time != $value ? $time - date("Z") + (3600 * $options["timezone"]) : $value); if ($field == "age") { $agefile = TIME_NOW - $time; $listReformat[$key]["age"] = count_age($agefile); } if ($field == "date") { $listReformat[$key][$field] = $time; $date = $time; } } if ($field != "age" && $field != "date") { $listReformat[$key][$field] = $value; } } $glist[$date] = $listReformat[$key]; unset($glist[$key], $glistReformat[$key]); } } @uasort($glist, "_cmp_list_enums"); } } $list = $glist; }
function split_go() { global $list, $options, $L; for ($i = 0; $i < count($_POST["files"]); $i++) { $split_ok = true; $file = $list[$_POST["files"][$i]]; $partSize = round($_POST["partSize"][$i] * 1024 * 1024); $saveTo = ($options['download_dir_is_changeable'] ? stripslashes($_POST["saveTo"][$i]) : realpath($options['download_dir'])) . '/'; $dest_name = basename($file["name"]); $fileSize = filesize($file["name"]); $totalParts = ceil($fileSize / $partSize); $crc = $_POST['crc_mode'][$i] == 'file_read' ? dechex(crc32(read_file($file["name"]))) : ($_POST['crc_mode'][$i] == 'hash_file' && function_exists('hash_file') ? hash_file('crc32b', $file["name"]) : '111111'); $crc = str_repeat("0", 8 - strlen($crc)) . strtoupper($crc); echo $L->say["start_split"] . " <b>" . basename($file["name"]) . "</b> parts of " . bytesToKbOrMbOrGb($partSize) . ", Using Method - Total Commander...<br />"; echo $L->say["tot_part"] . ": <b>" . $totalParts . "</b><br /><br />"; for ($j = 1; $j <= $totalParts; $j++) { if (file_exists($saveTo . $dest_name . '.' . sprintf("%03d", $j))) { echo $L->say["split_error"] . " " . $L->say["piece_exist"] . "<b>" . $dest_name . '.' . sprintf("%03d", $j) . "</b> !<br /><br />"; continue 2; } } if (file_exists($saveTo . $dest_name . '.crc')) { echo $L->say["split_error"] . " " . $L->say["crc_exist"] . "<b>" . $dest_name . '.crc' . "</b> !<br /><br />"; } elseif (!is_file($file["name"])) { echo $L->say["split_error"] . " " . $L->say["src_notfound"] . "<b>" . $file["name"] . "</b> !<br /><br />"; } elseif (!is_dir($saveTo)) { echo $L->say["split_error"] . " " . $L->say["dir_inexist"] . "<b>" . $saveTo . "</b> !<br /><br />"; } elseif (!@write_file($saveTo . $dest_name . ".crc", "filename=" . $dest_name . "\r\n" . "size=" . $fileSize . "\r\n" . "crc32=" . $crc . "\r\n")) { echo $L->say["split_error"] . " CRC Error<b>" . $dest_name . ".crc" . "</b> !<br /><br />"; } else { $time = getNowzone(@filemtime($saveTo . $dest_name . '.crc')); while (isset($list[$time])) { $time++; } $list[$time] = array("name" => $saveTo . $dest_name . '.crc', "size" => bytesToKbOrMbOrGb(filesize($saveTo . $dest_name . '.crc')), "date" => $time); $split_buffer_size = 2 * 1024 * 1024; $split_source = @fopen($file["name"], "rb"); if (!$split_source) { echo $L->say["crc_error_open"] . " <b>" . $file["name"] . "</b> !<br /><br />"; continue; } for ($j = 1; $j <= $totalParts; $j++) { $split_dest = @fopen($saveTo . $dest_name . '.' . sprintf("%03d", $j), "wb"); if (!$split_dest) { echo $L->say["error_open_file"] . " <b>" . $dest_name . '.' . sprintf("%03d", $j) . "</b> !<br /><br />"; $split_ok = false; break; } $split_write_times = floor($partSize / $split_buffer_size); for ($k = 0; $k < $split_write_times; $k++) { $split_buffer = fread($split_source, $split_buffer_size); if (fwrite($split_dest, $split_buffer) === false) { echo $L->say["error_write_file"] . " <b>" . $dest_name . '.' . sprintf("%03d", $j) . "</b> !<br /><br />"; $split_ok = false; break; } } $split_rest = $partSize - $split_write_times * $split_buffer_size; if ($split_ok && $split_rest > 0) { $split_buffer = fread($split_source, $split_rest); if (fwrite($split_dest, $split_buffer) === false) { echo $L->say["error_write_file"] . " <b>" . $dest_name . '.' . sprintf("%03d", $j) . "</b> !<br /><br />"; $split_ok = false; } } fclose($split_dest); if ($split_ok) { $time = getNowzone(@filemtime($saveTo . $dest_name . '.' . sprintf("%03d", $j))); while (isset($list[$time])) { $time++; } $list[$time] = array("name" => $saveTo . $dest_name . '.' . sprintf("%03d", $j), "size" => bytesToKbOrMbOrGb(filesize($saveTo . $dest_name . '.' . sprintf("%03d", $j))), "date" => $time); } } fclose($split_source); if ($split_ok) { if ($_POST["del_ok"] && !$options['disable_to']['act_del']) { if (@unlink($file["name"])) { unset($list[$_POST["files"][$i]]); echo $L->say["source_del"] . "<br /><br />"; } else { echo $L->say["source_file_is"] . "<b>" . $L->say["_not_del"] . "</b><br /><br />"; } } } if (!updateListInFile($list)) { echo $L->say["couldnt_upd_list"] . "<br /><br />"; } } } }
function merge_go() { global $list, $options, $L; if (count($_POST["files"]) !== 1) { echo $L->say['select_crc_001_file_only'] . "<br /><br />"; } else { $file = $list[$_POST["files"][0]]; if (substr($file["name"], -4) == '.001' && is_file(substr($file["name"], 0, -4) . '.crc')) { echo $L->say['select_crc_file'] . "<br /><br />"; } elseif (substr($file["name"], -4) !== '.crc' && substr($file["name"], -4) !== '.001') { echo $L->say['select_crc_001_file'] . "<br /><br />"; } else { $usingcrcfile = substr($file["name"], -4) === '.001' ? false : true; if (!$usingcrcfile) { $data = array('filename' => basename(substr($file["name"], 0, -4)), 'size' => -1, 'crc32' => '00111111'); } else { $fs = @fopen($file["name"], "rb"); } if ($usingcrcfile && !$fs) { echo $L->say['cant_read_crc_file'] . "<br /><br />"; } else { if ($usingcrcfile) { $data = array(); while (!feof($fs)) { $data_ = explode('=', trim(fgets($fs)), 2); $data[$data_[0]] = $data_[1]; } fclose($fs); } $path = realpath(DOWNLOAD_DIR) . '/'; $filename = basename($data['filename']); $partfiles = array(); $partsSize = 0; for ($j = 1; $j < 10000; $j++) { if (!is_file($path . $filename . '.' . sprintf("%03d", $j))) { if ($j == 1) { $partsSize = -1; } break; } $partfiles[] = $path . $filename . '.' . sprintf("%03d", $j); $partsSize += filesize($path . $filename . '.' . sprintf("%03d", $j)); } if (file_exists($path . $filename)) { echo $L->sprintf($L->say['err_output_file_exist'], $path . $filename) . "<br /><br />"; } elseif ($usingcrcfile && $partsSize != $data['size']) { echo $L->say['err_missing_parts'] . "<br /><br />"; } elseif ($options['check_these_before_unzipping'] && is_array($options['forbidden_filetypes']) && in_array(strtolower(strrchr($filename, ".")), $options['forbidden_filetypes'])) { echo $L->sprintf($L->say['_err_filetype'], strrchr($filename, ".")) . "<br /><br />"; } else { $merge_buffer_size = 2 * 1024 * 1024; $merge_dest = @fopen($path . $filename, "wb"); if (!$merge_dest) { echo $L->sprintf($L->say['imposible_open_dir'], $path . $filename) . "<br /><br />"; } else { $merge_ok = true; foreach ($partfiles as $part) { $merge_source = @fopen($part, "rb"); while (!feof($merge_source)) { $merge_buffer = fread($merge_source, $merge_buffer_size); if ($merge_buffer === false) { echo $L->sprintf($L->say['error_read_file'], $part) . "<br /><br />"; $merge_ok = false; break; } if (fwrite($merge_dest, $merge_buffer) === false) { echo $L->sprintf($L->say['error_write_file'], $path . $filename) . "<br /><br />"; $merge_ok = false; break; } } fclose($merge_source); if (!$merge_ok) { break; } } fclose($merge_dest); if ($merge_ok) { $fc = $_POST['crc_mode'] == 'file_read' ? dechex(crc32(read_file($path . $filename))) : ($_POST['crc_mode'] == 'hash_file' && function_exists('hash_file') ? hash_file('crc32b', $path . $filename) : '111111'); $fc = str_repeat("0", 8 - strlen($fc)) . strtoupper($fc); if ($fc != strtoupper($data["crc32"])) { echo $L->say['crc32_unmatch'] . "<br /><br />"; } else { echo $L->sprintf($L->say['success_merge'], $filename) . '!<br /><br />'; if ($usingcrcfile && $fc != '00111111' && $_POST["del_ok"] && !$options['disable_to']['act_del']) { if ($usingcrcfile) { $partfiles[] = $file["name"]; } foreach ($partfiles as $part) { if (@unlink($part)) { foreach ($list as $list_key => $list_file) { if ($list_file["name"] === $part) { unset($list[$list_key]); } } echo "<b>" . basename($part) . "</b> " . $L->say['_deleted'] . ".<br />"; } else { echo "<b>" . basename($part) . "</b> " . $L->say['_not_del'] . ".<br />"; } } echo "<br />"; } $time = getNowzone(@filemtime($path . $filename)); while (isset($list[$time])) { $time++; } $list[$time] = array("name" => $path . $filename, "size" => bytesToKbOrMbOrGb($partsSize), "date" => $time); if (!updateListInFile($list)) { echo $L->say['couldnt_upd_list'] . "<br /><br />"; } } } } } } } } }