diff options
author | Luke Bratch <l_bratch@yahoo.co.uk> | 2014-07-25 11:01:29 +0100 |
---|---|---|
committer | Luke Bratch <l_bratch@yahoo.co.uk> | 2014-07-25 11:01:29 +0100 |
commit | bbf9995ea023fe928fa9906edf50f6475f841b5a (patch) | |
tree | b31198c28905de57040428ccf952cd3bb4fcc827 /index.php | |
parent | 89eeae3a8b07c5e6ac6e332a36a4073558f5ae60 (diff) |
Add plain text and lightweight formats
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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>'; + } } ?> |