Путь: /'; if (isset($_GET['plid'])) { echo htmlentities($_GET['plid'], ENT_QUOTES, 'UTF-8'); } if (isset($_GET['elid']) and isset($_GET['plid'])) { echo '/'; } if (isset($_GET['elid'])) { echo htmlentities($_GET['elid'], ENT_QUOTES, 'UTF-8'); } echo "\n" . '' . "\n"; if (isset($_GET['plid']) and isset($_GET['elid'])) { $elid = strrchr($_GET['plid'], '/'); if ($elid !== false) { $elid = substr($elid, 1); } $plid = array_reverse(explode('/', $_GET['plid'])); $count_plid = sizeof($plid); if ($count_plid > 1) { unset($plid[0]); $plid = implode('/', array_reverse($plid)); } else { $plid = $plid[0]; } echo '..
' . "\n"; } elseif (isset($_GET['elid'])) { echo '..' . "\n"; } // --------------- Функция форматированого вывода размера объектов ------------ // function formatsize($object_size) { if ($object_size >= 1048576000) { $object_size = round(($object_size / 1073741824), 2) . 'Gb'; } elseif ($object_size >= 1024000) { $object_size = round(($object_size / 1048576), 2) . 'Mb'; } elseif ($object_size >= 1000) { $object_size = round(($object_size / 1024), 2) . 'Kb'; } else { $object_size = round($object_size) . 'b'; } return $object_size; } // --------------- Функция форматированого вывода размера объектов ------------ // $list_dir = array(); $list_symlink = array(); $list_tar = array(); $list_gz = array(); $list_bz = array(); $list_zip = array(); $list_arj = array(); $list_rar = array(); $list_file = array(); $list_log = array(); /** * @version ISP4 */ foreach($parse_xml->elem as $var) { $dname_attributes = $var->dname->attributes(); if ($dname_attributes['xprop'] == '0') { $list_dir["'.(string)$var->name.'"] = array((string)$var->name, (string)$var->dname, '0', (string)$var->attr); } elseif ($dname_attributes['xprop'] == '99') { $list_symlink["'.(string)$var->name.'"] = array((string)$var->name, (string)$var->dname, '99', (string)$var->attr); } elseif ($dname_attributes['xprop'] == '1') { $list_tar["'.(string)$var->name.'"] = array((string)$var->name, (string)$var->dname, '1', (string)$var->attr, (int)$var->size); } elseif ($dname_attributes['xprop'] == '2') { $list_gz["'.(string)$var->name.'"] = array((string)$var->name, (string)$var->dname, '2', (string)$var->attr, (int)$var->size); } elseif ($dname_attributes['xprop'] == '3') { $list_bz["'.(string)$var->name.'"] = array((string)$var->name, (string)$var->dname, '3', (string)$var->attr, (int)$var->size); } elseif ($dname_attributes['xprop'] == '4') { $list_zip["'.(string)$var->name.'"] = array((string)$var->name, (string)$var->dname, '4', (string)$var->attr, (int)$var->size); } elseif ($dname_attributes['xprop'] == '5') { $list_arj["'.(string)$var->name.'"] = array((string)$var->name, (string)$var->dname, '5', (string)$var->attr, (int)$var->size); } elseif ($dname_attributes['xprop'] == '6') { $list_rar["'.(string)$var->name.'"] = array((string)$var->name, (string)$var->dname, '6', (string)$var->attr, (int)$var->size); } elseif ($dname_attributes['xprop'] == '100') { $list_file["'.(string)$var->name.'"] = array((string)$var->name, (string)$var->dname, '100', (string)$var->attr, (int)$var->size); } elseif ($dname_attributes['xprop'] == '101') { $list_log["'.(string)$var->name.'"] = array((string)$var->name, (string)$var->dname, '101', (string)$var->attr, (int)$var->size); } } foreach ($parse_xml->elem as $data) { #exit(var_dump($data->type)); ${'list_'.$data->type}[] = $data; } //print_r($list_dir); ksort($list_dir); ksort($list_symlink); ksort($list_tar); ksort($list_gz); ksort($list_bz); ksort($list_zip); ksort($list_arj); ksort($list_rar); ksort($list_file); ksort($list_log); $list_all_num = array_merge($list_dir, $list_symlink, $list_tar, $list_gz, $list_bz, $list_zip, $list_arj, $list_rar, $list_file, $list_log); var_dump($list_all_num); if (isset($list_all_num)) { $count_all_num = sizeof($list_all_num); $s_max = ceil($count_all_num / $_SESSION['rows']); if (isset($_GET['s'])) { $s = (int)$_GET['s']; if ($s > $s_max) { $s = $s_max; } elseif ($s < 1) { $s = 1; } } else { $s = 1; } $rows_max = $s * $_SESSION['rows']-1; $rows_min = $rows_max - $_SESSION['rows'] + 1; if ($rows_max > $count_all_num-1) { $rows_max = $count_all_num-1; } echo '
' . "\n"; for($i = $rows_min; $i <= $rows_max; $i++) { // Папки if ($list_all_num[$i]->type == 'dir') { echo ' d ' . htmlentities($list_all_num[$i][1], ENT_QUOTES, 'UTF-8') . ''; if ($list_all_num[$i][3] <> '') { echo ' [' . $list_all_num[$i][3] . ']'; } echo '
' . "\n"; } // Ссылки elseif ($list_all_num[$i][2] == '99') { echo ' s ' . htmlentities($list_all_num[$i][1], ENT_QUOTES, 'UTF-8') . ''; if ($list_all_num[$i][3] <> '') { echo ' [' . $list_all_num[$i][3] . ']'; } echo '
' . "\n"; } // Tar elseif ($list_all_num[$i][2] == '1') { echo ' t ' . htmlentities($list_all_num[$i][1], ENT_QUOTES, 'UTF-8') . ''; if ($list_all_num[$i][3] <> '') { echo ' [' . $list_all_num[$i][3] . ']'; } echo ' ' . formatsize($list_all_num[$i][4]) . '
' . "\n"; } // Gz elseif ($list_all_num[$i][2] == '2') { echo ' g ' . htmlentities($list_all_num[$i][1], ENT_QUOTES, 'UTF-8') . ''; if ($list_all_num[$i][3] <> '') { echo ' [' . $list_all_num[$i][3] . ']'; } echo ' ' . formatsize($list_all_num[$i][4]) . '
' . "\n"; } // Bz elseif ($list_all_num[$i][2] == '3') { echo ' b ' . htmlentities($list_all_num[$i][1], ENT_QUOTES, 'UTF-8') . ''; if ($list_all_num[$i][3] <> '') { echo ' [' . $list_all_num[$i][3] . ']'; } echo ' ' . formatsize($list_all_num[$i][4]) . '
' . "\n"; } // Zip elseif ($list_all_num[$i][2] == '4') { echo ' z ' . htmlentities($list_all_num[$i][1], ENT_QUOTES, 'UTF-8') . ''; if ($list_all_num[$i][3] <> '') { echo ' [' . $list_all_num[$i][3] . ']'; } echo ' ' . formatsize($list_all_num[$i][4]) . '
' . "\n"; } // Arj elseif ($list_all_num[$i][2] == '5') { echo ' a ' . htmlentities($list_all_num[$i][1], ENT_QUOTES, 'UTF-8') . ''; if ($list_all_num[$i][3] <> '') { echo ' [' . $list_all_num[$i][3] . ']'; } echo ' ' . formatsize($list_all_num[$i][4]) . '
' . "\n"; } // Rar elseif ($list_all_num[$i][2] == '6') { echo ' r ' . htmlentities($list_all_num[$i][1], ENT_QUOTES, 'UTF-8') . ''; if ($list_all_num[$i][3] <> '') { echo ' [' . $list_all_num[$i][3] . ']'; } echo ' ' . formatsize($list_all_num[$i][4]) . '
' . "\n"; } // Файлы elseif ($list_all_num[$i][2] == '100') { echo ' f ' . htmlentities($list_all_num[$i][1], ENT_QUOTES, 'UTF-8') . ''; if ($list_all_num[$i][3] <> '') { echo ' [' . $list_all_num[$i][3] . ']'; } echo ' ' . formatsize($list_all_num[$i][4]) . '
' . "\n"; } // Логи elseif ($list_all_num[$i][2] == '101') { echo ' l ' . htmlentities($list_all_num[$i][1], ENT_QUOTES, 'UTF-8') . ''; if ($list_all_num[$i][3] <> '') { echo ' [' . $list_all_num[$i][3] . ']'; } echo ' ' . formatsize($list_all_num[$i][4]) . '
' . "\n"; } } echo '
'; // echo '
'; /* echo 'Действие:
' . "\n"; echo '' . "\n";*/ echo '' . "\n"; echo '
' . "\n"; echo '
' . "\n"; echo 'Папок: ' . sizeof($list_dir) . ', Ссылок: ' . sizeof($list_symlink) . ', Файлов: ' . (sizeof($list_tar) + sizeof($list_gz) + sizeof($list_bz) + sizeof($list_zip) + sizeof($list_arj) + sizeof($list_rar) + sizeof($list_file) + sizeof($list_log)) . "\n"; } else { echo '
' . "\n"; echo 'Папка пуста
' . "\n"; if (isset($_SESSION['paste'])) { echo '
' . "\n"; echo 'Действие:
' . "\n"; echo '' . "\n"; echo '
' . "\n"; echo '
' . "\n"; } } // --------------------------- Постраничная навигация ------------------------- // if (isset($list_all_num)) { if ($s_max > 1) { echo '
' . "\n"; echo 'Страницы:
' . "\n"; $s_prev = $s-2; $s_next = $s + 2; if ($s_prev < 1) { $s_prev = 1; } if ($s_next > $s_max) { $s_next = $s_max; } if ($s_prev > 2) { echo '1 ... '; } elseif ($s_prev == 2) { echo '1 '; } for($i = $s_prev; $i <= $s_next; $i++) { if ($i == $s) { echo $i . ' '; } else { echo '' . $i . ' '; } } if ($s_next < $s_max-1) { echo '... ' . $s_max . ''; } elseif ($s_next == $s_max-1) { echo '' . $s_max . ''; } echo "\n
"; } } // --------------------------- Постраничная навигация ------------------------- // echo '
' . "\n"; echo 'Меню папки:
' . "\n"; echo '» Создать
' . "\n"; echo '» Загрузить
' . "\n"; echo '» Импортировать
' . "\n"; echo '
' . "\n"; echo '"; ?>