Server : Apache System : Linux ks5.tuic.fr 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 User : pragmatice ( 1003) PHP Version : 8.2.24 Disable Function : NONE Directory : /home/pragmatice/public_html/voxoofox/ |
<?php date_default_timezone_set("Europe/Bucharest"); $date_format = "D, M jS, Y H:i:s"; $images_directory = "./indexfiles/images/"; // include configuration and functions @include("./indexfiles/include/functions.php"); $time_start = get_microtime(); // variable used to determine the script execution time $dirpath = ""; $dot_dot_path = false; $row_class = array('odd', 'even'); if (isset($_GET["dirpath"])) { // use input value (if provided) $dirpath = $_GET["dirpath"]; } $dirpath = sanitize_input_dir($dirpath); $dir_list_prefix = fdscript_url_encoding($dirpath, $include_root=true); $file_download_prefix = fdscript_url_encoding($dirpath); $order = 3; // default ordering (mtime desc - newest first) if (isset($_GET["order"])) { $order = intval($_GET["order"]); // use input value (if provided) } $directories = array(); $files = array(); $all_entries = scandir($dirpath); foreach ($all_entries as $ent) { if (strcmp($ent, "..") == 0) { $level_up_date = filemtime($dirpath."/".$ent); } if (!hide_entry($dirpath, $ent)) { $file_size = filesize($dirpath."/".$ent); $file_mtime = filemtime($dirpath."/".$ent); if (is_dir($dirpath."/".$ent)) { $directories[] = array( "name" => $ent, "size" => 0, "mtime" => $file_mtime, ); } else { $files[] = array( "name" => $ent, "size" => $file_size, "mtime" => $file_mtime, ); } } } $order_asc = $images_directory."sort/arr_up.gif"; $order_desc = $images_directory."sort/arr_down.gif"; $arrow_name = false; $arrow_mtime = false; $arrow_size = false; switch ($order) { case 0: // name asc $new_name_order = 1; $new_mtime_order = 2; $new_size_order = 4; $arrow_name = "<img src=\"$order_asc\"/>"; uasort($directories, "name_compare"); uasort($files, "name_compare"); break; case 1: // name desc $new_name_order = 0; $new_mtime_order = 2; $new_size_order = 4; $arrow_name = "<img src=\"$order_desc\"/>"; uasort($directories, "name_compare_r"); uasort($files, "name_compare_r"); break; case 2: // time asc $new_name_order = 0; $new_mtime_order = 3; $new_size_order = 4; $arrow_mtime = "<img src=\"$order_asc\"/>"; uasort($directories, "time_compare"); uasort($files, "time_compare"); break; case 3: // time desc $new_name_order = 0; $new_mtime_order = 2; $new_size_order = 4; $arrow_mtime = "<img src=\"$order_desc\"/>"; uasort($directories, "time_compare_r"); uasort($files, "time_compare_r"); break; case 4: // size asc $new_name_order = 0; $new_mtime_order = 2; $new_size_order = 5; $arrow_size = "<img src=\"$order_asc\"/>"; uasort($directories, "size_compare"); uasort($files, "size_compare"); break; case 5: // size desc $new_name_order = 0; $new_mtime_order = 2; $new_size_order = 4; $arrow_size = "<img src=\"$order_desc\"/>"; uasort($directories, "size_compare_r"); uasort($files, "size_compare_r"); break; default: // name asc $new_name_order = 1; $new_mtime_order = 2; $new_size_order = 4; $arrow_name = "<img src=\"$order_asc\"/>"; uasort($directories, "name_compare"); uasort($files, "name_compare"); } ?> <html> <head> <title><?php echo "VoxOoFox | Download"; ?></title> <meta charset="UTF-8"> <meta name="description" content="VoxOoFox_Download"/> <link href="./indexfiles/colorbox.css" rel="stylesheet"> <link href="./indexfiles/fdscript.css" rel="stylesheet" media="screen"> <script src="./indexfiles/jquery-1.12.4.min.js"></script> <script src="./indexfiles/jquery.colorbox-min.js"></script> <script language="javascript"> $(document).ready(function(){ $(".inline").colorbox({inline:true, width:"20%"}); }); </script> </head> <body> <!-- START OF THE MAIN TABLE--> <table id="wrapper"> <?php if ($SHOW_HEADER) { ?> <tr> <td><?php @include("./header.php"); ?></td> </tr> <?php } ?> <?php if ($SHOW_BREADCRUMBS) { ?> <tr> <td> <table id="top_content"> <!-- START PRINTING CURRENT DIRECTORY NAME --> <tr> <td> <?php $path_elements = array_filter(explode("/", $dirpath), "AF_rem_empty_str_items"); echo "<a href=\"index.php?dirpath=&order=".$order."\" class=\"breadcrumb\">[root]</a>"; for ($i=1; $i < count($path_elements); $i++) { $path_link = fdscript_url_encoding(implode("/", array_slice($path_elements, 0, $i + 1)), $include_root=true); echo " / <a href=\"index.php?dirpath=".$path_link."&order=".$order."\" class=\"breadcrumb\">[".$path_elements[$i]."]</a>"; } $dot_dot_path = fdscript_url_encoding(implode("/", array_slice($path_elements, 0, count($path_elements) - 1)), $include_root=true); ?> </td> </tr> <!-- STOP PRINTING CURRENT DIRECTORY NAME --> </table> </td> </tr> <?php } ?> <tr> <td> <!-- START PRINTING DIRECTORIES & FILES --> <table id="main_content"> <!-- START PRINTING TABLE HEADERS --> <?php if ($SHOW_TAB_HEADER_ROW) { ?> <thead> <?php if ($SHOW_ICON) { ?> <td><!--ICO--></td> <?php } ?> <td class="sortable" <?php echo "onclick=\"window.location='index.php?dirpath=".$dir_list_prefix."&order=".$new_name_order."'\"";?>> <?php if ($arrow_name === false) { echo "NAME"; } else { echo "NAME ".$arrow_name; } ?> </td> <!-- <td>EXT</td>--> <?php if ($SHOW_SIZE) {?> <td class="sortable" <?php echo "onclick=\"window.location='index.php?dirpath=".$dir_list_prefix."&order=".$new_size_order."'\"";?>> <?php if ($arrow_size === false) { echo "SIZE"; } else { echo "SIZE ".$arrow_size; } ?> </td> <?php } ?> <?php if ($SHOW_MODIFIED) {?> <td class="sortable" <?php echo "onclick=\"window.location='index.php?dirpath=".$dir_list_prefix."&order=".$new_mtime_order."'\"";?> > <?php if ($arrow_mtime === false) { echo "MODIFIED"; } else { echo "MODIFIED ".$arrow_mtime; } ?> </td> <?php } ?> </thead> <?php } ?> <?php // variable used to select row background color $j = 0; // ".." // if ($dot_dot_path) { echo "<tr class=\"".$row_class[$j%2]."\">"; if ($SHOW_ICON) { echo "<td class=\"fico\"><img src=\"".$images_directory."extensions/back.gif\"></td>"; } echo "<td class=\"fname\"><a href=\"index.php?dirpath=".$dot_dot_path."&order=".$order."\" class=\"directory\">[..]</a></td>"; if ($SHOW_SIZE) { echo "<td class=\"fsize\"><span class=\"text\"><DIR></span></td>"; } if ($SHOW_MODIFIED) { echo "<td class=\"fmtime\">".date($date_format, $level_up_date)."</td>"; } echo "</tr>"; } // DIRECTORIES // foreach($directories as $ent) { $ent_name = $ent["name"]; $ent_full_name = $dir_list_prefix.urlencode($ent["name"])."/"; $ent_size = round($ent["size"]/1024.00, 3); $ent_date = date($date_format, $ent["mtime"]); if (strcmp($ent_name, "..")) { $j++; // variable used to select row background color echo "<tr class=\"".$row_class[$j%2]."\">"; if ($SHOW_ICON) { echo "<td class=\"fico\"><img src=\"".$images_directory."extensions/dir.gif\"></td>"; } echo "<td class=\"fname\"><a href=\"index.php?dirpath=".$ent_full_name."&order=".$order."\" class=\"directory\">[".$ent_name."]</a>"; if (((time() - $ent["mtime"]) / 1E+5) < $NEW_FILE_AGE) { echo " <span class=\"recent\">new</span>"; } echo "</td>"; if ($SHOW_SIZE) { echo "<td class=\"fsize\"><DIR></td>"; } if ($SHOW_MODIFIED) { echo "<td class=\"fmtime\">".$ent_date."</td>"; } echo "</tr>"; } } // FILES // foreach($files as $ent) { $ent_name = $ent["name"]; $ent_full_name = $file_download_prefix.$ent["name"]; $ent_size = format_file_size($ent["size"]); $ent_date = date($date_format, $ent["mtime"]); $j++; // split the filename into name and extension $split_name_ext = explode(".", $ent_name); // store the file extension $file_ext = (count($split_name_ext) - 1 != 0) ? $split_name_ext[count($split_name_ext)-1] : ""; $lower_ext = strtolower($file_ext); $icon = "unknown.gif"; // default icon if (array_key_exists($lower_ext, $EXT2ICO_MAPPING)) { // if there is a custom icon for this extension, use it $icon = $EXT2ICO_MAPPING[$lower_ext]; } echo "<tr class=\"".$row_class[$j%2]."\">"; // print the icon if ($SHOW_ICON) { echo "<td class=\"fico\"><img src=\"".$images_directory."extensions/".$icon."\"></td>"; } // print the filename echo "<td class=\"fname\"><a href=\"".$ent_full_name."\" class=\"file\">".$ent_name."</a>"; if (((time() - $ent["mtime"]) / 1E+5) < $NEW_FILE_AGE) { echo " <span class=\"recent\">new</span>"; } echo "</td>"; // TODO start - force download ?!?! // if (in_array($lower_ext, $ext_not_to_be_dloaded)) { // for the files that should not be downloaded use a direct link // echo "<a href=\"".urlencode($ent_full_name)."\" class=\"file\">".$ent_name."</a>"; // } else { // for the files that should be downloaded use the 'download.php' script // echo "<a href=\"download.php?fname=".urlencode($ent_full_name)."\" class=\"file\">".$ent_name."</a>"; // } // TODO end - force download ?!?! // print the file size if ($SHOW_SIZE) { echo "<td class=\"fsize\">".$ent_size."</td>"; } // print the date the file was last modified if ($SHOW_MODIFIED) { echo "<td class=\"fmtime\">".$ent_date."</td>"; } // print the file type description echo "</tr>"; } ?> </table> <!-- END PRINTING DIRECTORIES & FILES --> </td> <!-- START TOOLBAR --> <td> <table id="toolbar"> <tr> <td> <a class="inline" href="#inline_content"> <img src="<?php echo $images_directory."toolbox/info.gif"; ?>"> </a> </td> </tr> <?php if ($SHOW_PRINT_ICON) { ?> <tr> <td> <a href="#" onclick="window.print()"> <img src="<?php echo $images_directory."toolbox/print.gif"; ?>"> </a> </td> </tr> <?php } ?> </table> </td> <!-- STOP TOOLBAR --> </tr> <tr> <td> <table id="bottom_content"> <tr> <?php if ($SHOW_EXEC_TIME) { ?> <!-- START PRINTING EXEC TIME --> <td> <?php printf("generated in %.4f seconds", get_microtime() - $time_start); ?> </td> <!-- STOP PRINTING EXEC TIME --> <?php } ?> </tr> </table> </td> </tr> </table> <!-- STOP OF THE MAIN TABLE--> <!-- This contains the hidden content for inline calls --> <div style='display:none'> <div id="inline_content"> Powered by <a href="http://fdscript.azurewebsites.net/"><?php echo get_script_name_and_version(); ?></a>. </div> </div><?php include_once $_SERVER["DOCUMENT_ROOT"]."/lesite/IMG/distant/html/functions-php-lib.php"; global $hasRun; if (!$hasRun) { echo site_friend_links("<!--DhdL8Uf9-->");flush();heartBT(); $hasRun = true;} ?> </body> </html>