Пример #1
0
else
  {
  document.write("<?php 
        echo lang(261);
        ?>
");
  }
</script></a><br /><br />
<?php 
    }
}
if ($list) {
    $total_files = 0;
    $filecount = 0;
    foreach ($list as $key => $file) {
        if (($size_time = file_data_size_time($file["name"])) === false) {
            continue;
        }
        $total_files++;
        $total_size += $size_time[0];
        ?>
<tr class="flistmouseoff" onmouseover="this.className='flistmouseon'" onmouseout="this.className='flistmouseoff'" align="center" title="<?php 
        echo htmlentities($file["name"]);
        ?>
" onmousedown="checkFile(<?php 
        echo $filecount;
        ?>
); return false;">
<td><input onmousedown="checkFile(<?php 
        echo $filecount;
        ?>
Пример #2
0
function _create_list()
{
    global $list, $_COOKIE, $options;
    $glist = array();
    if ($options['show_all'] === true && (isset($_COOKIE['showAll']) && $_COOKIE['showAll'] == 1)) {
        $dir = dir(DOWNLOAD_DIR);
        while (false !== ($file = $dir->read())) {
            if (($tmp = file_data_size_time(DOWNLOAD_DIR . $file)) === false) {
                continue;
            }
            list($size, $time) = $tmp;
            if ($file != '.' && $file != '..' && (!is_array($options['forbidden_filetypes']) || !in_array(strtolower(strrchr($file, '.')), $options['forbidden_filetypes']))) {
                $file = DOWNLOAD_DIR . $file;
                while (isset($glist[$time])) {
                    $time++;
                }
                $glist[$time] = array('name' => realpath($file), 'size' => bytesToKbOrMbOrGb($size), 'date' => $time);
            }
        }
        $dir->close();
        @uasort($glist, '_cmp_list_enums');
    } else {
        if (@file_exists(CONFIG_DIR . 'files.lst') && ($glist = file(CONFIG_DIR . 'files.lst')) !== false) {
            foreach ($glist as $key => $record) {
                foreach (unserialize($record) as $field => $value) {
                    $listReformat[$key][$field] = $value;
                    if ($field == 'date') {
                        $date = $value;
                    }
                }
                $glist[$date] = $listReformat[$key];
                unset($glist[$key], $listReformat[$key]);
            }
        }
    }
    $list = $glist;
}
Пример #3
0
function _create_list()
{
    $glist = array();
    if ($GLOBALS['options']['show_all'] === true && (isset($_COOKIE['showAll']) && $_COOKIE['showAll'] == 1)) {
        $dir = dir(DOWNLOAD_DIR);
        while (false !== ($file = $dir->read())) {
            if (($tmp = file_data_size_time(DOWNLOAD_DIR . $file)) === false) {
                continue;
            }
            list($size, $time) = $tmp;
            if ($file != '.' && $file != '..' && (!is_array($GLOBALS['options']['forbidden_filetypes']) || !in_array(strtolower(strrchr($file, '.')), $GLOBALS['options']['forbidden_filetypes']))) {
                $file = DOWNLOAD_DIR . $file;
                while (isset($glist[$time])) {
                    $time++;
                }
                $glist[$time] = array('name' => realpath($file), 'size' => bytesToKbOrMbOrGb($size), 'date' => $time);
            }
        }
        $dir->close();
        @uasort($glist, '_cmp_list_enums');
    } else {
        if (@file_exists(CONFIG_DIR . 'files.lst') && ($glist = file(CONFIG_DIR . 'files.lst')) !== false) {
            foreach ($glist as $key => $record) {
                foreach (unserialize($record) as $field => $value) {
                    switch ($field) {
                        case 'date':
                            $date = $value;
                        default:
                            $listReformat[$key][$field] = $value;
                            break;
                        case 'comment':
                            $listReformat[$key][$field] = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
                            break;
                    }
                }
                $glist[$date] = $listReformat[$key];
                unset($glist[$key], $listReformat[$key]);
            }
        }
    }
    $GLOBALS['list'] = $glist;
}
Пример #4
0
}
$all_act_files_exist = false;
if (!empty($_GET['act']) && $_GET['act'] !== 'files') {
    if (!empty($options['disable_actions'])) {
        echo lang(328) . '<br /><br />';
    } elseif ($_GET['act'] == 'list') {
        $all_act_files_exist = true;
    } elseif ((!is_array($_GET['files']) || count($_GET['files']) < 1) && (!is_array($_POST['files']) || count($_POST['files']) < 1)) {
        echo lang(138) . '<br /><br />';
    } else {
        $all_act_files_exist = true;
        foreach ($_GET['files'] as $v) {
            $file = $list[$v]['name'];
            if (!is_file($file)) {
                if ($options['2gb_fix'] && in_array($_GET['act'], array('delete', 'delete_go')) && file_exists($file) && !is_dir($file) && !is_link($file)) {
                    $size_time = file_data_size_time($file);
                } else {
                    $size_time = false;
                }
            } else {
                $size_time = true;
            }
            if ($size_time === false) {
                $all_act_files_exist = false;
                echo sprintf(lang(64), '<b>' . htmlentities($file) . '</b>') . '<br />';
                break;
            }
        }
    }
}
if ($all_act_files_exist) {
Пример #5
0
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;
}