summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2014-07-25 11:01:29 +0100
committerLuke Bratch <l_bratch@yahoo.co.uk>2014-07-25 11:01:29 +0100
commitbbf9995ea023fe928fa9906edf50f6475f841b5a (patch)
treeb31198c28905de57040428ccf952cd3bb4fcc827
parent89eeae3a8b07c5e6ac6e332a36a4073558f5ae60 (diff)
Add plain text and lightweight formats
-rw-r--r--index.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/index.php b/index.php
index 9502134..1dcac7b 100644
--- a/index.php
+++ b/index.php
@@ -306,5 +306,15 @@ for ($i = 0; $i < count($listing); $i++) {
echo json_encode($listing);
} else if ($_GET['format'] == "raw") {
print_r($listing);
+} else if ($_GET['format'] == "plain") {
+ header("Content-type: text/plain");
+
+ for ($i = 0; $i < count($listing); $i++) {
+ echo $listing[$i]['filename'] . "\n";
+ }
+} else if ($_GET['format'] == "light") {
+ for ($i = 0; $i < count($listing); $i++) {
+ echo '<a href="' . $listing[$i]['filename'] . '">' . $listing[$i]['filename'] . '</a><br>';
+ }
}
?>