summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/index.php b/index.php
index 37f6844..4a2bc13 100644
--- a/index.php
+++ b/index.php
@@ -95,7 +95,6 @@ if (isset($_GET['C'])) {
}
$listing = array();
-$listing[0] = array();
?>
<?php
@@ -139,6 +138,29 @@ while ($this_array = each($new_array)){
$value = $this_array['value'];
$key = $this_array['key'];
+ // Drop if outside (optional) date range
+ if (isset($_GET['from'])) {
+ $from = $_GET['from'];
+ // If $from has a -, assume not Unix time
+ if (strpos($from, "-") !== false) {
+ $from = strtotime($from);
+ }
+
+ if (isset($_GET['to'])) {
+ $to = $_GET['to'];
+ // If $to has a -, assume not Unix time
+ if (strpos($to, "-") !== false) {
+ $to = strtotime($to);
+ }
+ } else {
+ $to = time();
+ }
+
+ if ($key < $from || $key > $to) {
+ continue;
+ }
+ }
+
$fileparts = explode('.', strtolower($value));
$icon = "unknown";